new createcachetable.yaml script, updated create_dev_sandbox.sh

This commit is contained in:
David Kennedy 2024-03-06 12:13:18 -05:00
parent e3e8c2646b
commit b33d71ee54
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 49 additions and 0 deletions

46
.github/workflows/createcachetable.yaml vendored Normal file
View file

@ -0,0 +1,46 @@
# This workflow can be run from the CLI for any environment
# gh workflow run createcachetable.yaml -f environment=ENVIRONMENT
# OR
# cf run-task getgov-ENVIRONMENT --command 'python manage.py createcachetable' --name createcachetable
name: Create cache table
run-name: Create cache table for ${{ github.event.inputs.environment }}
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Which environment should we create cache table for?
options:
- stable
- staging
- development
- backup
- ky
- es
- nl
- rh
- za
- gd
- rb
- ko
- ab
- rjm
- dk
jobs:
createcachetable:
runs-on: ubuntu-latest
env:
CF_USERNAME: CF_${{ github.event.inputs.environment }}_USERNAME
CF_PASSWORD: CF_${{ github.event.inputs.environment }}_PASSWORD
steps:
- name: Create cache table for ${{ github.event.inputs.environment }}
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets[env.CF_USERNAME] }}
cf_password: ${{ secrets[env.CF_PASSWORD] }}
cf_org: cisa-dotgov
cf_space: ${{ github.event.inputs.environment }}
cf_command: "run-task getgov-${{ github.event.inputs.environment }} --command 'python manage.py createcachetable' --name createcachetable"

View file

@ -90,6 +90,9 @@ cd src/
cd .. cd ..
cf push getgov-$1 -f ops/manifests/manifest-$1.yaml cf push getgov-$1 -f ops/manifests/manifest-$1.yaml
echo "Creating cache table..."
cf run-task getgov-$1 --command 'python manage.py createcachetable' --name createcachetable
read -p "Please provide the email of the space developer: " -r read -p "Please provide the email of the space developer: " -r
cf set-space-role $REPLY cisa-dotgov $1 SpaceDeveloper cf set-space-role $REPLY cisa-dotgov $1 SpaceDeveloper