Deploy easytrade #8
Workflow file for this run
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
| name: Deploy easytrade | |
| on: | |
| push: | |
| tags: | |
| - '*.*.*' | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| run-tests: | |
| description: "Run integration tests after deployment?" | |
| required: false | |
| type: boolean | |
| default: true | |
| environment: | |
| description: 'The environment to deploy to' | |
| type: choice | |
| required: true | |
| default: demo-staging | |
| options: | |
| - demo-staging | |
| env: | |
| NAMESPACE: easytrade | |
| jobs: | |
| calc-version: | |
| uses: ./.github/workflows/reusable-calc-version.yaml | |
| deploy-easytrade: | |
| needs: calc-version | |
| runs-on: ubuntu-24.04 | |
| environment: ${{ github.event.inputs.environment || 'demo-staging' }} # Runs to 'demo-staging' if not specified in workflow_dispatch | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Retrieve kubeconfig | |
| run: | | |
| mkdir ~/.kube | |
| echo "${{ secrets.KUBECONFIG }}" > ~/.kube/config | |
| - name: Checkout infrastructure repo | |
| uses: actions/checkout@v6 | |
| with: | |
| ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| repository: dynatrace/easytrade-infrastructure | |
| path: easytrade-infrastructure | |
| - name: Deploy easytrade | |
| shell: bash | |
| env: | |
| HELM_CHART_VERSION: ${{ needs.calc-version.outputs.version }} | |
| BASE_VALUES_FILE: "./helm-values/aws-base.yaml" | |
| OVERRIDES_VALUES_FILE: "./helm-values/aws-staging.yaml" | |
| DRY_RUN: "false" | |
| DEBUG_MODE: "false" | |
| run: ./deploy.sh | |
| working-directory: ${{ github.workspace }}/easytrade-infrastructure | |
| run-tests: | |
| if: ${{ inputs.run-tests || true }} # Run tests by default, unless explicitly disabled in workflow_dispatch | |
| runs-on: ubuntu-24.04 | |
| needs: deploy-easytrade | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Retrieve kubeconfig | |
| run: | | |
| mkdir ~/.kube | |
| echo "${{ secrets.KUBECONFIG }}" > ~/.kube/config | |
| - name: Enable test environment | |
| run: | | |
| kubectl -n ${{ env.NAMESPACE }} set env \ | |
| deployment/easytrade-credit-card-order-service WORK_DELAY=10 WORK_RATE=10 | |
| kubectl -n ${{ env.NAMESPACE }} set env \ | |
| deployment/easytrade-third-party-service COURIER_DELAY=10 COURIER_RATE=10 MANUFACTURE_DELAY=10 MANUFACTURE_RATE=10 | |
| - name: Wait 3 minutes | |
| run: sleep 3m | |
| - name: Order credit card | |
| uses: ./.github/actions/order-credit-card | |
| with: | |
| namespace: ${{ env.NAMESPACE }} | |
| - name: Wait 12 minutes | |
| run: sleep 12m | |
| - name: Check credit card order | |
| uses: ./.github/actions/check-credit-card-order | |
| with: | |
| namespace: ${{ env.NAMESPACE }} | |
| - name: Run validation | |
| uses: ./.github/actions/run-validation | |
| with: | |
| client_id: ${{ secrets.OQR_CLIENT_ID }} | |
| client_secret: ${{ secrets.OQR_CLIENT_SECRET }} | |
| sso_url: ${{ secrets.SSO_URL }} | |
| tenant_url: ${{ secrets.OQR_URL }} | |
| - name: Disable test environment | |
| run: | | |
| kubectl -n ${{ env.NAMESPACE }} rollout undo \ | |
| deployment/easytrade-credit-card-order-service \ | |
| deployment/easytrade-third-party-service |