Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terraform to piped-base image #654

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockers/piped-base/DOCKER_BUILD
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version: 0.0.6
version: 0.0.7
registry: gcr.io/pipecd/piped-base
11 changes: 7 additions & 4 deletions dockers/piped-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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/*
32 changes: 32 additions & 0 deletions dockers/piped-base/install-terraform.sh
Original file line number Diff line number Diff line change
@@ -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"