Skip to content

Instantly share code, notes, and snippets.

@mlocher
Created August 6, 2015 13:22
Show Gist options
  • Save mlocher/9fea65c570c8f198e831 to your computer and use it in GitHub Desktop.
Save mlocher/9fea65c570c8f198e831 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Install a Hugo on Codeship, https://gohugo.io/
#
# You can either add this here, or configure them on the environment tab of your
# project settings.
HUGO_VERSION="0.14"
HUGO_DIR=${HUGO_DIR:="$HOME/hugo"}
set -e
CACHED_DOWNLOAD="${HOME}/cache/hugo_${HUGO_VERSION}_linux_amd64.tar.gz"
mkdir -p "${HUGO_DIR}"
wget --continue --output-document "${CACHED_DOWNLOAD}" "https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux_amd64.tar.gz"
tar -xaf "${CACHED_DOWNLOAD}" --strip-components=1 --directory "${HUGO_DIR}"
ln -s "${HUGO_DIR}/hugo_${HUGO_VERSION}_linux_amd64" "${HOME}/bin/hugo"
# check that everything worked
hugo version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment