steps:
# basic funtionality test
- name: 'gradle:7-jdk11-focal'
  id: basic-test
  args:
    - python3
    - ./integration_test/step_1.py
  env:
    - 'SHORT_SHA=${SHORT_SHA}'
    - 'IMAGEPROJECT=${_IMAGEPROJECT}'

# http2 test
- name: 'gradle:7-jdk11-focal'
  id: http2-test
  args:
    - python3
    - ./integration_test/step_2.py

# local backup test
- name: 'gradle:7-jdk11-focal'
  id: local-backup-test
  args:
    - python3
    - ./integration_test/step_3.py

# gcs backup test
- name: 'gradle:7-jdk11-focal'
  id: gcs-backup-test
  args:
    - python3
    - ./integration_test/step_4.py

# publish image
- name: ${_CLOUD_SDK_IMAGE}
  id: publish-image
  args: [ 'bash', 'integration_test/scripts/publish-images.sh', '${_IMAGEPROJECT}', '${_PUBLISH}', '${REPO_NAME}', '${PROJECT_ID}']
  secretEnv: ['GH_TOKEN']
  waitFor:
    - basic-test
    - http2-test
    - local-backup-test
    - gcs-backup-test

timeout: 3000s

substitutions:
  _IMAGEPROJECT: 'cloud-healthcare-containers'
  _CLOUD_SDK_IMAGE: 'google/cloud-sdk:290.0.0'
  _PUBLISH: 'false'

availableSecrets:
  secretManager:
  - versionName: projects/$PROJECT_ID/secrets/GH_TOKEN/versions/latest
    env: GH_TOKEN
