opentofu/scripts/docker-release/tag.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

27 lines
873 B
Bash
Executable File

#!/usr/bin/env bash
# This script tags the version number given on the command line as being
# the "latest" on the local system only.
#
# The following tags are updated:
# - light (from the tag named after the version number)
# - full (from the tag named after the version number with "-full" appended)
# - latest (as an alias of light)
#
# Before running this the build.sh script must be run to actually create the
# images that this script will tag.
#
# After tagging, use push.sh to push the images to dockerhub.
set -eu
VERSION="$1"
VERSION_SLUG="${VERSION#v}"
echo "-- Updating tags to point to version $VERSION --"
echo ""
docker tag "hashicorp/terraform:${VERSION_SLUG}" "hashicorp/terraform:light"
docker tag "hashicorp/terraform:${VERSION_SLUG}" "hashicorp/terraform:latest"
docker tag "hashicorp/terraform:${VERSION_SLUG}-full" "hashicorp/terraform:full"