Files
holos/hack/deploy-dev
Jeff McCune 9d0a0b1ed5 workflows: deploy dev-holos-app after image publish (#228)
Previously the image is build on merge to main, but not deployed
anywhere.  This patch adds steps to the publish workflow to deploy the
image that was published using gitops and argocd.
2024-07-30 12:12:32 -07:00

31 lines
877 B
Bash
Executable File

#! /bin/bash
#
set -euo pipefail
tmpdir="$(mktemp -d)"
finish() {
rm -rf "$tmpdir"
}
trap finish EXIT
set -euo pipefail
: ${GIT_DETAIL:=$(git describe --tags HEAD)}
: ${GIT_SUFFIX:=$(test -n "`git status --porcelain`" && echo "-dirty" || echo "")}
cd "$tmpdir"
git clone --depth 1 git@github.com:holos-run/holos-infra.git
cd holos-infra/saas
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
echo '{"components":{"dev-holos-app":{"stages":{"dev":{"images":{"quay.io/holos-run/holos":{"newTag":"'"${GIT_DETAIL}"'"}}}}}}}' > userdata/components/dev-holos-app/images.json
holos render platform ./platform
git add .
git commit -m "dev-holos-app: deploy ${GIT_DETAIL}${GIT_SUFFIX} [auto]"
git --no-pager show --stat
git push origin HEAD
echo
echo "https://argocd.admin.aws2.holos.run/applications/dev-holos-app"