2019-11-03 19:00:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script must run on a lot of different platforms.
|
|
|
|
# It assumes that the following things are installed:
|
|
|
|
# * curl
|
|
|
|
# * jq
|
2019-11-03 19:20:35 +00:00
|
|
|
# * cat
|
2019-11-03 19:00:28 +00:00
|
|
|
|
2019-11-03 19:55:09 +00:00
|
|
|
# We do not set -x because this would leak the oauth access token.
|
|
|
|
set +x
|
|
|
|
|
2019-11-03 19:00:28 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
OAUTH_TOKEN="$2"
|
|
|
|
YML_FILE="tmp.yml"
|
|
|
|
|
2021-12-04 21:20:46 +00:00
|
|
|
if [ -z "$VERSION" ]; then
|
2021-12-04 03:34:54 +00:00
|
|
|
echo "missing VERSION parameter"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-12-04 21:20:46 +00:00
|
|
|
if [ -z "$OAUTH_TOKEN" ]; then
|
2021-12-04 03:34:54 +00:00
|
|
|
echo "missing OAUTH_TOKEN parameter"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-11-03 19:20:35 +00:00
|
|
|
cat <<EOF >"$YML_FILE"
|
2019-12-02 15:47:49 +00:00
|
|
|
image: alpine/latest
|
2019-11-03 19:20:35 +00:00
|
|
|
packages:
|
|
|
|
- py3-pip
|
|
|
|
- curl
|
|
|
|
- jq
|
2019-12-02 15:47:49 +00:00
|
|
|
- xz
|
2019-11-03 19:20:35 +00:00
|
|
|
secrets:
|
2020-09-15 23:08:35 +01:00
|
|
|
- 51bfddf5-86a6-4e01-8576-358c72a4a0a4
|
2021-05-20 05:36:48 +01:00
|
|
|
- 44e2bd57-1d07-42bf-925e-22a36119041d
|
2019-11-03 19:20:35 +00:00
|
|
|
sources:
|
|
|
|
- https://github.com/ziglang/zig
|
|
|
|
tasks:
|
|
|
|
- build: cd zig && ./ci/srht/update_download_page $VERSION
|
|
|
|
EOF
|
2019-11-03 19:00:28 +00:00
|
|
|
|
|
|
|
jq <$YML_FILE -sR '{
|
|
|
|
"manifest": .,
|
|
|
|
}' | curl \
|
|
|
|
-H Authorization:"token $OAUTH_TOKEN" \
|
|
|
|
-H Content-Type:application/json \
|
|
|
|
-X POST \
|
2020-09-15 03:37:59 +01:00
|
|
|
-d @- "https://builds.hut.lavatech.top/api/jobs"
|