-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·28 lines (24 loc) · 1.04 KB
/
update.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
28
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
update_deno () {
local deno_version
deno_version="$(curl --fail --show-error --silent --location https://api.github.com/repos/denoland/deno/releases/latest | jq --raw-output .tag_name)"
if [[ "${deno_version}" =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
# printf "Using version %s\n" "${BASH_REMATCH[0]}"
sed --regexp-extended --in-place "s/ARG DENO_VERSION=.+$/ARG DENO_VERSION=\"${BASH_REMATCH[0]}\"/" ./*/Dockerfile
else
printf "Failure to match/parse Git tag\n"
fi
}
update_lume () {
local lume_version
lume_version="$(curl --fail --show-error --silent --location https://api.github.com/repos/lumeland/lume/releases/latest | jq --raw-output .tag_name)"
if [[ "${lume_version}" =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
# printf "Using version %s\n" "${BASH_REMATCH[0]}"
sed --regexp-extended --in-place "s/ARG LUME_VERSION=.+$/ARG LUME_VERSION=\"${BASH_REMATCH[0]}\"/" ./*/Dockerfile
else
printf "Failure to match/parse Git tag\n"
fi
}
update_deno
update_lume