From 796cdf066984f10546931a7474b856393a619f13 Mon Sep 17 00:00:00 2001 From: Jonathan Boniface Date: Tue, 29 Sep 2026 15:26:57 +0100 Subject: [PATCH] Revert "Removing a one-off teardown for the lab orchestrator deployment" This reverts commit f9f9312195652385763909ecbc1badd3255ab13f. --- .gitea/workflows/teardown-labs.yaml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitea/workflows/teardown-labs.yaml diff --git a/.gitea/workflows/teardown-labs.yaml b/.gitea/workflows/teardown-labs.yaml new file mode 100644 index 0000000..f8df258 --- /dev/null +++ b/.gitea/workflows/teardown-labs.yaml @@ -0,0 +1,49 @@ +name: Tear down lab orchestrator deployment + +# Removes what "Deploy to Orchestrator (lab)" created in project demo-vivek-11-lab: an empty +# manifest deployed WITHOUT --merge makes the orchestrator destroy every node it holds (Deployment, +# Service, Ingress, Certificate, namespace) and drop their Terraform state with them. +# +# Runs as PO_AUTH_TOKEN because personal octl logins lack write on this environment. Plan first, +# read the plan, then run again with plan_only unticked. Delete this workflow when done. +on: + workflow_dispatch: + inputs: + plan_only: + description: 'Plan without applying. Untick to actually destroy.' + required: true + default: true + type: boolean + +env: + PO_API_URL: https://api.dev.orchestrator.crucible.kyndemo.live + PO_ORG_ID: crucible + PO_AUTH_TOKEN: ${{ secrets.PO_AUTH_TOKEN }} + PROJECT_ID: demo-vivek-11-lab + ENV_ID: dev + OCTL_VERSION: 1.0.0 + +jobs: + teardown: + name: Tear down + runs-on: ubuntu-latest + steps: + - name: Install octl + run: | + set -euo pipefail + curl -fsSLo /tmp/octl.tar.gz \ + "https://github.com/stellwerk-labs/platform-orchestrator-cli/releases/download/v${OCTL_VERSION}/platform-orchestrator-cli_${OCTL_VERSION}_linux_amd64.tar.gz" + tar xzf /tmp/octl.tar.gz -C /tmp + install -m 755 /tmp/octl /usr/local/bin/octl + octl --version + + - name: Deploy an empty manifest + run: | + set -euo pipefail + printf 'shared: {}\nworkloads: {}\n' > /tmp/empty.yaml + # Anything but an explicit "false" plans: a missing input must never destroy. + if [ "${{ github.event.inputs.plan_only }}" != "false" ]; then + octl deploy "$PROJECT_ID" "$ENV_ID" /tmp/empty.yaml --plan-only --no-prompt + else + octl deploy "$PROJECT_ID" "$ENV_ID" /tmp/empty.yaml --no-prompt + fi