Skip to content

Commit

Permalink
Merge branch 'main' into release-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf committed Mar 18, 2024
2 parents 2254eb5 + 1076108 commit 0896a01
Show file tree
Hide file tree
Showing 27 changed files with 985 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/.dockerignore
**/.git
**/bin
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
37 changes: 37 additions & 0 deletions .github/workflows/pr_ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Review ms-external-interceptor
on:
workflow_dispatch:

pull_request:
types:
- synchronize
- reopened
- ready_for_review
paths:
- '.github/workflows/pr_ms.yml'
- '.github/workflows/release_ms.yml'
- '.github/workflows/release_ms_pnpg.yml'
- '!.devops/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

code_review:
uses: pagopa/selfcare-commons/.github/workflows/call_code_review_spring.yml@main
name: 'Code Review'
secrets: inherit
if: github.base_ref == 'main' && github.event_name == 'pull_request'
with:
pr_number: ${{ github.event.pull_request.number }}
source_branch: ${{ github.head_ref }}
target_branch: ${{ github.base_ref }}
sonar_key: 'pagopa_selfcare-ms-external-interceptor'

docker_build:
uses: pagopa/selfcare-commons/.github/workflows/call_code_review_docker.yml@main
name: 'Docker'
57 changes: 57 additions & 0 deletions .github/workflows/release_ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release ms-external-interceptor

on:
workflow_dispatch:
inputs:
env:
type: choice
description: Environment
options:
- dev
- uat
- prod

push:
branches:
- main
- releases/*
paths:
- '!.devops/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

release_dev:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Dev] ExternalInterceptor ms Release'
if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }}
secrets: inherit
with:
environment: dev
tf_environment: dev
dir: 'infra/container_apps'

release_uat:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[UAT] ExternalInterceptor ms Release'
if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }}
secrets: inherit
with:
environment: uat
tf_environment: uat
dir: 'infra/container_apps'

release_prod:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Prod] ExternalInterceptor ms Release'
if: ${{ inputs.env == 'prod' }}
secrets: inherit
with:
environment: prod
tf_environment: prod
dir: 'infra/container_apps'
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ build/
### VS Code ###
.vscode/
.DS_Store

**/.terraform/*
*.tfstate
*.tfstate.*
**/.tfsec/*
override.tf
override.tf.json
*_override.tf
*_override.tf.json
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
hooks:
- id: terraform_fmt
- id: terraform_docs
- id: terraform_validate
args:
- --args=-json
- --args=-no-color
1 change: 1 addition & 0 deletions .terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.6.6
21 changes: 21 additions & 0 deletions Dockerfile.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM maven:3-eclipse-temurin-17 AS builder

COPY . .

RUN mvn clean package -DskipTests=true

FROM openjdk:17-jdk AS runtime

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

WORKDIR /app

COPY --from=builder ./target/*.jar ./app.jar

ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.2.11/applicationinsights-agent-3.2.11.jar ./applicationinsights-agent.jar
RUN chmod 755 ./applicationinsights-agent.jar

EXPOSE 8080
USER 1001

ENTRYPOINT ["java", "-jar", "app.jar"]
117 changes: 117 additions & 0 deletions Dockerfile.new.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
**/.dockerignore
**/.git
**/bin
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

**/.idea
.idea
**/.mvn
.mvn

**/target

# Created by .ignore support plugin (hsz.mobi)
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
### Java template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests
48 changes: 48 additions & 0 deletions infra/container_apps/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions infra/container_apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Container App

Deploy container on a Container App instance.

<!-- markdownlint-disable -->
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6.0 |

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_container_app_dashboard_backend"></a> [container\_app\_dashboard\_backend](#module\_container\_app\_dashboard\_backend) | github.com/pagopa/selfcare-commons//infra/terraform-modules/container_app_microservice | main |

## Resources

No resources.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_app_settings"></a> [app\_settings](#input\_app\_settings) | n/a | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | n/a | yes |
| <a name="input_container_app"></a> [container\_app](#input\_container\_app) | Container App configuration | <pre>object({<br> min_replicas = number<br> max_replicas = number<br><br> scale_rules = list(object({<br> name = string<br> custom = object({<br> metadata = map(string)<br> type = string<br> })<br> }))<br><br> cpu = number<br> memory = string<br> })</pre> | n/a | yes |
| <a name="input_env_short"></a> [env\_short](#input\_env\_short) | Environment short name | `string` | n/a | yes |
| <a name="input_image_tag"></a> [image\_tag](#input\_image\_tag) | Image tag to use for the container | `string` | `"latest"` | no |
| <a name="input_is_pnpg"></a> [is\_pnpg](#input\_is\_pnpg) | (Optional) True if you want to apply changes to PNPG environment | `bool` | `false` | no |
| <a name="input_secrets_names"></a> [secrets\_names](#input\_secrets\_names) | KeyVault secrets to get values from | `map(string)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | n/a | yes |

## Outputs

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1 change: 1 addition & 0 deletions infra/container_apps/env/dev/backend.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subscription=DEV-SelfCare
4 changes: 4 additions & 0 deletions infra/container_apps/env/dev/backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource_group_name = "terraform-state-rg"
storage_account_name = "tfappdevselfcare"
container_name = "terraform-state"
key = "selfcare-external-interceptor.container_app.tfstate"
Loading

0 comments on commit 0896a01

Please sign in to comment.