Skip to content

Commit

Permalink
feat: added ansible test
Browse files Browse the repository at this point in the history
  • Loading branch information
anaik91 committed Oct 28, 2023
1 parent 4cac9f3 commit 1dc545a
Showing 1 changed file with 52 additions and 6 deletions.
58 changes: 52 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -127,3 +121,55 @@ 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'
container:
image: ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/ansible-helm-apigee-hybrid-deployer:latest
credentials:
username: mona
password: ${{ secrets.docker_hub_password}}
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 }}

0 comments on commit 1dc545a

Please sign in to comment.