-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·23 lines (18 loc) · 775 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·23 lines (18 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -e
export CONSUL_VERSION="${CONSUL_VERSION:-1.17.0}"
export PACKAGE_VERSION="${CONSUL_VERSION}-1000"
export OS="${OS:-linux}"
export ARCH="${ARCH:-amd64}"
consul_zip_file="consul_${CONSUL_VERSION}_${OS}_${ARCH}.zip"
export CONSUL_URL="${CONSUL_URL:-https://releases.hashicorp.com/consul/${CONSUL_VERSION}/${consul_zip_file}}"
mkdir -p package
if [[ ! -f "./tmp/${consul_zip_file}" ]]; then
curl --create-dirs -Lo "./tmp/$consul_zip_file" "${CONSUL_URL}"
fi
unzip -o -d "./package/bin/" "./tmp/${consul_zip_file}"
./info.sh "${PACKAGE_VERSION}" > INFO
tar -cvzf package.tgz package
tar -cvf package.spk INFO LICENSE conf/ package.tgz scripts/pre* scripts/post* scripts/start*
rm package.tgz
mv package.spk "consul_${CONSUL_VERSION}_${OS}_${ARCH}.spk"