ci: deploy sf-server through k3s only
This commit is contained in:
parent
66309b235f
commit
e2c7484598
1 changed files with 0 additions and 58 deletions
|
|
@ -21,8 +21,6 @@ env:
|
|||
SF_PROD_NAMESPACE: ${{ vars.SF_PROD_NAMESPACE }}
|
||||
SF_TEST_DEPLOYMENT: ${{ vars.SF_TEST_DEPLOYMENT }}
|
||||
SF_PROD_DEPLOYMENT: ${{ vars.SF_PROD_DEPLOYMENT }}
|
||||
SF_VEGA_UPGRADE_URL: ${{ vars.SF_VEGA_UPGRADE_URL }}
|
||||
SF_VEGA_UPGRADE_TOKEN: ${{ secrets.SF_VEGA_UPGRADE_TOKEN }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -96,62 +94,6 @@ jobs:
|
|||
if: env.SF_PUSH_IMAGE != '0'
|
||||
run: docker push "${{ steps.image.outputs.image }}"
|
||||
|
||||
deploy-vega-source:
|
||||
name: upgrade vega source server
|
||||
needs: build
|
||||
runs-on: docker
|
||||
if: vars.SF_VEGA_UPGRADE_URL != ''
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Trigger source-mounted server upgrade
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
base="${SF_VEGA_UPGRADE_URL%/}"
|
||||
auth_args=()
|
||||
if [ -n "${SF_VEGA_UPGRADE_TOKEN:-}" ]; then
|
||||
auth_args=(-H "Authorization: Bearer ${SF_VEGA_UPGRADE_TOKEN}")
|
||||
fi
|
||||
response="$(curl --fail --silent --show-error \
|
||||
-X POST \
|
||||
"${auth_args[@]}" \
|
||||
"$base/api/server-upgrade")"
|
||||
printf '%s\n' "$response"
|
||||
|
||||
- name: Wait for vega source server revision
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
base="${SF_VEGA_UPGRADE_URL%/}"
|
||||
expected="${GITHUB_SHA:-$(git rev-parse HEAD)}"
|
||||
auth_args=()
|
||||
if [ -n "${SF_VEGA_UPGRADE_TOKEN:-}" ]; then
|
||||
auth_args=(-H "Authorization: Bearer ${SF_VEGA_UPGRADE_TOKEN}")
|
||||
fi
|
||||
deadline=$((SECONDS + 900))
|
||||
last=""
|
||||
while [ "$SECONDS" -lt "$deadline" ]; do
|
||||
payload="$(curl --fail --silent --show-error \
|
||||
"${auth_args[@]}" \
|
||||
"$base/api/ready" || true)"
|
||||
if [ -n "$payload" ]; then
|
||||
last="$payload"
|
||||
actual="$(node -e 'const fs=require("node:fs"); const j=JSON.parse(fs.readFileSync(0,"utf8")); process.stdout.write(String(j.gitSha || ""));' <<<"$payload")"
|
||||
ready="$(node -e 'const fs=require("node:fs"); const j=JSON.parse(fs.readFileSync(0,"utf8")); process.stdout.write(String(j.ready === true));' <<<"$payload")"
|
||||
if [ "$ready" = "true" ] && [ "$actual" = "$expected" ]; then
|
||||
printf 'vega source server upgraded to %s\n' "$actual"
|
||||
exit 0
|
||||
fi
|
||||
printf 'waiting for vega source server: ready=%s sha=%s expected=%s\n' "$ready" "$actual" "$expected"
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
printf 'Timed out waiting for vega source server to advertise %s. Last payload:\n%s\n' "$expected" "$last" >&2
|
||||
exit 1
|
||||
|
||||
deploy-test:
|
||||
name: deploy test and probe
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue