-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathcloudbuild.yaml
25 lines (25 loc) · 1.29 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
steps:
# Write the latest commit message to a file in the workspace.
- name: 'gcr.io/cloud-builders/git'
entrypoint: '/bin/sh'
args:
- '-c'
# Get the last commit in synthtool and write it to post-processor-changes.txt.
# If the commit message ends with parenthesis, remove them.
# If the commit message starts with feat or fix, replace it with chore.
# If the commit message includes ! followed by a colon to signal a breaking change, remove the !.
- >
git log -1 --format="%s%n%nSource-Link: https://github.com/googleapis/synthtool/commit/%H" > post-processor-changes.txt &&
sed -i "s/([^()]*)$//g" post-processor-changes.txt &&
sed -i "s/^\(feat\|fix\)/chore/g" post-processor-changes.txt &&
sed -i "s/\!:/:/g" post-processor-changes.txt
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build',
'-t', 'gcr.io/$PROJECT_ID/owlbot-python:$SHORT_SHA',
'-t', 'gcr.io/$PROJECT_ID/owlbot-python:latest',
'-t', 'gcr.io/$PROJECT_ID/owlbot-python:infrastructure-public-image-$SHORT_SHA',
'-f', 'docker/owlbot/python/Dockerfile', '.' ]
images:
- 'gcr.io/$PROJECT_ID/owlbot-python:$SHORT_SHA'
- 'gcr.io/$PROJECT_ID/owlbot-python:latest'
- 'gcr.io/$PROJECT_ID/owlbot-python:infrastructure-public-image-$SHORT_SHA'