Skip to content

Commit ea77186

Browse files
ttamurajrGabriel Vieira LavorgabriellavorJuanOiolidiego-dm-morais
authored
Update noverde repo (#19)
* feat: criação de nova action * ajuste na action * add permission * correção APPNAME * add platform * ajuste do nome * adicionar environment * ajuste nome da variavel * ajuste url elk uat * removendo env * adicionar aspas e remover escapes * adicionar espaço * ajuste * trazer variaveis para o projeto * remover entradas não usadas * add env qa (#2) * adicionar action para definir as variáveis de ambiente --------- Co-authored-by: Gabriel Vieira Lavor <gabriel.lavor@dotzmkt.com.br> * Feat: modifying elk url get by workflow input * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube (#5) * First commit to test * feat: update sonarqube (#6) * feat: update pipeline test * feat: update pipeline test * feat: update pipeline test * feat: update pipeline test * feat: update pipeline test (#7) * Feat: Creating Bump Tag Action (#8) * add tag bump feature * add dockerfile on bump tag feature * fix dockerfile * edit desctiptions * Removing if need run to workflow * Fix: field of function * Fix: Regex to get responsible * Adding Slack Test channel * Adding vars inherit secrets * Fix: variables pattern * feat: add sonarqube dot net (#13) * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * Fix: copy variable * Fix: Channel ID * Adding GMUD channel ID * feat: add sonarqube (#16) * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * Feat: update sonarqube (#17) * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add sonarqube * feat: add action sonarqube angular (#18) * feat: add sonarqube * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * feat: update code * Adding Enviroments for Rollback Dotnet Pipeline (#19) * Feat: Adding Approvers to Slack msg on GMUD * Adding action to add envs on gcp images (#21) * Feat: Improve JSON of GMUD action * PR Adjusts * PR Adjusts * PR Adjusts --------- Co-authored-by: Gabriel Vieira Lavor <gabriel.lavor@dotzmkt.com.br> Co-authored-by: Gabriel Lavor <gvlavor@gmail.com> Co-authored-by: JuanOioli <fe.juan@gmail.com> Co-authored-by: Juan Ferreira Oioli <56684223+JuanOioli@users.noreply.github.com> Co-authored-by: dev morais <diego.morais@labsit.io> Co-authored-by: Diego Morais <104941487+diego-dm-morais@users.noreply.github.com> Co-authored-by: Alexandre Macedo <alexandre.maedo@noverde.com.br> Co-authored-by: Alexandre Macedo <alexandremac@gmail.com> Co-authored-by: Alexandre Macedo <alexandre@Mac-Pro-de-Alexandre.local>
1 parent 896d9e9 commit ea77186

File tree

24 files changed

+1416
-0
lines changed

24 files changed

+1416
-0
lines changed

bake-apm-service-version/action.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Resolve project ID: prefer input, else gcloud config
5+
PROJECT_ID_RESOLVED="${PROJECT_ID:-}"
6+
if [[ -z "$PROJECT_ID_RESOLVED" ]]; then
7+
PROJECT_ID_RESOLVED="$(gcloud config get-value project 2>/dev/null || true)"
8+
fi
9+
10+
if [[ -z "$PROJECT_ID_RESOLVED" || "$PROJECT_ID_RESOLVED" == "(unset)" ]]; then
11+
echo "Could not determine GCP project from gcloud config. Ensure auth step set the project, or pass project_id input."
12+
exit 1
13+
fi
14+
15+
if [[ -z "${GCP_REGION:-}" ]]; then
16+
echo "Input gcp_region is required"
17+
exit 1
18+
fi
19+
20+
if [[ -z "${REPOSITORY_NAME:-}" ]]; then
21+
echo "Input repository_name is required"
22+
exit 1
23+
fi
24+
25+
if [[ -z "${TAG_VERSION:-}" ]]; then
26+
echo "Input tag_version is required"
27+
exit 1
28+
fi
29+
30+
IMAGE_URL="${GCP_REGION}-docker.pkg.dev/${PROJECT_ID_RESOLVED}/${PROJECT_ID_RESOLVED}/${REPOSITORY_NAME}:${GITHUB_SHA}"
31+
TMPDIR="$(mktemp -d)"
32+
trap 'rm -rf "$TMPDIR"' EXIT
33+
34+
echo "Baking ELASTIC_APM_SERVICE_VERSION into image: $IMAGE_URL"
35+
36+
# Build a tiny wrapper image setting ELASTIC_APM_SERVICE_VERSION, using the resolved base image
37+
cat > "$TMPDIR/Dockerfile" << EOF
38+
FROM ${IMAGE_URL}
39+
ENV ELASTIC_APM_SERVICE_VERSION=${TAG_VERSION}
40+
EOF
41+
42+
# Build and push to the same tag so Terraform deploys this exact image
43+
gcloud builds submit --tag "$IMAGE_URL" "$TMPDIR"
44+
45+
echo "Successfully built and pushed: $IMAGE_URL"
46+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Bake APM Service Version
2+
description: Build and push an image that sets ELASTIC_APM_SERVICE_VERSION using Cloud Build
3+
4+
inputs:
5+
gcp_region:
6+
required: true
7+
description: GCP region, e.g., us-central1
8+
repository_name:
9+
required: true
10+
description: Artifact Registry repository name
11+
tag_version:
12+
required: true
13+
description: Value for ELASTIC_APM_SERVICE_VERSION
14+
project_id:
15+
required: false
16+
description: Optional GCP project ID (overrides gcloud config)
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Bake ELASTIC_APM_SERVICE_VERSION into image tag
22+
shell: bash
23+
run: ${{ github.action_path }}/action.sh
24+
env:
25+
GCP_REGION: ${{ inputs.gcp_region }}
26+
REPOSITORY_NAME: ${{ inputs.repository_name }}
27+
TAG_VERSION: ${{ inputs.tag_version }}
28+
PROJECT_ID: ${{ inputs.project_id }}
29+

environment-dotnet/action.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$GITHUB_REF_NAME" = 'main' ]; then
4+
ENVIRONMENT='prd'
5+
JWT_JWKS_PATH="https://api.dotz.com.br/accounts/api/default/"
6+
elif [ "$GITHUB_REF_NAME" = 'staging' ]; then
7+
ENVIRONMENT='uat'
8+
JWT_JWKS_PATH="https://uat.dotznext.com/accounts/api/default/"
9+
elif [ "$GITHUB_REF_NAME" = 'qa' ]; then
10+
ENVIRONMENT='uat'
11+
JWT_JWKS_PATH="https://uat.dotznext.com/accounts/api/default/"
12+
else
13+
ENVIRONMENT='dev'
14+
JWT_JWKS_PATH="https://uat.dotznext.com/accounts/api/default/"
15+
fi
16+
17+
{
18+
echo ""
19+
if ! [ "$ENVIRONMENT" = "dev" ]; then
20+
echo "ELASTIC_APM_ENABLED: 'true'"
21+
fi
22+
echo "JWT_JWKS_PATH: '$JWT_JWKS_PATH'"
23+
echo "JKS_SAFE_IPS: '$JKS_SAFE_IPS'"
24+
echo "JKS_GOOGLE_PROJECTID: '$GOOGLE_PROJECTID'"
25+
echo "ELASTIC_APM_SERVER_URL: '$ELASTIC_APM_SERVER_URL'"
26+
} > tmpfile
27+
28+
cat ./envs/env-$ENVIRONMENT.yaml tmpfile > merged_temp.yaml
29+
awk '
30+
BEGIN { FS=": " }
31+
!/^[[:space:]]*$/ && !/^#/ {
32+
key = $1
33+
if (!seen[key]) {
34+
print
35+
seen[key] = 1
36+
}
37+
}
38+
' merged_temp.yaml > ./envs/env-$ENVIRONMENT.yaml
39+
rm tmpfile merged_temp.yaml

environment-dotnet/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Create Env
2+
description: Create Env
3+
4+
inputs:
5+
ref_name:
6+
required: true
7+
description: ref_name
8+
project_id:
9+
required: true
10+
description: project_id
11+
safe_ips:
12+
required: true
13+
description: safe_ips
14+
runs:
15+
using: composite
16+
steps:
17+
- name: Create Env
18+
shell: bash
19+
run: ${{ github.action_path }}/action.sh
20+
env:
21+
GITHUB_REF_NAME: ${{ inputs.ref_name }}
22+
GOOGLE_PROJECTID: ${{ inputs.project_id}}
23+
JKS_SAFE_IPS: ${{ inputs.safe_ips }}

environment-test-dotnet/action.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
FILE=./envs/env-dev.yaml
4+
while IFS= read -r line
5+
do
6+
if [[ ! $line =~ ^# ]] && [[ $line =~ [^[:space:]] ]]
7+
then
8+
IFS=":" read -r key value <<< "$line"
9+
key=$(echo "$key" | xargs)
10+
value=$(echo "$value" | xargs)
11+
echo "$key=$value" >> "$GITHUB_ENV"
12+
fi
13+
done < "$FILE"

environment-test-dotnet/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Create Env
2+
description: Create Env
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Create Env Test
8+
shell: bash
9+
run: ${{ github.action_path }}/action.sh

0 commit comments

Comments
 (0)