-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
46 lines (46 loc) · 1.18 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
steps:
- id: 'Prime Maven cache'
name: 'gcr.io/cloud-builders/gsutil'
args:
- '-m'
- 'rsync'
- '-r'
- 'gs://hmf-build-caches/platinum/.m2'
- '/cache/.m2'
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
- id: 'Set version for Maven'
name: 'maven:3.9.2-eclipse-temurin-11'
entrypoint: mvn
args: [ 'versions:set', '-DnewVersion=$TAG_NAME' ]
- id: 'Compile, package, release'
name: 'maven:3.9.2-eclipse-temurin-11'
entrypoint: mvn
args:
- 'deploy'
- '-Drelease'
- '--batch-mode'
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
env:
- MAVEN_OPTS=-Dmaven.repo.local=/cache/.m2
- id: 'Publish Docker image'
name: 'eu.gcr.io/hmf-build/docker-tag'
args: ['eu.gcr.io/hmf-build/platinum', '$TAG_NAME', 'Dockerfile']
- id: 'Refresh bucket from local Maven cache after build'
name: 'gcr.io/cloud-builders/gsutil'
args:
- '-m'
- 'rsync'
- '-r'
- '/cache/.m2'
- 'gs://hmf-build-caches/platinum/.m2/'
volumes:
- path: '/cache/.m2'
name: 'm2_cache'
options:
machineType: 'E2_HIGHCPU_8'
images:
- eu.gcr.io/hmf-build/platinum