Skip to content

Instantly share code, notes, and snippets.

@nbrownus
Last active October 31, 2018 20:48
Show Gist options
  • Save nbrownus/07db807375bfeec3bfe4 to your computer and use it in GitHub Desktop.
Save nbrownus/07db807375bfeec3bfe4 to your computer and use it in GitHub Desktop.
consul deb maker
#!/bin/sh
VERSION="1.3.0"
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/$VERSION/consul_${VERSION}_linux_amd64.zip"
unzip "consul_${VERSION}_linux_amd64.zip"
mkdir -p "$PWD/rootfs/usr/bin"
mv "$PWD/consul" "$PWD/rootfs/usr/bin"
fakeroot fpm -C "$PWD/rootfs" \
-m "Nate Brown <[email protected]>" \
-n "consul" -v "$VERSION-$BUILD" \
-p "$OLDESTPWD/consul_${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