mirror of
https://github.com/Luzifer/dns.git
synced 2024-11-09 14:40:05 +00:00
Switch to Github API for release query
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
042c73e2d4
commit
ee8fcd74f5
1 changed files with 10 additions and 7 deletions
17
build.sh
17
build.sh
|
@ -2,7 +2,7 @@
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
# Install build utilities
|
# Install build utilities
|
||||||
apk --no-cache add curl
|
apk --no-cache add curl jq
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
apk --no-cache add \
|
apk --no-cache add \
|
||||||
|
@ -11,13 +11,16 @@ apk --no-cache add \
|
||||||
py3-pip \
|
py3-pip \
|
||||||
python3
|
python3
|
||||||
|
|
||||||
# Get latest versions of tools using latestver
|
# Get latest versions of tools using Github API
|
||||||
DUMB_INIT_VERSION=$(curl -sSfL 'https://lv.luzifer.io/catalog-api/dumb-init/latest.txt?p=version')
|
ASSET_URL=$(
|
||||||
|
curl -s "https://api.github.com/repos/Yelp/dumb-init/releases/latest" |
|
||||||
[ -z "${DUMB_INIT_VERSION}" ] && { exit 1; }
|
jq -r '.assets[] | .browser_download_url' |
|
||||||
|
grep "$(uname -m)$"
|
||||||
|
)
|
||||||
|
[[ -n $ASSET_URL ]] || exit 1
|
||||||
|
|
||||||
# Install tools
|
# Install tools
|
||||||
curl -sSfLo /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_x86_64
|
curl -sSfLo /usr/local/bin/dumb-init "${ASSET_URL}"
|
||||||
chmod +x /usr/local/bin/dumb-init
|
chmod +x /usr/local/bin/dumb-init
|
||||||
|
|
||||||
# Install requirements for python3 scripts
|
# Install requirements for python3 scripts
|
||||||
|
@ -32,4 +35,4 @@ ln -s /src/zonefile_cron /etc/periodic/1min/zonefile_cron
|
||||||
ln -sf /src/zones/named.conf /etc/bind/named.conf
|
ln -sf /src/zones/named.conf /etc/bind/named.conf
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
apk --no-cache del curl
|
apk --no-cache del curl jq
|
||||||
|
|
Loading…
Reference in a new issue