Skip to content

Instantly share code, notes, and snippets.

@nbrownus
Last active November 1, 2018 06:32
Show Gist options
  • Save nbrownus/36a1bce621059367349e to your computer and use it in GitHub Desktop.
Save nbrownus/36a1bce621059367349e to your computer and use it in GitHub Desktop.
#!/bin/sh
VERSION="0.19.5"
BUILD="slack1"
set -e -x
DIRNAME="$(cd "$(dirname "$0")" && pwd)"
OLDESTPWD="$PWD"
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
curl -LO "https://releases.hashicorp.com/consul-template/$VERSION/consul-template_${VERSION}_linux_amd64.zip"
unzip "consul-template_${VERSION}_linux_amd64.zip"
mkdir -p "$PWD/rootfs/usr/local/bin"
mv "$PWD/consul-template" "$PWD/rootfs/usr/local/bin"
fakeroot fpm -C "$PWD/rootfs" \
-m "Nate Brown <nate@slack-corp.com>" \
-n "consul-template" -v "$VERSION-$BUILD" \
-p "$OLDESTPWD/consul-template_${VERSION}-${BUILD}_amd64.deb" \
-s "dir" -t "deb" \
"usr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment