opentofu/scripts/docker-release/push.sh
Martin Atkins 5c8ff928ba build: scripted local build process for docker images
#15596 set things up with the intent that the docker image build process
would be handled by the automated build system on dockerhub, but after
merging we found that it's impossible to change the source git repository
for an existing dockerhub repository.

To get away from the limitations of dockerhub, we intend to eventually
automate these builds in a separate CI system. Here we add some scripts
that would drive such an automated process. It's split into multiple steps
to allow for situations where the new version should not be tagged as
the latest, and to make it easier and safer to test the build script
while doing development on it.

Since this automated process doesn't yet exist, a wrapper script
release.sh is included to help run a local, manual build and deploy
process in the mean time. The README.md in the docker-release dir here
contains details on the intended usage.
2017-08-14 12:16:21 -07:00

21 lines
570 B
Bash
Executable File

#!/usr/bin/env bash
# This script pushes the docker images for the given version of Terraform,
# along with the "light", "full" and "latest" tags, up to docker hub.
#
# You must already be logged in to docker using "docker login" before running
# this script.
set -eu
VERSION="$1"
VERSION_SLUG="${VERSION#v}"
echo "-- Pushing tags $VERSION_SLUG, light, full and latest up to dockerhub --"
echo ""
docker push "hashicorp/terraform:$VERSION_SLUG"
docker push "hashicorp/terraform:light"
docker push "hashicorp/terraform:full"
docker push "hashicorp/terraform:latest"