From d2f2a9ad41275630a86f86fba8547e1f08203d82 Mon Sep 17 00:00:00 2001 From: anaik91 Date: Sat, 28 Oct 2023 17:05:51 +0530 Subject: [PATCH] feat: added ansible test --- .github/workflows/testing.yml | 53 +++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1314fb3..79f5b1e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -57,9 +57,6 @@ jobs: name: Checkout uses: actions/checkout@v2 - - id: commit - uses: prompt/actions-commit-hash@v3 - - id: auth name: Authenticate with Google Cloud uses: google-github-actions/auth@v0 @@ -99,9 +96,6 @@ jobs: name: Checkout uses: actions/checkout@v2 - - id: commit - uses: prompt/actions-commit-hash@v3 - - id: auth name: Authenticate with Google Cloud uses: google-github-actions/auth@v0 @@ -127,3 +121,50 @@ jobs: TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} GCP_REGION: ${{ secrets.GCP_REGION }} + + deploy-runtime-plane: + name: Deploy Apigee Hybrid Runtime GKE Platform + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: + - docker-build + - deploy-runtime-plane-gke + permissions: + contents: 'read' + id-token: 'write' + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v2 + + - id: commit + uses: prompt/actions-commit-hash@v3 + + - id: auth + name: Authenticate with Google Cloud + uses: google-github-actions/auth@v0 + with: + token_format: access_token + workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_POOL_PROVIDER_NAME }} + service_account: ${{ secrets.SVC_ACCOUNT_EMAIL }} + access_token_lifetime: 300s + + - name: Login to Artifact Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.GCP_REGION }}-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + - name: Run Terraform + id: init + run: | + docker run -v ${{ github.workspace }}:/app \ + ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/ansible-helm-apigee-hybrid-deployer:${{ steps.commit.outputs.short }} \ + cd /app && ansible-playbook playbook.yaml --list-tags + shell: bash + # working-directory: ./test/scripts + env: + TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} + GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} + GCP_REGION: ${{ secrets.GCP_REGION }}