diff --git a/dockers/piped-base/DOCKER_BUILD b/dockers/piped-base/DOCKER_BUILD index 7ca2d40d72..1dbe7f4802 100644 --- a/dockers/piped-base/DOCKER_BUILD +++ b/dockers/piped-base/DOCKER_BUILD @@ -1,2 +1,2 @@ -version: 0.0.6 +version: 0.0.7 registry: gcr.io/pipecd/piped-base diff --git a/dockers/piped-base/Dockerfile b/dockers/piped-base/Dockerfile index a21dfc23e1..64a7124a3e 100644 --- a/dockers/piped-base/Dockerfile +++ b/dockers/piped-base/Dockerfile @@ -9,6 +9,7 @@ ADD install-helm.sh /installer/install-helm.sh ADD install-kubectl.sh /installer/install-kubectl.sh ADD install-kustomize.sh /installer/install-kustomize.sh ADD install-gcloud.sh /installer/install-gcloud.sh +ADD install-terraform.sh /installer/install-terraform.sh RUN \ apk add --no-cache \ @@ -22,14 +23,16 @@ RUN \ bash && \ update-ca-certificates && \ mkdir ${PIPED_BIN_DIR} && \ - # Pre-install helm. + # Pre-install the default version of helm. /installer/install-helm.sh && \ - # Pre-install kubectl. + # Pre-install the default version of kubectl. /installer/install-kubectl.sh && \ - # Pre-install kustomize. + # Pre-install the default version of kustomize. /installer/install-kustomize.sh && \ - # Pre-install gcloud. + # Pre-install the default version of gcloud. /installer/install-gcloud.sh && \ + # Pre-install the default version of terraform. + /installer/install-terraform.sh && \ # Delete installer directory. rm -rf /installer && \ rm -f /var/cache/apk/* diff --git a/dockers/piped-base/install-terraform.sh b/dockers/piped-base/install-terraform.sh new file mode 100755 index 0000000000..80ffeec0e9 --- /dev/null +++ b/dockers/piped-base/install-terraform.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +# Copyright 2020 The PipeCD Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +BASE_URL="https://releases.hashicorp.com" + +# Do not forget to update the version number at the following file when changing this. +# https://github.com/pipe-cd/pipe/blob/master/pkg/app/piped/toolregistry/install.go#L33 +VERSION="0.13.0" + +echo "Installing terraform-${VERSION} into ${PIPED_BIN_DIR}/terraform..." +curl ${BASE_URL}/terraform/${VERSION}/terraform_${VERSION}_linux_amd64.zip -o terraform_${VERSION}_linux_amd64.zip +unzip terraform_${VERSION}_linux_amd64.zip +mv terraform ${PIPED_BIN_DIR}/ +rm terraform_${VERSION}_linux_amd64.zip +echo "Successfully installed terraform-${VERSION} into ${PIPED_BIN_DIR}/terraform"