urbit/.github/actions/glob/entrypoint.sh
Jared Tobin 7b1b4d8cc6
meta: add a 'glob' GitHub action
This action, when supplied with the appropriate arguments, will create a
Landscape glob from GITHUB_SHA [1] and deploy it OTA to the appropriate
ship.

It needs to be supplied the following:

* ship name
* base64-encoded GCP Service Account credentials
* a base64-encoded SSH secret key to be used for GCP actions
* the corresponding base64-encoded SSH public key

[1]: https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables
2020-12-19 10:30:59 -03:30

33 lines
656 B
Bash
Executable File

#!/usr/bin/env bash
cd "$GITHUB_WORKSPACE" || exit
echo "$2" | base64 -d > service-account
echo "$3" | base64 -d > id_ssh
echo "$4" | base64 -d > id_ssh.pub
chmod 600 service-account
chmod 600 id_ssh
chmod 600 id_ssh.pub
janeway release glob --no-pill \
--credentials service-account \
--ssh-key id_ssh \
--do-it-live \
| bash
SHORTHASH=$(git rev-parse --short HEAD)
janeway release prepare-ota arvo-glob-"$SHORTHASH" "$1" \
--credentials service-account \
--ssh-key id_ssh \
--do-it-live \
| bash
janeway release perform-ota "$1" \
--credentials service-account \
--ssh-key id_ssh \
--do-it-live \
| bash