diff --git a/ops/scripts/create_environment_migrate.sh b/ops/scripts/create_environment_migrate.sh index 52b80909e..77571ca6c 100755 --- a/ops/scripts/create_environment_migrate.sh +++ b/ops/scripts/create_environment_migrate.sh @@ -43,11 +43,6 @@ echo "Creating manifest for $1..." cp ops/scripts/manifest-sandbox-template-migrate.yaml ops/manifests/manifest-$1.yaml sed -i '' "s/ENVIRONMENT/$1/" "ops/manifests/manifest-$1.yaml" -echo "Adding new environment to settings.py..." -sed -i '' '/getgov-staging.app.cloud.gov/ {a\ - '\"getgov-$1.app.cloud.gov\"', -}' src/registrar/config/settings.py - echo "Creating new cloud.gov space for $1..." cf create-space $1 cf target -o "cisa-dotgov" -s $1 @@ -105,19 +100,6 @@ echo "Alright, your app is up and running at https://getgov-$1.app.cloud.gov!" echo echo "Moving on to setup Github automation..." -echo "Adding new environment to Github Actions..." -sed -i '' '/ - staging/ {a\ - - '"$1"' -}' .github/workflows/reset-db.yaml - -sed -i '' '/ - staging/ {a\ - - '"$1"' -}' .github/workflows/migrate.yaml - -sed -i '' '/${{startsWith(github.head_ref, / {a\ - || startsWith(github.head_ref, '"'$1'"') -}' .github/workflows/deploy-sandbox.yaml - echo "Creating space deployer for Github deploys..." cf create-service cloud-gov-service-account space-deployer github-cd-account cf create-service-key github-cd-account github-cd-key diff --git a/ops/scripts/migrate_new_old.sh b/ops/scripts/migrate_new_old.sh new file mode 100755 index 000000000..99cadb0b2 --- /dev/null +++ b/ops/scripts/migrate_new_old.sh @@ -0,0 +1,30 @@ +# This script sets up a completely new Cloud.gov CF Space with all the corresponding +# infrastructure needed to run get.gov. It can serve for documentation for running +# NOTE: This script was written for MacOS and to be run at the root directory +# of the repository. + +if [ -z "$1" ]; then + echo 'Please specify a name on the command line for the new space (i.e. lmm)' >&2 + exit 1 +fi + +# The user running this script has to be a SpaceDeveloper on both the +# new and old org/spaces. + +OLD_ORG="cisa-getgov-prototyping" +NEW_ORG="cisa-dotgov" + +# +# delete old route +cf target -o $OLD_ORG -s $1 +cf delete-route app.cloud.gov -n getgov-$1 + +# re-claim the route on new orf +cf target -o $NEW_ORG -s $1 +cf map-route getgov-$1 app.cloud.gov -n getgov-$1 + +# delete old app +cf target -o $OLD_ORG -s $1 +cf delete getgov-$1 + +printf "Remove -migrate from ops/manifests/manifest-$1.yaml"