ci: push cli-ext binary to cdn on tag release

https://github.com/hasura/graphql-engine-mono/pull/1846

GitOrigin-RevId: 1f1d61c88925d412c38d2e790c30de96541b6cc9
This commit is contained in:
Divi 2021-07-27 14:42:53 +05:30 committed by hasura-bot
parent 454e6afd1d
commit 00902e322e

View File

@ -165,6 +165,22 @@ push_server_binary() {
gs://graphql-engine-cdn.hasura.io/server/latest/linux-amd64
}
push_cli_ext() {
local BUCKET_PATH="gs://graphql-engine-cdn.hasura.io/cli-ext/releases/versioned/${CIRCLE_TAG}"
pushd /build/_cli_ext_output/
# the cli-ext binaries have names in format "cli-ext-hasura-<node version>-<os>-<architecture>"
# this transforms the file names into the format "cli-ext-<os>-<architecture>
# eg. "cli-ext-hasura-node12-linux-amd64" -> "cli-ext-linux-amd64"
for filename in "$(ls)"; do
new_filename="$(echo "$filename" | awk -F '-' '{print $1"-"$2"-"$5"-"$6}')"
gsutil cp "$filename" "${BUCKET_PATH}/${new_filename}"
done
popd
}
# skip deploy for pull requests
if [[ -n "${CIRCLE_PR_NUMBER:-}" ]]; then
echo "not deploying for PRs"
@ -193,6 +209,7 @@ if [[ -z "$CIRCLE_TAG" ]]; then
exit
fi
push_cli_ext
deploy_console
deploy_server
if [[ ! -z "$CIRCLE_TAG" ]]; then