mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
minor refactor
This commit is contained in:
parent
81755af369
commit
d8f2ec83b3
1 changed files with 5 additions and 14 deletions
15
.github/workflows/clone-staging.yaml
vendored
15
.github/workflows/clone-staging.yaml
vendored
|
@ -23,24 +23,20 @@ jobs:
|
||||||
- name: Install Cloud Foundry CLI
|
- name: Install Cloud Foundry CLI
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
uses: cloud-gov/cg-cli-tools@main
|
||||||
|
|
||||||
- name: Login to Cloud Foundry
|
- name: Clone
|
||||||
env:
|
env:
|
||||||
CF_USERNAME: CF_${{ env.DESTINATION_ENVIRONMENT }}_USERNAME
|
CF_USERNAME: CF_${{ env.DESTINATION_ENVIRONMENT }}_USERNAME
|
||||||
CF_PASSWORD: CF_${{ env.DESTINATION_ENVIRONMENT }}_PASSWORD
|
CF_PASSWORD: CF_${{ env.DESTINATION_ENVIRONMENT }}_PASSWORD
|
||||||
with:
|
with:
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ env.DESTINATION_ENVIRONMENT }}
|
|
||||||
run: |
|
run: |
|
||||||
|
# login to cf cli
|
||||||
cf login -a api.fr.cloud.gov -u $CF_USERNAME -p $CF_PASSWORD -o cisa-dotgov -s ${{ env.DESTINATION_ENVIRONMENT }}
|
cf login -a api.fr.cloud.gov -u $CF_USERNAME -p $CF_PASSWORD -o cisa-dotgov -s ${{ env.DESTINATION_ENVIRONMENT }}
|
||||||
|
|
||||||
- name: Install manage-rds tool
|
# install cg-manage-rds tool
|
||||||
run: |
|
|
||||||
pip install git+https://github.com/cloud-gov/cg-manage-rds.git
|
pip install git+https://github.com/cloud-gov/cg-manage-rds.git
|
||||||
|
|
||||||
- name: Clone Database
|
|
||||||
run: |
|
|
||||||
# share the sandbox db with the Staging space
|
# share the sandbox db with the Staging space
|
||||||
cf share-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
cf share-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
||||||
|
|
||||||
|
@ -50,7 +46,6 @@ jobs:
|
||||||
# clone from staging to the sandbox
|
# clone from staging to the sandbox
|
||||||
cg-manage-rds clone getgov-${{ env.SOURCE_ENVIRONMENT }}-database getgov-${{ env.DESTINATION_ENVIRONMENT }}-database
|
cg-manage-rds clone getgov-${{ env.SOURCE_ENVIRONMENT }}-database getgov-${{ env.DESTINATION_ENVIRONMENT }}-database
|
||||||
|
|
||||||
# delete the local copy of the backup that gets created
|
|
||||||
rm db_backup.sql
|
rm db_backup.sql
|
||||||
|
|
||||||
# switch to the target sandbox space
|
# switch to the target sandbox space
|
||||||
|
@ -58,7 +53,3 @@ jobs:
|
||||||
|
|
||||||
# un-share the sandbox from Staging
|
# un-share the sandbox from Staging
|
||||||
cf unshare-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
cf unshare-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
||||||
|
|
||||||
- name: Logout from Cloud Foundry
|
|
||||||
if: always()
|
|
||||||
run: cf logout
|
|
Loading…
Add table
Add a link
Reference in a new issue