-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
53 lines (52 loc) · 1.39 KB
/
cloudbuild.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
45
46
47
48
49
50
51
52
steps:
- id: 'Populate Maven cache from bucket'
name: 'gcr.io/cloud-builders/gsutil'
args:
- '-m'
- '-q'
- 'rsync'
- '-r'
- 'gs://hmf-build-caches/serve/.m2'
- '/cache/.m2'
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
- id: 'Set release version'
name: 'maven:3.9.2-eclipse-temurin-11'
entrypoint: mvn
args: [ 'versions:set', '-DnewVersion=${TAG_NAME}' ]
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
env:
- MAVEN_OPTS=-Dmaven.repo.local=/cache/.m2
- id: 'Compile, package, release'
name: 'maven:3.9.2-eclipse-temurin-11'
entrypoint: mvn
args: [ 'deploy', '-B', '-DdeployAtEnd=true' ]
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
env:
- MAVEN_OPTS=-Dmaven.repo.local=/cache/.m2
- id: 'Publish docker image'
dir: algo
name: 'eu.gcr.io/hmf-build/docker-tag'
args: [ 'europe-west4-docker.pkg.dev/hmf-build/hmf-docker/serve', '$TAG_NAME' ]
- id: 'Refresh bucket from local Maven cache after build'
name: 'gcr.io/cloud-builders/gsutil'
args:
- '-m'
- '-q'
- 'rsync'
- '-r'
- '/cache/.m2'
- 'gs://hmf-build-caches/serve/.m2/'
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
timeout: 4800s
options:
machineType: 'E2_HIGHCPU_8'
images:
- europe-west4-docker.pkg.dev/hmf-build/hmf-docker/serve