github.com/hs0210/hashicorp-terraform@v0.11.12-beta1/scripts/docker-release/README.md (about)

     1  # Terraform Docker Release Build
     2  
     3  This directory contains configuration to drive the docker image releases for
     4  Terraform.
     5  
     6  Two different types of image are produced for each Terraform release:
     7  
     8  * A "light" image that includes just the release binary that should match
     9    what's on releases.hashicorp.com.
    10  
    11  * A "full" image that contains all of the Terraform source code and a binary
    12    built from that source.
    13  
    14  The latter can be produced for any arbitrary commit by running `docker build`
    15  in the root of this repository. The former requires that the release archive
    16  already be deployed on releases.hashicorp.com.
    17  
    18  ## Build and Release
    19  
    20  The scripts in this directory are intended for running the steps to build,
    21  tag, and push the two images for a tagged and released version of Terraform.
    22  They expect to be run with git `HEAD` pointed at a release tag, whose name
    23  is used to determine the version to build. The version number indicated
    24  by the tag that `HEAD` is pointed at will be referred to below as
    25  the _current version_.
    26  
    27  * `build.sh` builds locally both of the images for the current version.
    28    This operates on the local docker daemon only, and produces tags that
    29    include the current version number.
    30  
    31  * `tag.sh` updates the `latest`, `light` and `full` tags to refer to the
    32    images for the current version, which must've been already produced by
    33    an earlier run of `build.sh`. This operates on the local docker daemon
    34    only.
    35  
    36  * `push.sh` pushes the current version tag and the `latest`, `light` and
    37    `full` tags up to dockerhub for public consumption. This writes images
    38    to dockerhub, and so it requires docker credentials that have access to
    39    write into the `hashicorp/terraform` repository.
    40  
    41  ### Releasing a new "latest" version
    42  
    43  In the common case where a release is going to be considered the new latest
    44  stable version of Terraform, the helper script `release.sh` orchestrates
    45  all of the necessary steps to release to dockerhub:
    46  
    47  ```
    48  $ git checkout v0.10.0
    49  $ scripts/docker-release/release.sh
    50  ```
    51  
    52  Behind the scenes this script is running `build.sh`, `tag.sh` and `push.sh`
    53  as described above, with some extra confirmation steps to verify the
    54  correctness of the build.
    55  
    56  This script is interactive and so isn't suitable for running in automation.
    57  For automation, run the individual scripts directly.
    58  
    59  ### Releasing a beta version or a patch to an earlier minor release
    60  
    61  The `release.sh` wrapper is not appropriate in two less common situations:
    62  
    63  * The version being released is a beta or other pre-release version, with
    64    a version number like `v0.10.0-beta1` or `v0.10.0-rc1`.
    65  
    66  * The version being released belongs to a non-current minor release. For
    67    example, if the current stable version is `v0.10.1` but the version
    68    being released is `v0.9.14`.
    69  
    70  In both of these cases, only the specific version tag should be updated,
    71  which can be done as follows:
    72  
    73  ```
    74  $ git checkout v0.11.0-beta1
    75  $ scripts/docker-release/build.sh
    76  $ docker push hashicorp/terraform:0.11.0-beta1
    77  ```