Deploy current commit through Nomad builder
All checks were successful
/ deploy (push) Successful in 48s
All checks were successful
/ deploy (push) Successful in 48s
This commit is contained in:
parent
d2d09d709e
commit
b24199c2ce
1 changed files with 15 additions and 13 deletions
|
|
@ -69,8 +69,17 @@ jobs:
|
||||||
test -f dist/speeches/index.html
|
test -f dist/speeches/index.html
|
||||||
test -f dist/assets/icons/familyfed-favicon.png
|
test -f dist/assets/icons/familyfed-favicon.png
|
||||||
|
|
||||||
|
export DEPLOY_MANIFEST="$(
|
||||||
|
cd dist
|
||||||
|
find . -type f -print0 \
|
||||||
|
| LC_ALL=C sort -z \
|
||||||
|
| xargs -0 sha256sum \
|
||||||
|
| sha256sum \
|
||||||
|
| awk '{print $1}'
|
||||||
|
)"
|
||||||
|
|
||||||
export DEPLOY_COMMIT="${GITHUB_SHA:-$(git rev-parse HEAD)}"
|
export DEPLOY_COMMIT="${GITHUB_SHA:-$(git rev-parse HEAD)}"
|
||||||
echo "Registering Nomad deployment for $DEPLOY_COMMIT"
|
echo "Registering Nomad deployment for $DEPLOY_COMMIT ($DEPLOY_MANIFEST)"
|
||||||
curl -fsS \
|
curl -fsS \
|
||||||
--connect-timeout 15 \
|
--connect-timeout 15 \
|
||||||
--max-time 60 \
|
--max-time 60 \
|
||||||
|
|
@ -82,6 +91,11 @@ jobs:
|
||||||
| jq '
|
| jq '
|
||||||
(.TaskGroups[].Tasks[].Env //= {})
|
(.TaskGroups[].Tasks[].Env //= {})
|
||||||
| .TaskGroups[].Tasks[].Env.DEPLOY_COMMIT = env.DEPLOY_COMMIT
|
| .TaskGroups[].Tasks[].Env.DEPLOY_COMMIT = env.DEPLOY_COMMIT
|
||||||
|
| ((.TaskGroups[].Tasks[] | select(.Name == "build-site") | .Config.args[]) |=
|
||||||
|
(sub("/archive/[0-9a-f]{40}\\.tar\\.gz";
|
||||||
|
"/archive/" + env.DEPLOY_COMMIT + ".tar.gz")
|
||||||
|
| sub("test \"\\$actual_manifest\" = \"[0-9a-f]{64}\"";
|
||||||
|
"test \"$actual_manifest\" = \"" + env.DEPLOY_MANIFEST + "\"")))
|
||||||
| (.TaskGroups[].Tasks[].Artifacts[]?.GetterSource |=
|
| (.TaskGroups[].Tasks[].Artifacts[]?.GetterSource |=
|
||||||
if startswith("git::") and test("[?&]ref=") then
|
if startswith("git::") and test("[?&]ref=") then
|
||||||
sub("ref=[^&]*"; "ref=" + env.DEPLOY_COMMIT)
|
sub("ref=[^&]*"; "ref=" + env.DEPLOY_COMMIT)
|
||||||
|
|
@ -92,18 +106,6 @@ jobs:
|
||||||
' \
|
' \
|
||||||
> /tmp/familyfed-job.json
|
> /tmp/familyfed-job.json
|
||||||
|
|
||||||
jq '.Job.TaskGroups[] | {
|
|
||||||
Name,
|
|
||||||
Tasks: [.Tasks[] | {
|
|
||||||
Name,
|
|
||||||
Driver,
|
|
||||||
Config,
|
|
||||||
EnvKeys: ((.Env // {}) | keys),
|
|
||||||
Artifacts,
|
|
||||||
VolumeMounts
|
|
||||||
}]
|
|
||||||
}' /tmp/familyfed-job.json
|
|
||||||
|
|
||||||
curl -fsS -X POST \
|
curl -fsS -X POST \
|
||||||
--connect-timeout 15 \
|
--connect-timeout 15 \
|
||||||
--max-time 60 \
|
--max-time 60 \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue