#3555: Removed unneeded sandboxes, create the product sandbox, and update create/destroy sandbox scripts (#3935)

* Removed unneeded sandboxes, create the product sandboxes, update create/destroy sandbox scripts

Add new sandboxes

* Apply suggestion from @CocoByte

Co-authored-by: CuriousX <nicolle.leclair@gmail.com>

---------

Co-authored-by: CuriousX <nicolle.leclair@gmail.com>
This commit is contained in:
lizpearl 2025-07-16 11:15:19 -05:00 committed by GitHub
parent 0a1f82f211
commit 8cdd58741c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 208 additions and 272 deletions

View file

@ -17,26 +17,25 @@ on:
- staging
- development
- backup
- acadia
- glacier
- olympic
- yellowstone
- zion
- potato
- product
- meoward
- bob
- hotgov
- litterbox
- aa
- ab
- ad
- ag
- cb
- dg
- el
- es
- gd
- kma
- ko
- ky
- nl
- rb
- rh
- rjm
jobs:
createcachetable:

View file

@ -12,24 +12,23 @@ on:
description: Which environment should we flush and re-load data for?
options:
- el
- aa
- ad
- ag
- litterbox
- hotgov
- cb
- bob
- meoward
- backup
- ky
- acadia
- glacier
- olympic
- yellowstone
- zion
- potato
- product
- es
- nl
- rh
- za
- gd
- rb
- ko
- ab
- rjm
- kma
- dg

View file

@ -13,28 +13,25 @@ on:
type: 'choice'
options:
- aa
- ab
- acadia
- ad
- ag
- backup
- bob
- cb
- dg
- el
- es
- gd
- glacier
- hotgov
- kma
- ko
- ky
- litterbox
- meoward
- nl
- olympic
- potato
- product
- rb
- rh
- rjm
- za
- yellowstone
- zion
# GitHub Actions has no "good" way yet to dynamically input branches
branch:

View file

@ -9,25 +9,23 @@ on:
jobs:
variables:
if: |
startsWith(github.head_ref, 'ab/')
startsWith(github.head_ref, 'backup/')
|| startsWith(github.head_ref, 'acadia')
|| startsWith(github.head_ref, 'glacier')
|| startsWith(github.head_ref, 'olympic')
|| startsWith(github.head_ref, 'yellowstone')
|| startsWith(github.head_ref, 'zion')
|| startsWith(github.head_ref, 'potato')
|| startsWith(github.head_ref, 'product')
|| startsWith(github.head_ref, 'bl/')
|| startsWith(github.head_ref, 'rjm/')
|| startsWith(github.head_ref, 'rb/')
|| startsWith(github.head_ref, 'ko/')
|| startsWith(github.head_ref, 'gd/')
|| startsWith(github.head_ref, 'za/')
|| startsWith(github.head_ref, 'rh/')
|| startsWith(github.head_ref, 'nl/')
|| startsWith(github.head_ref, 'kma/')
|| startsWith(github.head_ref, 'es/')
|| startsWith(github.head_ref, 'ky/')
|| startsWith(github.head_ref, 'backup/')
|| startsWith(github.head_ref, 'meoward/')
|| startsWith(github.head_ref, 'bob/')
|| startsWith(github.head_ref, 'cb/')
|| startsWith(github.head_ref, 'hotgov/')
|| startsWith(github.head_ref, 'litterbox/')
|| startsWith(github.head_ref, 'ag/')
|| startsWith(github.head_ref, 'ad/')
|| startsWith(github.head_ref, 'el/')
|| startsWith(github.head_ref, 'dg/')

View file

@ -11,26 +11,25 @@ on:
type: 'choice'
options:
- backup
- acadia
- glacier
- olympic
- yellowstone
- zion
- potato
- product
- meoward
- bob
- hotgov
- litterbox
- aa
- ab
- ad
- ag
- cb
- dg
- el
- es
- gd
- kma
- ko
- ky
- nl
- rb
- rh
- rjm
jobs:
load-fixtures:

View file

@ -16,26 +16,24 @@ on:
- stable
- staging
- development
- acadia
- glacier
- olympic
- yellowstone
- zion
- potato
- product
- aa
- el
- ad
- ag
- litterbox
- hotgov
- cb
- bob
- meoward
- backup
- ky
- es
- nl
- rh
- za
- gd
- rb
- ko
- ab
- rjm
- kma
- dg

View file

@ -16,26 +16,24 @@ on:
options:
- staging
- development
- acadia
- glacier
- olympic
- yellowstone
- zion
- potato
- product
- aa
- el
- ad
- ag
- litterbox
- hotgov
- cb
- bob
- meoward
- backup
- ky
- es
- nl
- rh
- za
- gd
- rb
- ko
- ab
- rjm
- kma
- dg

View file

@ -1,6 +1,6 @@
---
applications:
- name: getgov-ag
- name: getgov-acadia
buildpacks:
- python_buildpack
path: ../../src
@ -18,7 +18,7 @@ applications:
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-ag.app.cloud.gov
DJANGO_BASE_URL: https://getgov-acadia.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
@ -28,7 +28,7 @@ applications:
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-ag.app.cloud.gov
- route: getgov-acadia.app.cloud.gov
services:
- getgov-credentials
- getgov-ag-database
- getgov-acadia-database

View file

@ -1,6 +1,6 @@
---
applications:
- name: getgov-gd
- name: getgov-glacier
buildpacks:
- python_buildpack
path: ../../src
@ -18,7 +18,7 @@ applications:
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-gd.app.cloud.gov
DJANGO_BASE_URL: https://getgov-glacier.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
@ -28,7 +28,7 @@ applications:
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-gd.app.cloud.gov
- route: getgov-glacier.app.cloud.gov
services:
- getgov-credentials
- getgov-gd-database
- getgov-glacier-database

View file

@ -1,34 +0,0 @@
---
applications:
- name: getgov-ko
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-ko.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-ko.app.cloud.gov
services:
- getgov-credentials
- getgov-ko-database

View file

@ -1,34 +0,0 @@
---
applications:
- name: getgov-ky
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-ky.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-ky.app.cloud.gov
services:
- getgov-credentials
- getgov-ky-database

View file

@ -0,0 +1,34 @@
---
applications:
- name: getgov-olympic
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-olympic.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-olympic.app.cloud.gov
services:
- getgov-credentials
- getgov-olympic-database

View file

@ -1,6 +1,6 @@
---
applications:
- name: getgov-cb
- name: getgov-potato
buildpacks:
- python_buildpack
path: ../../src
@ -18,7 +18,7 @@ applications:
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-cb.app.cloud.gov
DJANGO_BASE_URL: https://getgov-potato.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
@ -28,7 +28,7 @@ applications:
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-cb.app.cloud.gov
- route: getgov-potato.app.cloud.gov
services:
- getgov-credentials
- getgov-cb-database
- getgov-potato-database

View file

@ -0,0 +1,34 @@
---
applications:
- name: getgov-product
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-product.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-product.app.cloud.gov
services:
- getgov-credentials
- getgov-product-database

View file

@ -1,34 +0,0 @@
---
applications:
- name: getgov-rb
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-rb.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-rb.app.cloud.gov
services:
- getgov-credentials
- getgov-rb-database

View file

@ -1,34 +0,0 @@
---
applications:
- name: getgov-rjm
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-rjm.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-rjm.app.cloud.gov
services:
- getgov-credentials
- getgov-rjm-database

View file

@ -0,0 +1,34 @@
---
applications:
- name: getgov-yellowstone
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-yellowstone.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-yellowstone.app.cloud.gov
services:
- getgov-credentials
- getgov-yellowstone-database

View file

@ -1,32 +0,0 @@
---
applications:
- name: getgov-za
buildpacks:
- python_buildpack
path: ../../src
instances: 1
memory: 512M
stack: cflinuxfs4
timeout: 180
command: ./run.sh
health-check-type: http
health-check-http-endpoint: /health
health-check-invocation-timeout: 40
env:
# Send stdout and stderr straight to the terminal without buffering
PYTHONUNBUFFERED: yup
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-za.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-za.app.cloud.gov
services:
- getgov-credentials
- getgov-za-database

View file

@ -1,6 +1,6 @@
---
applications:
- name: getgov-ab
- name: getgov-zion
buildpacks:
- python_buildpack
path: ../../src
@ -18,7 +18,7 @@ applications:
# Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings
# Tell Django where it is being hosted
DJANGO_BASE_URL: https://getgov-ab.app.cloud.gov
DJANGO_BASE_URL: https://getgov-zion.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
# tell django what log format to use: console or json. See settings.py for more details.
@ -28,7 +28,7 @@ applications:
# Flag to disable/enable features in prod environments
IS_PRODUCTION: False
routes:
- route: getgov-ab.app.cloud.gov
- route: getgov-zion.app.cloud.gov
services:
- getgov-credentials
- getgov-ab-database
- getgov-zion-database

View file

@ -56,7 +56,7 @@ cf bind-security-group trusted_local_networks_egress cisa-dotgov --space $1
echo "Creating new cloud.gov DB for $1. This usually takes about 5 minutes..."
cf create-service aws-rds micro-psql getgov-$1-database
until cf service getgov-$1-database | grep -q 'The service instance status is succeeded'
until cf service getgov-$1-database | grep -q 'Finished creating database resources'
do
echo "Database not up yet, waiting..."
sleep 30
@ -120,9 +120,21 @@ sed -i '' '/ - backup/ {a\
- '"$1"'
}' .github/workflows/deploy-manual.yaml
sed -i '' '/${{startsWith(github.head_ref, / {a\
|| startsWith(github.head_ref, '"'$1'"')
}' .github/workflows/deploy-sandbox.yaml
sed -i '' "/startsWith(github.head_ref, \'backup/ {a\\
|| startsWith(github.head_ref, '"$1"')
}" .github/workflows/deploy-sandbox.yaml
sed -i '' '/ - backup/ {a\
- '"$1"'
}' .github/workflows/createcachetable.yaml
sed -i '' '/ - backup/ {a\
- '"$1"'
}' .github/workflows/delete-and-recreate-db.yaml
sed -i '' '/ - backup/ {a\
- '"$1"'
}' .github/workflows/load-fixtures.yaml
echo "Creating space deployer for Github deploys..."
cf create-service cloud-gov-service-account space-deployer github-cd-account
@ -135,7 +147,7 @@ then
exit 1
fi
cf service-key github-cd-account github-cd-key | sed 1,2d | jq -r '[.username, .password]|@tsv' |
cf service-key github-cd-account github-cd-key | sed 1,2d | jq -r '[.credentials.username, .credentials.password]|@tsv' |
while read -r username password; do
gh secret --repo cisagov/getgov set CF_${upcase_name}_USERNAME --body $username

View file

@ -50,6 +50,10 @@ sed -i '' "/getgov-$1.app.cloud.gov/d" src/registrar/config/settings.py
sed -i '' "/- $1/d" .github/workflows/reset-db.yaml
sed -i '' "/- $1/d" .github/workflows/migrate.yaml
sed -i '' "/- $1/d" .github/workflows/deploy-manual.yaml
sed -i '' "/|| startsWith(github.head_ref, '$1\/')/d" .github/workflows/deploy-sandbox.yaml
sed -i '' "/- $1/d" .github/workflows/createcachetable.yaml
sed -i '' "/- $1/d" .github/workflows/delete-and-recreate-db.yaml
sed -i '' "/- $1/d" .github/workflows/load-fixtures.yaml
echo "Cleaning up services, applications, and the Cloud.gov space for $1..."
cf delete getgov-$1

View file

@ -771,26 +771,24 @@ ALLOWED_HOSTS = [
"getgov-stable.app.cloud.gov",
"getgov-staging.app.cloud.gov",
"getgov-development.app.cloud.gov",
"getgov-acadia.app.cloud.gov",
"getgov-glacier.app.cloud.gov",
"getgov-olympic.app.cloud.gov",
"getgov-yellowstone.app.cloud.gov",
"getgov-zion.app.cloud.gov",
"getgov-potato.app.cloud.gov",
"getgov-product.app.cloud.gov",
"getgov-aa.app.cloud.gov",
"getgov-el.app.cloud.gov",
"getgov-ad.app.cloud.gov",
"getgov-ag.app.cloud.gov",
"getgov-litterbox.app.cloud.gov",
"getgov-hotgov.app.cloud.gov",
"getgov-cb.app.cloud.gov",
"getgov-bob.app.cloud.gov",
"getgov-meoward.app.cloud.gov",
"getgov-backup.app.cloud.gov",
"getgov-ky.app.cloud.gov",
"getgov-es.app.cloud.gov",
"getgov-nl.app.cloud.gov",
"getgov-rh.app.cloud.gov",
"getgov-za.app.cloud.gov",
"getgov-gd.app.cloud.gov",
"getgov-rb.app.cloud.gov",
"getgov-ko.app.cloud.gov",
"getgov-ab.app.cloud.gov",
"getgov-rjm.app.cloud.gov",
"getgov-kma.app.cloud.gov",
"getgov-dg.app.cloud.gov",
"manage.get.gov",