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: stages:
- test - test
- deploy # - deploy # re-enable (and uncomment deploy_prod below) once we're ready to cut a beta/1.0
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
...@@ -12,8 +12,9 @@ cache: ...@@ -12,8 +12,9 @@ cache:
- .cache/pip/ - .cache/pip/
- .cache/ffmpeg-static/ - .cache/ffmpeg-static/
# Runs on every push to dev or main. No deploy here - just fast feedback while you're # Runs on every push to dev or main. Auto-deploy-on-merge-to-main is deliberately disabled
# developing on dev, and a second confirmation right before deploy_prod fires on main. # right now (see deploy_prod below, commented out) - only deploy manually until we reach a
# beta/1.0 we actually want live.
test: test:
stage: test stage: test
image: python:3.10-slim image: python:3.10-slim
...@@ -51,41 +52,44 @@ test: ...@@ -51,41 +52,44 @@ test:
- dev - dev
- main - 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 # 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 # 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). # everything else (bootstrapping a bare box, or updating an already-deployed one).
deploy_prod: # deploy_prod:
stage: deploy # stage: deploy
image: python:3.10-slim # image: python:3.10-slim
variables: # variables:
STAX_DEPLOY_DIR: "/root/stax_backend_api" # STAX_DEPLOY_DIR: "/root/stax_backend_api"
before_script: # before_script:
- apt-get update -qq && apt-get install -y -qq --no-install-recommends openssh-client # - 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 # # 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 # # ~/.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. # # 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 # # 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 # # (which would give us a path) - write it out ourselves so this doesn't depend on that
# GitLab dropdown being set exactly right. # # GitLab dropdown being set exactly right.
- echo "$PROD_SSH_PRIVATE_KEY" > /tmp/prod_deploy_key # - echo "$PROD_SSH_PRIVATE_KEY" > /tmp/prod_deploy_key
- chmod 600 /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 # - ssh-keyscan -p "${PROD_SSH_PORT:-22}" "$PROD_SERVER_IP" > /tmp/known_hosts 2>/dev/null || true
script: # script:
- echo "Deploying $CI_COMMIT_SHORT_SHA to production..." # - 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}" # 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 # 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}" # ssh -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/known_hosts -i /tmp/prod_deploy_key -p "${PROD_SSH_PORT:-22}"
root@"$PROD_SERVER_IP" # root@"$PROD_SERVER_IP"
"STAX_DEPLOY_DIR='${STAX_DEPLOY_DIR}' # "STAX_DEPLOY_DIR='${STAX_DEPLOY_DIR}'
STAX_PROD_JWT_SECRET='${STAX_PROD_JWT_SECRET}' # STAX_PROD_JWT_SECRET='${STAX_PROD_JWT_SECRET}'
STAX_PROD_ACOUSTID_API_KEY='${STAX_PROD_ACOUSTID_API_KEY}' # STAX_PROD_ACOUSTID_API_KEY='${STAX_PROD_ACOUSTID_API_KEY}'
STAX_PROD_GEMINI_API_KEY='${STAX_PROD_GEMINI_API_KEY}' # STAX_PROD_GEMINI_API_KEY='${STAX_PROD_GEMINI_API_KEY}'
STAX_PROD_DOCS_USERNAME='${STAX_PROD_DOCS_USERNAME}' # STAX_PROD_DOCS_USERNAME='${STAX_PROD_DOCS_USERNAME}'
STAX_PROD_DOCS_PASSWORD='${STAX_PROD_DOCS_PASSWORD}' # STAX_PROD_DOCS_PASSWORD='${STAX_PROD_DOCS_PASSWORD}'
STAX_PROD_TELEGRAM_BOT_TOKEN='${STAX_PROD_TELEGRAM_BOT_TOKEN:-}' # STAX_PROD_TELEGRAM_BOT_TOKEN='${STAX_PROD_TELEGRAM_BOT_TOKEN:-}'
STAX_PROD_LALAL_API_KEY='${STAX_PROD_LALAL_API_KEY:-}' # STAX_PROD_LALAL_API_KEY='${STAX_PROD_LALAL_API_KEY:-}'
bash /root/stax_deploy_bootstrap.sh" # bash /root/stax_deploy_bootstrap.sh"
only: # only:
- main # - 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