📧 chinmayeepavi@gmail.com Support

CI/CD Deployment Pipeline

Developer → Git Push → Cloud Build → Deploy to Apigee
# cloudbuild.yaml
steps:
  # Lint API proxy
  - name: 'node:18'
    entrypoint: 'npx'
    args: ['apigeelint', '-s', 'apiproxy', '-f', 'table.js']

  # Run unit tests
  - name: 'node:18'
    entrypoint: 'npm'
    args: ['test']
    dir: 'test'

  # Deploy to Apigee X
  - name: 'gcr.io/cloud-builders/gcloud'
    entrypoint: 'bash'
    args:
      - '-c'
      - |
        TOKEN=$(gcloud auth print-access-token)
        # Upload API proxy bundle
        REV=$(curl -X POST \
          "https://apigee.googleapis.com/v1/organizations/$_APIGEE_ORG/apis?name=$_API_NAME&action=import" \
          -H "Authorization: Bearer $TOKEN" \
          -H "Content-Type: application/octet-stream" \
          --data-binary @apiproxy.zip | jq -r '.revision')
        # Deploy to environment
        curl -X POST \
          "https://apigee.googleapis.com/v1/organizations/$_APIGEE_ORG/environments/$_APIGEE_ENV/apis/$_API_NAME/revisions/$REV/deployments" \
          -H "Authorization: Bearer $TOKEN"

substitutions:
  _APIGEE_ORG: 'my-org'
  _APIGEE_ENV: 'dev'
  _API_NAME: 'products-api'