Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Docs image CI/CD script (#76)
Browse files Browse the repository at this point in the history
Adds a build script that will construct and publish the `docs` image to
`quay.io`. This build script will be triggered by Google Cloud Build
on a push to `main`.

The upshot of this script is that the image used by Teleoprt CI to
run its doctests will be automatically updated every time a PR is
merged in this repository.

See-Also: gravitational/teleport#13457
  • Loading branch information
tcsc authored Jun 24, 2022
1 parent 4256219 commit 9083142
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .cloudbuild/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
env:
- DOCKER_BUILDKIT=1
- DOCKER_REGISTRY=quay.io
- DOCKER_REPOSITORY=gravitational/docs
- DOCKER_TAG=latest
secretEnv:
- QUAYIO_DOCKER_USERNAME
- QUAYIO_DOCKER_PASSWORD
script: .cloudbuild/publish-image.sh
availableSecrets:
secretManager:
- versionName: projects/771512790633/secrets/ci_docs-quay_io_username/versions/1
env: QUAYIO_DOCKER_USERNAME
- versionName: projects/771512790633/secrets/ci_docs_quay_io_password/versions/1
env: QUAYIO_DOCKER_PASSWORD

7 changes: 7 additions & 0 deletions .cloudbuild/publish-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/env bash
set -e
IMAGE_NAME=$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$DOCKER_TAG
echo Building $IMAGE_NAME
DOCKER_BUILDKIT=1 docker build -t $IMAGE_NAME .
echo $QUAYIO_DOCKER_PASSWORD | docker login -u $QUAYIO_DOCKER_USERNAME --password-stdin $DOCKER_REGISTRY
docker push $IMAGE_NAME

1 comment on commit 9083142

@vercel
Copy link

@vercel vercel bot commented on 9083142 Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.