-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add owlbot nodejs container tests (#1693)
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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="%B%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 | ||
# Build the docker image. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'build' | ||
args: [ 'build', | ||
'-t', 'gcr.io/repo-automation-bots/owlbot-nodejs:$SHORT_SHA', | ||
'-t', 'gcr.io/repo-automation-bots/owlbot-nodejs:latest', | ||
'-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs:$SHORT_SHA', | ||
'-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest', | ||
'-f', 'docker/owlbot/nodejs/Dockerfile', '.' ] | ||
# Run container tests | ||
- name: gcr.io/gcp-runtimes/container-structure-test | ||
args: | ||
- 'test' | ||
- '--image' | ||
- 'gcr.io/repo-automation-bots/owlbot-nodejs:$SHORT_SHA' | ||
- '--config' | ||
- 'docker/owlbot/nodejs/container_test.yaml' | ||
waitFor: ['build'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
schemaVersion: 1.0.0 | ||
commandTests: | ||
- name: "node" | ||
command: ["node", "--version"] | ||
expectedOutput: ["v15.14.0"] | ||
- name: "python" | ||
command: ["python", "--version"] | ||
expectedOutput: ["Python 3.10.6"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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="%B%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 | ||
# Build the docker image. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'build' | ||
args: [ 'build', | ||
'-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA', | ||
'-t', 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:latest', | ||
'-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:$SHORT_SHA', | ||
'-t', 'gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest', | ||
'-f', 'docker/owlbot/nodejs_mono_repo/Dockerfile', '.' ] | ||
# Run container tests | ||
- name: gcr.io/gcp-runtimes/container-structure-test | ||
args: | ||
- 'test' | ||
- '--image' | ||
- 'gcr.io/repo-automation-bots/owlbot-nodejs-mono-repo:$SHORT_SHA' | ||
- '--config' | ||
- 'docker/owlbot/nodejs_mono_repo/container_test.yaml' | ||
waitFor: ['build'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
schemaVersion: 1.0.0 | ||
commandTests: | ||
- name: "node" | ||
command: ["node", "--version"] | ||
expectedOutput: ["v15.14.0"] | ||
- name: "python" | ||
command: ["python", "--version"] | ||
expectedOutput: ["Python 3.10.6"] |