|
| 1 | +steps: |
| 2 | + # Write the latest commit message to a file in the workspace. |
| 3 | + - name: 'gcr.io/cloud-builders/git' |
| 4 | + entrypoint: '/bin/sh' |
| 5 | + args: |
| 6 | + - '-c' |
| 7 | + # Get the last commit in synthtool and write it to post-processor-changes.txt. |
| 8 | + # If the commit message ends with parenthesis, remove them. |
| 9 | + # If the commit message starts with feat or fix, replace it with chore. |
| 10 | + # If the commit message includes ! followed by a colon to signal a breaking change, remove the !. |
| 11 | + - > |
| 12 | + git log -1 --format="%B%n%nSource-Link: https://github.com/googleapis/synthtool/commit/%H" > post-processor-changes.txt && |
| 13 | + sed -i "s/([^()]*)$//g" post-processor-changes.txt && |
| 14 | + sed -i "s/^\(feat\|fix\)/chore/g" post-processor-changes.txt && |
| 15 | + sed -i "s/\!:/:/g" post-processor-changes.txt |
| 16 | + # Build the docker image. |
| 17 | + - name: 'gcr.io/cloud-builders/docker' |
| 18 | + id: 'build' |
| 19 | + args: [ 'build', |
| 20 | + '-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA', |
| 21 | + '-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:latest', |
| 22 | + '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:$SHORT_SHA', |
| 23 | + '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest', |
| 24 | + '-f', 'docker/owlbot/nodejs_mono_repo/Dockerfile', '.' ] |
| 25 | + # Run container tests |
| 26 | + - name: gcr.io/gcp-runtimes/container-structure-test |
| 27 | + args: |
| 28 | + - 'test' |
| 29 | + - '--image' |
| 30 | + - 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA' |
| 31 | + - '--config' |
| 32 | + - 'docker/owlbot/nodejs_mono_repo/container_test.yaml' |
| 33 | + waitFor: ['build'] |
0 commit comments