-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·27 lines (21 loc) · 905 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -e
if [[ -z "$NOMAD_VERSION" ]]; then
# renovate: datasource=github-releases depName=hashicorp/nomad versioning=semver extractVersion=^v(?<version>.*)$
NOMAD_VERSION=1.9.4
fi
export PACKAGE_VERSION="${NOMAD_VERSION}-1000"
export OS="${OS:-linux}"
export ARCH="${ARCH:-amd64}"
nomad_zip_file="nomad_${NOMAD_VERSION}_${OS}_${ARCH}.zip"
export NOMAD_URL="${NOMAD_URL:-https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/${nomad_zip_file}}"
mkdir -p package
if [[ ! -f "./tmp/${nomad_zip_file}" ]]; then
curl --create-dirs -Lo "./tmp/$nomad_zip_file" "${NOMAD_URL}"
fi
unzip -o -d "./package/bin/" "./tmp/${nomad_zip_file}"
./info.sh "${PACKAGE_VERSION}" > INFO
tar -cvzf package.tgz -C package .
tar -cvf package.spk INFO LICENSE conf/ package.tgz scripts/pre* scripts/post* scripts/start* WIZARD_UIFILES/*
rm package.tgz
mv package.spk "nomad_${NOMAD_VERSION}_${OS}_${ARCH}.spk"