-
Notifications
You must be signed in to change notification settings - Fork 207
/
_bumper.sh
executable file
·56 lines (41 loc) · 1.64 KB
/
_bumper.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# Copyright 2021-present Viktor Szakats. See LICENSE.md
# SPDX-License-Identifier: MIT
if ! command -v hxclean >/dev/null 2>&1; then
case "$(uname)" in
Linux*)
apt-get --quiet 2 --option Dpkg::Use-Pty=0 update
apt-get --quiet 2 --option Dpkg::Use-Pty=0 install \
curl git gpg zip jq html-xml-utils;;
Darwin*)
brew install \
curl git gpg zip jq html-xml-utils;;
esac
fi
. ./_versions.sh
./_dl.sh bump
# Find out the latest docker image release:
name='debian'
# https://docs.docker.com/registry/spec/api/
token="$(curl --disable --user-agent '' --silent --fail --show-error \
"https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/${name}:pull" \
| jq --raw-output '.token')"
tag="$(curl --disable --user-agent '' --silent --fail --show-error \
--header 'Accept: application/json' \
--header @/dev/stdin \
"https://registry-1.docker.io/v2/library/${name}/tags/list" <<EOF \
| jq --raw-output '.tags[]' | grep -E '^testing-[0-9]{8}-slim$' | sort | tail -1
Authorization: Bearer ${token}
EOF
)"
echo; echo " DOCKER_IMAGE: ${name}:${tag}"
# Find out the latest AppVeyor CI Ubuntu worker image
image="$(curl --disable --user-agent '' --silent --fail --show-error \
'https://www.appveyor.com/docs/build-environment/' \
| grep -a -o -E 'Ubuntu[0-9]{4}' | sort | tail -1)"
echo; echo "image: ${image}"
# Find out the latest CA certificate bundle release
image="$(curl --disable --user-agent '' --silent --fail --show-error \
'https://curl.se/docs/caextract.html' \
| grep -a -o -E '[0-9]{4}-[0-9]{2}-[0-9]{2}' | sort | tail -1)"
echo; echo "CACERT_VER='${image}'"