-
Notifications
You must be signed in to change notification settings - Fork 1
Tt 513 create ci/cd pipeline in timer tracker UI to deploy changes for both environments #833
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
Merged
santii90ec
merged 43 commits into
master
from
TT-513-Create-CI/CD-pipeline-in-timer-tracker-ui-to-deploy-changes-for-both-environments
Mar 25, 2022
+332
−34
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
62d569b
feat: TT-509 Use terraform to provision ui infraestructure
jatobrun 3fe4e5e
fix: TT-509 expose port 8080 in docker images
jatobrun 6cc64e6
fix: TT-509 change app to port 80
jatobrun 483cf6a
fix: TT-509 including empty line in all files
jatobrun a4b8426
fix: TT-509 Change the dockerfile to use root user and not app user
jatobrun da8e769
parent bf8977e79ef18ac85a09f9c55b213c72146c0de7
heikergil 06735a0
fix: TT-513 tests cd-stage.yml
heikergil 09235cf
feat: TT-513 CD - Prod yaml file
santii90ec d85bbe2
fix: TT-513 tests azure credentials
heikergil 9cce0c9
fix: TT-513 change image tag variable
heikergil 8b6fd37
fix: TT-513 add acr
heikergil 81dae65
fix: TT-513 fix make publish
heikergil 16671fe
fix: TT-513 fix make
heikergil 0e496cc
fix: TT-513 change acr
heikergil cb9246a
feat: TT-513 cli test and dev test make file
santii90ec aebce8d
Merge branch 'TT-513-Create-CI/CD-pipeline-in-timer-tracker-ui-to-dep…
santii90ec b434d10
Merge branch 'TT-513-Create-CI/CD-pipeline-in-timer-tracker-ui-to-dep…
heikergil dd8f99d
TT-513 fix make publish command
heikergil fcd887c
fix: TT-513 change registry url
heikergil 4a60730
fix: TT-513 fix registry url
heikergil 15af506
fix: TT-513 test CI/CD pipeline
heikergil e5a3dd1
fix: TT-513 tests cd/ci make build
heikergil ab6e6fe
fix: TT-513 test tf init on ci/cd
heikergil 9740043
fix: TT-513 test tags
heikergil b732dc4
fix: TT-513 Fix CI on all PR
santii90ec 9bd67e5
fix: TT-513 Fix CI pipeline
santii90ec f8c817c
fix: TT-513 Fix Make file for dev testing
santii90ec 214e563
fix: TT-513 fix make publish
heikergil be6524b
delete comments
heikergil 02591f8
fix: TT-513 Fix CI on all PR
santii90ec 43042db
fix: TT-513 fix make publish
heikergil 301182c
fix: TT-509 Change the dockerfile to use root user and not app user
jatobrun 4dd2f95
delete comments
heikergil 4a8aa30
fix: TT-513 Merge with master
santii90ec 254190e
fix: TT-513 master rebase
heikergil 4148493
fix: TT-513 change make publish
heikergil 82f6b3e
fix: TT-513 fix dockerfile
heikergil 56b6deb
TT-513: Fix ci pipeline
faustocv b725aa2
TT-513: Triggering pipeline in all branches. WIP
faustocv 83b0e86
fix: TT-513 add acr variable to make login
heikergil edb2b75
TT-513: Triggering TF plan in all branches
faustocv d7727e2
TT-513: Makes cd stage pipeline more readable
faustocv 25a587b
TT-513: Makes cd stage pipeline more readable
faustocv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
delete comments
rebase master
- Loading branch information
commit 4dd2f95bb53c3cf7ab5a2d9e26e52543eccad0cc
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| name: time-tracker-ui-ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| WORKING_DIR: infrastructure/ | ||
| DB_CONNECTION: ${{ secrets.DB_CONNECTION }} | ||
| ARM_CLIENT_ID: ${{secrets.TF_ARM_CLIENT_ID}} | ||
| ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}} | ||
| ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}} | ||
| ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}} | ||
| strategy: | ||
| max-parallel: 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Authenticate with the TF modules repository | ||
| uses: webfactory/[email protected] | ||
| with: | ||
| ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }} | ||
|
|
||
| - name: build docker | ||
| run: make build | ||
|
|
||
| - name: Inject Secrets | ||
| env: | ||
| SCOPES: ${{ secrets.SCOPES }} | ||
| CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
| AUTHORITY: ${{ secrets.AUTHORITY }} | ||
| STACK_EXCHANGE_ID: ${{ secrets.STACK_EXCHANGE_ID }} | ||
| STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }} | ||
| AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }} | ||
| run: | | ||
| chmod +x ./scripts/populate-keys.sh | ||
| sh ./scripts/populate-keys.sh | ||
|
|
||
| - name: Running tests | ||
| run: | | ||
| chmod -R 777 ./$home | ||
| make test | ||
| - name: Generate coverage report | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| run: bash <(curl -s https://codecov.io/bash) | ||
|
|
||
| - name: Setup terraform | ||
| uses: hashicorp/setup-terraform@v1 | ||
|
|
||
| - name: 'Terraform Init' | ||
| id: init | ||
| working-directory: ./${{ env.WORKING_DIR }} | ||
| run: terraform init | ||
|
|
||
| - name: 'Terraform validate' | ||
| id: validate | ||
| working-directory: ./${{ env.WORKING_DIR }} | ||
| run: terraform validate | ||
|
|
||
| - name: Terraform Plan Stage | ||
| id: plan-stage | ||
| if: github.event_name == 'pull_request' | ||
| run: terraform plan -var-file=${{ env.TF_WORKSPACE }}.tfvars -var image_tag=latest -no-color | ||
| continue-on-error: true | ||
| working-directory: ./${{ env.WORKING_DIR }} | ||
| env: | ||
| TF_WORKSPACE: stage | ||
|
|
||
| - name: Terraform Plan Prod | ||
| id: plan-prod | ||
| if: github.event_name == 'pull_request' | ||
| run: terraform plan -var-file=${{ env.TF_WORKSPACE }}.tfvars -no-color | ||
| continue-on-error: true | ||
heikergil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| working-directory: ./${{ env.WORKING_DIR }} | ||
| env: | ||
| TF_WORKSPACE: prod | ||
|
|
||
| - name: Update Pull Request with Stage Plan | ||
| uses: actions/[email protected] | ||
| if: github.event_name == 'pull_request' | ||
| env: | ||
| PLAN: "terraform\n${{ steps.plan-stage.outputs.stdout }}" | ||
| TF_WORKSPACE: stage | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const output = `#### [${{ env.WORKING_DIR }}][${{ env.TF_WORKSPACE }}] Terraform Plan 📖 \`${{ steps.plan-stage.outcome }}\` | ||
| <details><summary>Show Plan</summary> | ||
| \`\`\`\n | ||
| ${process.env.PLAN} | ||
| \`\`\` | ||
| </details> | ||
| *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; | ||
| github.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: output | ||
| }) | ||
| - name: Update Pull Request with Prod Plan | ||
| uses: actions/[email protected] | ||
| if: github.event_name == 'pull_request' | ||
| env: | ||
| PLAN: "terraform\n${{ steps.plan-prod.outputs.stdout }}" | ||
| TF_WORKSPACE: prod | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const output = `#### [${{ env.WORKING_DIR }}][${{ env.TF_WORKSPACE }}] Terraform Plan 📖 \`${{ steps.plan-prod.outcome }}\` | ||
| <details><summary>Show Plan</summary> | ||
| \`\`\`\n | ||
| ${process.env.PLAN} | ||
| \`\`\` | ||
| </details> | ||
| *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; | ||
| github.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: output | ||
| }) | ||
| - name: Terraform Plan Stage Status | ||
| if: steps.plan-stage.outcome == 'failure' | ||
| run: exit 1 | ||
|
|
||
| - name: Terraform Plan Prod Status | ||
| if: steps.plan-prod.outcome == 'failure' | ||
| run: exit 1 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.