# In this directory, run the following command to build this builder.
# $ gcloud builds submit

steps:
- name: 'gcr.io/cloud-builders/docker'
  args:
  - 'build'
  - '--build-arg=BASE_IMAGE=gcr.io/cloud-builders/javac:8'
  - '--build-arg=GRADLE_VERSION=5.6.2'
  - '--build-arg=SHA=32fce6628848f799b0ad3205ae8db67d0d828c10ffe62b748a7c0d9f4a5d9ee0'
  - '--tag=gcr.io/$PROJECT_ID/gradle'
  - '--tag=gcr.io/$PROJECT_ID/gradle:5.6.2-jdk-8'
  - '--tag=gcr.io/$PROJECT_ID/java/gradle'
  - '--tag=gcr.io/$PROJECT_ID/java/gradle:5.6.2-jdk-8'
  - '.'

- name: 'gcr.io/cloud-builders/docker'
  args:
  - 'build'
  - '--build-arg=BASE_IMAGE=gcr.io/cloud-builders/javac:8'
  - '--build-arg=GRADLE_VERSION=4.6'
  - '--build-arg=SHA=98bd5fd2b30e070517e03c51cbb32beee3e2ee1a84003a5a5d748996d4b1b915'
  - '--tag=gcr.io/$PROJECT_ID/gradle:4.6-jdk-8'
  - '--tag=gcr.io/$PROJECT_ID/java/gradle:4.6-jdk-8'
  - '.'

- name: 'gcr.io/cloud-builders/docker'
  args:
  - 'build'
  - '--build-arg=BASE_IMAGE=gcr.io/cloud-builders/javac:8'
  - '--build-arg=GRADLE_VERSION=4.0'
  - '--build-arg=SHA=56bd2dde29ba2a93903c557da1745cafd72cdd8b6b0b83c05a40ed7896b79dfe'
  - '--tag=gcr.io/$PROJECT_ID/gradle:4.0-jdk-8'
  - '--tag=gcr.io/$PROJECT_ID/java/gradle:4.0-jdk-8'
  - '.'

- name: 'gcr.io/cloud-builders/docker'
  args:
  - 'build'
  - '--build-arg=BASE_IMAGE=gcr.io/cloud-builders/javac:8'
  - '--build-arg=GRADLE_VERSION=3.5'
  - '--build-arg=SHA=0b7450798c190ff76b9f9a3d02e18b33d94553f708ebc08ebe09bdf99111d110'
  - '--tag=gcr.io/$PROJECT_ID/gradle:3.5-jdk-8'
  - '--tag=gcr.io/$PROJECT_ID/java/gradle:3.5-jdk-8'
  - '.'

# Run examples
- name: 'gcr.io/$PROJECT_ID/gradle:4.6-jdk-8'
  args: ['build']
  dir: 'examples/spring_boot'
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '.']
  dir: 'examples/spring_boot'

- name: 'gcr.io/$PROJECT_ID/gradle:4.6-jdk-8'
  args: ['build']
  dir: 'examples/spring_boot_compat'
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '.']
  dir: 'examples/spring_boot_compat'

- name: 'gcr.io/$PROJECT_ID/gradle:4.0-jdk-8'
  args: ['build']
  dir: 'examples/spring_boot_compat'
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '.']
  dir: 'examples/spring_boot_compat'

- name: 'gcr.io/$PROJECT_ID/gradle:3.5-jdk-8'
  args: ['build']
  dir: 'examples/spring_boot_compat'
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '.']
  dir: 'examples/spring_boot_compat'

images:
- 'gcr.io/$PROJECT_ID/gradle'
- 'gcr.io/$PROJECT_ID/gradle:5.6.2-jdk-8'
- 'gcr.io/$PROJECT_ID/gradle:4.6-jdk-8'
- 'gcr.io/$PROJECT_ID/gradle:4.0-jdk-8'
- 'gcr.io/$PROJECT_ID/gradle:3.5-jdk-8'
- 'gcr.io/$PROJECT_ID/java/gradle'
- 'gcr.io/$PROJECT_ID/java/gradle:5.6.2-jdk-8'
- 'gcr.io/$PROJECT_ID/java/gradle:4.6-jdk-8'
- 'gcr.io/$PROJECT_ID/java/gradle:4.0-jdk-8'
- 'gcr.io/$PROJECT_ID/java/gradle:3.5-jdk-8'
