substitutions:
  _REGION: us-central1
steps:
- name: 'gcr.io/k8s-skaffold/skaffold'
  entrypoint: 'sh'
  args:
  - -xe
  - -c
  - |
    # Build and push images
    skaffold build --file-output=/workspace/artifacts.json \
                   --default-repo gcr.io/$PROJECT_ID \
                   --push=true

    # Test images
    skaffold test --build-artifacts=/workspace/artifacts.json

- name: 'google/cloud-sdk:latest'
  entrypoint: 'sh'
  args:
  - -xe
  - -c
  - |
    gcloud alpha deploy apply --file deploy/pipeline.yaml \
                              --file deploy/staging.yaml \
                              --file deploy/canary.yaml \
                              --file deploy/prod.yaml \
                              --region ${_REGION}
    gcloud alpha deploy releases create $SHORT_SHA-$(date +%s) \
                        --delivery-pipeline web-app \
                        --description "$(git log -1  --pretty='%s')" \
                        --region ${_REGION} \
                        --build-artifacts /workspace/artifacts.json
artifacts:
  objects:
    location: 'gs://$PROJECT_ID-gceme-artifacts/'
    paths:
    - '/workspace/artifacts.json'
options:
  machineType: E2_HIGHCPU_8
timeout: 3600s
substitutions:
  _REGION: us-central1
steps:
- name: 'gcr.io/k8s-skaffold/skaffold'
  entrypoint: 'sh'
  args:
  - -xe
  - -c
  - |
    # Build and push images
    skaffold build --file-output=/workspace/artifacts.json \
                   --default-repo gcr.io/$PROJECT_ID \
                   --push=true

    # Test images
    skaffold test --build-artifacts=/workspace/artifacts.json

- name: 'google/cloud-sdk:latest'
  entrypoint: 'sh'
  args:
  - -xe
  - -c
  - |
    gcloud alpha deploy apply --region ${_REGION} --file deploy/pipeline.yaml
    gcloud alpha deploy apply --region ${_REGION} --file deploy/staging.yaml
    gcloud alpha deploy apply --region ${_REGION} --file deploy/canary.yaml
    gcloud alpha deploy apply --region ${_REGION} --file deploy/prod.yaml

    gcloud alpha deploy releases create $SHORT_SHA-$(date +%s) \
                        --delivery-pipeline web-app \
                        --description "$(git log -1  --pretty='%s')" \
                        --region ${_REGION} \
                        --build-artifacts /workspace/artifacts.json
artifacts:
  objects:
    location: 'gs://$PROJECT_ID-gceme-artifacts/'
    paths:
    - '/workspace/artifacts.json'
options:
  machineType: E2_HIGHCPU_8
timeout: 3600s
Use individual apply commands for each file
Use individual apply commands for each file
