Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(internal/postprocessor): use approved image tag #10341

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions internal/postprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ You can verify the name of the docker container name can be found in the
In the `google-cloud-go` root directory:

```bash
docker pull gcr.io/cloud-devrel-public-resources/owlbot-go:latest
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo gcr.io/cloud-devrel-public-resources/owlbot-go:latest
docker pull gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-latest
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-latest
```

## Making changes, rebuilding the docker container and updating the OwlBot SHA
Expand Down Expand Up @@ -59,15 +59,14 @@ the OwlBot lock file.

After making changes to this package land in `main`, a new Docker image will be
built and pushed automatically. To update the image version used by OwlBot, run
the following commands (_you will need Docker installed and running_):
the following command (_you will need Docker installed and running_):

```sh
docker pull gcr.io/cloud-devrel-public-resources/owlbot-go:latest
LATEST=`docker inspect --format='{{index .RepoDigests 0}}' gcr.io/cloud-devrel-public-resources/owlbot-go:latest`
sed -i -e 's/sha256.*/'${LATEST#*@}'/g' ./.github/.OwlBot.lock.yaml
docker pull gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-latest
```

_Note: If run on macOS, the `sed -i` flag will need a `''` after it._
Extract the `sha256` Digest from the logs emitted by the `pull` and set it as
the digest in the [lockfile](../../.github/.OwlBot.lock.yaml).

Send a pull request with the updated `.github/.OwlBot.lock.yaml`.

Expand Down
12 changes: 10 additions & 2 deletions internal/postprocessor/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ steps:
[
"build",
"-t",
"gcr.io/cloud-devrel-public-resources/owlbot-go",
"gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-$COMMIT_SHA",
"-f",
"Dockerfile",
".",
]
dir: internal/postprocessor
- name: gcr.io/cloud-builders/docker
args:
[
"tag",
"gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-$COMMIT_SHA",
"gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-latest",
]
options:
logging: CLOUD_LOGGING_ONLY

images:
- gcr.io/cloud-devrel-public-resources/owlbot-go:latest
- gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-$COMMIT_SHA
- gcr.io/cloud-devrel-public-resources/owlbot-go:infrastructure-public-image-latest