-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild.yaml
30 lines (30 loc) · 932 Bytes
/
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
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- -c
- |
on_going_build=($(gcloud builds list --ongoing --format='value(id)' --filter="substitutions._TRIGGER_ID=$_TRIGGER_ID" | xargs))
for (( i=0; i<${#on_going_build[@]}; i++ )); do
if [ "$i" -gt "0" ]; then # skip current
echo "Cancelling build ${on_going_build[i]}"
gcloud builds cancel --no-user-output-enabled ${on_going_build[i]}
fi
done
id: "Cancel ongoing builds"
entrypoint: 'bash'
- name: gcr.io/cloud-builders/mvn
env:
- 'GITHUB_USERNAME=${_GITHUB_USERNAME}'
- 'GITHUB_TOKEN=${_GITHUB_TOKEN}'
args:
- '-s'
- './.mvn/wrapper/settings.xml'
- '-B'
- 'javadoc:jar'
- 'source:jar'
- 'deploy'
id: "Push to github maven repository"
options:
machineType: UNSPECIFIED
substitutionOption: ALLOW_LOOSE
timeout: "7200s"