Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add inputs to k8s apply workflow #18

Merged
merged 35 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e53e4c7
add terraform folder, edit k8s-apply workflow, add tf-apply workflow
micheledellipaoli-pagopa Dec 13, 2024
0e83c8e
remove microservices-list.json
micheledellipaoli-pagopa Dec 13, 2024
aeb4f94
add script to get cloudwatch log metric filters; add some fix to the …
micheledellipaoli-pagopa Dec 17, 2024
f268cca
edit after review
micheledellipaoli-pagopa Dec 23, 2024
124f31c
comment initChecks job
micheledellipaoli-pagopa Dec 23, 2024
241023b
remove microservices-list.json file from gitignore
micheledellipaoli-pagopa Dec 23, 2024
d417136
remove microservices-list.json file from gitignore
micheledellipaoli-pagopa Dec 23, 2024
cab1828
edit Create microservices JSON step
micheledellipaoli-pagopa Dec 23, 2024
6005a12
edit Create microservices JSON step
micheledellipaoli-pagopa Dec 23, 2024
42b7ede
edit Create microservices JSON step
micheledellipaoli-pagopa Dec 23, 2024
aee9e4c
edit Create microservices JSON step
micheledellipaoli-pagopa Dec 23, 2024
9eef1ce
remove sso_admin data source
micheledellipaoli-pagopa Dec 23, 2024
edf097e
add norm_env step in workflow_setup job
micheledellipaoli-pagopa Dec 23, 2024
3160ceb
edit tf-apply workflow
micheledellipaoli-pagopa Dec 23, 2024
e7914da
add tags to module and update tag
micheledellipaoli-pagopa Dec 23, 2024
4e55c96
test the add of a new deployment
micheledellipaoli-pagopa Dec 23, 2024
b6f22d2
remove the test deployment
micheledellipaoli-pagopa Dec 23, 2024
9da4af0
add the test deployment
micheledellipaoli-pagopa Dec 23, 2024
216f49c
remove the test deployment
micheledellipaoli-pagopa Dec 23, 2024
225224c
test retagging alarms
micheledellipaoli-pagopa Dec 23, 2024
5412ad6
test retagging alarms
micheledellipaoli-pagopa Dec 23, 2024
dced4ff
test retagging alarms
micheledellipaoli-pagopa Dec 23, 2024
e9be4cd
remove testing tag from alarms
micheledellipaoli-pagopa Dec 23, 2024
04ab948
remove testing tag from alarms
micheledellipaoli-pagopa Dec 23, 2024
ead4e32
add cronjobs monitoring alarms, edit data external
micheledellipaoli-pagopa Jan 3, 2025
6596d6e
edit Create microservices JSON step
micheledellipaoli-pagopa Jan 3, 2025
dbf374f
edit Create microservices JSON step
micheledellipaoli-pagopa Jan 3, 2025
ea48ceb
edit Create cronjobs JSON step
micheledellipaoli-pagopa Jan 3, 2025
2e44778
Remove comments from k8s-apply.yaml
micheledellipaoli-pagopa Jan 3, 2025
58e0c70
add clean-up job
micheledellipaoli-pagopa Jan 3, 2025
66bfc70
Merge branch 'main' into PIN-5811-automating-deployments-jobs-monitoring
micheledellipaoli-pagopa Jan 3, 2025
a2176f6
edit set-outputs step, add inputs to k8s-apply workflow
micheledellipaoli-pagopa Jan 7, 2025
618094d
edit description of inputs
micheledellipaoli-pagopa Jan 7, 2025
ef5546c
edit delete_runner job condition
micheledellipaoli-pagopa Jan 7, 2025
d4cd03e
edit job conditions
micheledellipaoli-pagopa Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/k8s-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ on:
required: true
default: false
type: boolean
run_k8s_workflow:
description: 'Run k8s deployment jobs'
required: true
default: false
type: boolean
run_tf_workflow:
description: 'Run TF apply job'
required: true
default: false
type: boolean

permissions:
id-token: write
Expand All @@ -28,6 +38,8 @@ jobs:
echo "- environment: \`${{ inputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
echo "- ref: \`${{ github.ref }}\`" >> $GITHUB_STEP_SUMMARY
echo "- force_restart: \`${{ inputs.force_restart }}\`" >> $GITHUB_STEP_SUMMARY
echo "- run_k8s_workflow: \`${{ inputs.run_k8s_workflow }}\`" >> $GITHUB_STEP_SUMMARY
echo "- run_tf_workflow: \`${{ inputs.run_tf_workflow }}\`" >> $GITHUB_STEP_SUMMARY

initChecks:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -84,6 +96,7 @@ jobs:
matrix:
index: [1,2,3,4,5,6,7,8,9,10]
fail-fast: false
if: ${{ inputs.run_k8s_workflow == true }}
steps:
- name: Start GitHub Runner
id: start_runner
Expand All @@ -105,6 +118,7 @@ jobs:
deploy:
needs: [ create_runner ]
secrets: inherit
if: ${{ inputs.run_k8s_workflow == true }}
uses: ./.github/workflows/k8s-apply-sub.yaml
with:
environment: ${{ inputs.environment }}
Expand All @@ -113,7 +127,7 @@ jobs:
delete_runner:
name: Delete Self-Hosted Runner
needs: [create_runner, deploy]
if: ${{ always() }}
if: ${{ always() && inputs.run_k8s_workflow == true }}
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
strategy:
Expand All @@ -133,6 +147,7 @@ jobs:

tf_apply:
secrets: inherit
if: ${{ inputs.run_tf_workflow == true }}
uses: ./.github/workflows/tf-apply.yaml
with:
environment: ${{ inputs.environment }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tf-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:

- id: set-outputs
run: |
echo "microservices=$(find microservices -type f -path "*/$NORM_ENV/values.yaml" -exec dirname {} \; | awk -F'/' '{print $2}' | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"
echo "cronjobs=$(find jobs -type f -path "*/$NORM_ENV/values.yaml" -exec dirname {} \; | awk -F'/' '{print $2}' | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"
echo "microservices=$(find microservices -type f -path "*/$NORM_ENV/values.yaml" -exec yq '.name' {} \; | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"
echo "cronjobs=$(find jobs -type f -path "*/$NORM_ENV/values.yaml" -exec yq '.name' {} \; | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"

terraform_apply_monitoring:
name: Terraform Apply Monitoring
Expand Down