timeout: 7200s

steps:
  # [START copy-repo]
  - name: google/cloud-sdk
    id: "copy-repo"
    entrypoint: bash
    args:
      - "-c"
      - |
        . .cloud-build/clone-repo/clone_repo.sh
  # [END copy-repo]
  # [START execute-notebooks]
  - name: google/cloud-sdk
    id: "execute-notebooks"
    entrypoint: bash
    timeout: 7200s # Because this step takes the longest. Avg runtime is 1 hour and 20 minutes.
    args:
      - "-c"
      - |
        gcloud secrets versions access latest --secret=NOTEBOOK_RUNTIME_TEMPLATE > NOTEBOOK_RUNTIME_TEMPLATE
        gcloud secrets versions access latest --secret=PROJECT_ID > PROJECT_ID
        gcloud secrets versions access latest --secret=REGION > REGION
        gcloud secrets versions access latest --secret=SA_EMAIL > SA
        gcloud secrets versions access latest --secret=GCS_BUCKET > OUTPUT_URI
        gcloud secrets versions access latest --secret=PS_TOPIC > PS_TOPIC
        . .cloud-build/executor/test_notebooks.sh
# [END execute-notebooks]
# [START github-notification]
#- name: google/cloud-sdk
#  id: 'github-notification'
#  entrypoint: bash
#  args:
#  - '-c'
#  - |
#    gcloud secrets versions access latest --secret=GH_token > GH_token.txt

#    . .cloud-build/github-issue/ghcli-install.sh
#    . .cloud-build/github-issue/auto_issue_create.sh

# [END github-notification]

logsBucket: ${_LOG_BUCKET}
