|
83 | 83 |
|
84 | 84 | e2e-tests: |
85 | 85 | if: ${{ vars.RUN_E2E == 'true' && inputs.environment == vars.ACTIVE_ENVIRONMENT }} |
| 86 | + needs: terraform-plan |
86 | 87 | runs-on: ubuntu-latest |
87 | 88 | permissions: |
88 | 89 | id-token: write |
|
97 | 98 | role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/auto-ops |
98 | 99 | role-session-name: github-actions |
99 | 100 |
|
| 101 | + - uses: hashicorp/setup-terraform@v3 |
| 102 | + with: |
| 103 | + terraform_version: "1.12.2" |
| 104 | + |
| 105 | + - name: Terraform Init |
| 106 | + working-directory: ${{ vars.TERRAFORM_DIR_PATH }} |
| 107 | + run: | |
| 108 | + export BUCKET_NAME=${{ vars.TERRAFORM_STATE_BUCKET_NAME_INT }} |
| 109 | + make init environment=${{ inputs.environment }} aws_account_name=${{ inputs.aws_account_name }} |
| 110 | +
|
100 | 111 | - name: Set up Python |
101 | 112 | uses: actions/setup-python@v5 |
102 | 113 | with: |
@@ -125,30 +136,29 @@ jobs: |
125 | 136 | env: |
126 | 137 | APIGEE_USERNAME: ${{ vars.APIGEE_USERNAME }} |
127 | 138 | APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }} |
128 | | - MFA_CODE: ${{ env.MFA_CODE }} |
129 | 139 | APIGEE_OAUTH_TOKEN: ${{ secrets.APIGEE_OAUTH_TOKEN }} |
130 | | - OTP_SECRET: ${{ secrets.APIGEE_OTP_KEY }} |
| 140 | + APIGEE_OTP_SECRET: ${{ secrets.APIGEE_OTP_KEY }} |
131 | 141 | run: | |
132 | | - CODE=$(oathtool --totp -b "$OTP_SECRET") |
133 | | - echo "::add-mask::$CODE" |
| 142 | + CODE=$(oathtool --totp -b "$APIGEE_OTP_SECRET") |
| 143 | + echo "::add-mask::$CODE" |
134 | 144 |
|
135 | | - echo "Requesting access token from Apigee..." |
| 145 | + echo "Requesting access token from Apigee..." |
136 | 146 |
|
137 | | - response=$(curl -s -X POST "https://login.apigee.com/oauth/token" \ |
138 | | - -H "Content-Type: application/x-www-form-urlencoded" \ |
139 | | - -H "Accept: application/json;charset=utf-8" \ |
140 | | - -H "Authorization: Basic $APIGEE_OAUTH_TOKEN" \ |
141 | | - -d "username=$APIGEE_USERNAME&password=$APIGEE_PASSWORD&mfa_token=$CODE&grant_type=password") |
| 147 | + response=$(curl -s -X POST "https://login.apigee.com/oauth/token" \ |
| 148 | + -H "Content-Type: application/x-www-form-urlencoded" \ |
| 149 | + -H "Accept: application/json;charset=utf-8" \ |
| 150 | + -H "Authorization: Basic $APIGEE_OAUTH_TOKEN" \ |
| 151 | + -d "username=$APIGEE_USERNAME&password=$APIGEE_PASSWORD&mfa_token=$CODE&grant_type=password") |
142 | 152 |
|
143 | | - token=$(echo "$response" | jq -r '.access_token // empty') |
| 153 | + token=$(echo "$response" | jq -r '.access_token // empty') |
144 | 154 |
|
145 | | - if [[ -z "$token" ]]; then |
146 | | - echo "Failed to retrieve access token" |
147 | | - exit 1 |
148 | | - fi |
| 155 | + if [[ -z "$token" ]]; then |
| 156 | + echo "Failed to retrieve access token" |
| 157 | + exit 1 |
| 158 | + fi |
149 | 159 |
|
150 | | - echo "::add-mask::$token" |
151 | | - echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV |
| 160 | + echo "::add-mask::$token" |
| 161 | + echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV |
152 | 162 |
|
153 | 163 | - name: Run e2e tests |
154 | 164 | working-directory: ${{ vars.E2E_DIR_PATH }} |
|
0 commit comments