Skip to content

Commit

Permalink
fix(install): Wrap packer failure in function. (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtk54 committed Mar 3, 2017
1 parent 4727375 commit 3dc7a46
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions rosco-web/pkg_scripts/postInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ if [ -z `getent passwd spinnaker` ]; then
fi

# install packer
PACKER_VERSION="0.12.1"
packer_version=$(packer --version)
packer_status=$?
if [ $packer_status -ne 0 ] || [ "$packer_version" -ne "$PACKER_VERSION" ]; then
pushd .
cd /usr/bin
wget https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip
apt-get install unzip -y
unzip -o "packer_${PACKER_VERSION}_linux_amd64.zip"
rm "packer_${PACKER_VERSION}_linux_amd64.zip"
popd
fi
function install_packer() {
PACKER_VERSION="0.12.1"
local packer_version=$(packer --version)
local packer_status=$?
if [[ $packer_status -ne 0 ]] || [[ "$packer_version" != "$PACKER_VERSION" ]]; then
pushd .
cd /usr/bin
wget https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip
apt-get install unzip -y
unzip -o "packer_${PACKER_VERSION}_linux_amd64.zip"
rm "packer_${PACKER_VERSION}_linux_amd64.zip"
popd
fi
}

install_packer
install --mode=755 --owner=spinnaker --group=spinnaker --directory /var/log/spinnaker/rosco

0 comments on commit 3dc7a46

Please sign in to comment.