forked from spring-projects/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
44 lines (42 loc) · 1.2 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
steps:
- name: 'openjdk:11'
entrypoint: './mvnw'
args: ['package']
- name: 'gcr.io/cloud-builders/docker'
args: ['build',
'-t',
'${_ARTIFACT_REGISTRY_REPO}/images/spring-petclinic:$SHORT_SHA',
'-t',
'${_ARTIFACT_REGISTRY_REPO}/images/spring-petclinic:latest',
'-f',
'spring-petclinic.dockerfile',
'.']
- name: 'gcr.io/$PROJECT_ID/helm'
args: ['package', 'spring-petclinic-chart/']
env:
- 'SKIP_CLUSTER_CONFIG=true'
- name: 'bash'
args:
- '-c'
- |-
awk '/version/{print $2}' spring-petclinic-chart/Chart.yaml > _VERSION
- name: 'gcr.io/$PROJECT_ID/helm'
entrypoint: 'bash'
args: ['-c',
'helm push spring-petclinic-chart-$(cat _VERSION).tgz oci://${_ARTIFACT_REGISTRY_REPO}/charts']
env:
- 'SKIP_CLUSTER_CONFIG=true'
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |-
if [[ "$BRANCH_NAME" == "main" && -z "${_PR_NUMBER}" ]]; then
gcloud beta builds triggers run deploy-ci --region global
fi
images: [
'${_ARTIFACT_REGISTRY_REPO}/images/spring-petclinic:$SHORT_SHA',
'${_ARTIFACT_REGISTRY_REPO}/images/spring-petclinic:latest',
]
options:
logging: CLOUD_LOGGING_ONLY