Commit 9531f3a9 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Disable auto-deploy-to-prod until a beta/1.0 is ready

Comments out the deploy_prod job (and the deploy stage) rather than
deleting it - merges to main now only run tests, nothing gets pushed
to the prod server automatically. Re-enable by uncommenting both when
we're actually ready to cut a release.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent f36bf01f
Pipeline #1059 passed with stage
in 16 minutes and 23 seconds
stages:
- test
- deploy
# - deploy # re-enable (and uncomment deploy_prod below) once we're ready to cut a beta/1.0
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
......@@ -12,8 +12,9 @@ cache:
- .cache/pip/
- .cache/ffmpeg-static/
# Runs on every push to dev or main. No deploy here - just fast feedback while you're
# developing on dev, and a second confirmation right before deploy_prod fires on main.
# Runs on every push to dev or main. Auto-deploy-on-merge-to-main is deliberately disabled
# right now (see deploy_prod below, commented out) - only deploy manually until we reach a
# beta/1.0 we actually want live.
test:
stage: test
image: python:3.10-slim
......@@ -51,41 +52,44 @@ test:
- dev
- main
# DISABLED until we're ready to cut a beta/1.0 - merges to main no longer auto-deploy to prod.
# To re-enable: uncomment this whole job plus the `- deploy` stage above.
#
# Only ever runs on main, and fires automatically once the test job above passes. Copies the
# repo's current deploy.sh onto prod and runs it there over SSH - deploy.sh itself handles
# everything else (bootstrapping a bare box, or updating an already-deployed one).
deploy_prod:
stage: deploy
image: python:3.10-slim
variables:
STAX_DEPLOY_DIR: "/root/stax_backend_api"
before_script:
- apt-get update -qq && apt-get install -y -qq --no-install-recommends openssh-client
# This runner's job containers have a read-only root filesystem (confirmed: writing to
# ~/.ssh / /root/.ssh fails with "Read-only file system") - /tmp is the one path that's
# reliably writable regardless, so everything SSH-related lives there instead.
# PROD_SSH_PRIVATE_KEY is a "Variable"-type CI/CD var (raw key text), not "File"-type
# (which would give us a path) - write it out ourselves so this doesn't depend on that
# GitLab dropdown being set exactly right.
- echo "$PROD_SSH_PRIVATE_KEY" > /tmp/prod_deploy_key
- chmod 600 /tmp/prod_deploy_key
- ssh-keyscan -p "${PROD_SSH_PORT:-22}" "$PROD_SERVER_IP" > /tmp/known_hosts 2>/dev/null || true
script:
- echo "Deploying $CI_COMMIT_SHORT_SHA to production..."
- >
scp -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/known_hosts -i /tmp/prod_deploy_key -P "${PROD_SSH_PORT:-22}"
deploy/scripts/deploy.sh root@"$PROD_SERVER_IP":/root/stax_deploy_bootstrap.sh
- >
ssh -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/known_hosts -i /tmp/prod_deploy_key -p "${PROD_SSH_PORT:-22}"
root@"$PROD_SERVER_IP"
"STAX_DEPLOY_DIR='${STAX_DEPLOY_DIR}'
STAX_PROD_JWT_SECRET='${STAX_PROD_JWT_SECRET}'
STAX_PROD_ACOUSTID_API_KEY='${STAX_PROD_ACOUSTID_API_KEY}'
STAX_PROD_GEMINI_API_KEY='${STAX_PROD_GEMINI_API_KEY}'
STAX_PROD_DOCS_USERNAME='${STAX_PROD_DOCS_USERNAME}'
STAX_PROD_DOCS_PASSWORD='${STAX_PROD_DOCS_PASSWORD}'
STAX_PROD_TELEGRAM_BOT_TOKEN='${STAX_PROD_TELEGRAM_BOT_TOKEN:-}'
STAX_PROD_LALAL_API_KEY='${STAX_PROD_LALAL_API_KEY:-}'
bash /root/stax_deploy_bootstrap.sh"
only:
- main
# deploy_prod:
# stage: deploy
# image: python:3.10-slim
# variables:
# STAX_DEPLOY_DIR: "/root/stax_backend_api"
# before_script:
# - apt-get update -qq && apt-get install -y -qq --no-install-recommends openssh-client
# # This runner's job containers have a read-only root filesystem (confirmed: writing to
# # ~/.ssh / /root/.ssh fails with "Read-only file system") - /tmp is the one path that's
# # reliably writable regardless, so everything SSH-related lives there instead.
# # PROD_SSH_PRIVATE_KEY is a "Variable"-type CI/CD var (raw key text), not "File"-type
# # (which would give us a path) - write it out ourselves so this doesn't depend on that
# # GitLab dropdown being set exactly right.
# - echo "$PROD_SSH_PRIVATE_KEY" > /tmp/prod_deploy_key
# - chmod 600 /tmp/prod_deploy_key
# - ssh-keyscan -p "${PROD_SSH_PORT:-22}" "$PROD_SERVER_IP" > /tmp/known_hosts 2>/dev/null || true
# script:
# - echo "Deploying $CI_COMMIT_SHORT_SHA to production..."
# - >
# scp -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/known_hosts -i /tmp/prod_deploy_key -P "${PROD_SSH_PORT:-22}"
# deploy/scripts/deploy.sh root@"$PROD_SERVER_IP":/root/stax_deploy_bootstrap.sh
# - >
# ssh -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/known_hosts -i /tmp/prod_deploy_key -p "${PROD_SSH_PORT:-22}"
# root@"$PROD_SERVER_IP"
# "STAX_DEPLOY_DIR='${STAX_DEPLOY_DIR}'
# STAX_PROD_JWT_SECRET='${STAX_PROD_JWT_SECRET}'
# STAX_PROD_ACOUSTID_API_KEY='${STAX_PROD_ACOUSTID_API_KEY}'
# STAX_PROD_GEMINI_API_KEY='${STAX_PROD_GEMINI_API_KEY}'
# STAX_PROD_DOCS_USERNAME='${STAX_PROD_DOCS_USERNAME}'
# STAX_PROD_DOCS_PASSWORD='${STAX_PROD_DOCS_PASSWORD}'
# STAX_PROD_TELEGRAM_BOT_TOKEN='${STAX_PROD_TELEGRAM_BOT_TOKEN:-}'
# STAX_PROD_LALAL_API_KEY='${STAX_PROD_LALAL_API_KEY:-}'
# bash /root/stax_deploy_bootstrap.sh"
# only:
# - main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment