timeout: 1800s
substitutions:
  _MYSQL_TAG: "5.7"
options:
  machineType: E2_HIGHCPU_32
steps:
- id: pull_mysql
  name : gcr.io/cloud-builders/docker
  args:
  - pull
  - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG}
- id: tag_mysql
  name: gcr.io/cloud-builders/docker
  args:
  - tag
  - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG}
  - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG}
  waitFor:
  - pull_mysql
- id: push_mysql
  name: gcr.io/cloud-builders/docker
  args:
  - push
  - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG}
  waitFor:
  - tag_mysql
- id: build_db_server
  name: gcr.io/kaniko-project/executor:v1.6.0
  args:
  - --dockerfile=examples/deployment/docker/db_server/Dockerfile
  - --destination=gcr.io/${PROJECT_ID}/db_server:${TAG_NAME}
  - --cache=true
  - --cache-dir= # Cache is in Google Container Registry
  waitFor:
  - push_mysql
- id: build_log_server
  name: gcr.io/kaniko-project/executor:v1.6.0
  args:
  - --dockerfile=examples/deployment/docker/log_server/Dockerfile
  - --destination=gcr.io/${PROJECT_ID}/log_server:${TAG_NAME}
  - --cache=true
  - --cache-dir= # Cache is in Google Container Registry
  waitFor: ["-"]
- id: build_log_signer
  name: gcr.io/kaniko-project/executor:v1.6.0
  args:
  - --dockerfile=examples/deployment/docker/log_signer/Dockerfile
  - --destination=gcr.io/${PROJECT_ID}/log_signer:${TAG_NAME}
  - --cache=true
  - --cache-dir= # Cache is in Google Container Registry
  waitFor: ["-"]
