From 65e0c54943b64a82d5a82a87b36c0f522c5e462d Mon Sep 17 00:00:00 2001 From: Tadhg O'Higgins <2626258+tadhg-ohiggins@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:14:08 -0700 Subject: [PATCH] Tadhg/taskify dissemination destruction (#2542) * First pass at GitHub Action for destroying and regenerating the dissemination database. * rename file * Test dissemination on dev via workflow * Rollback testing changes * Enable github actor restriction This is constrained to just Tadhg and Dan for now. Can be removed at any point --------- Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> --- .../destroy-and-regenerate-dissemination.yml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/destroy-and-regenerate-dissemination.yml diff --git a/.github/workflows/destroy-and-regenerate-dissemination.yml b/.github/workflows/destroy-and-regenerate-dissemination.yml new file mode 100644 index 0000000000..4d0c03e6d4 --- /dev/null +++ b/.github/workflows/destroy-and-regenerate-dissemination.yml @@ -0,0 +1,31 @@ +--- +name: "Task: run Django command to delete and then regenerate all dissemination objects" +on: + workflow_dispatch: + inputs: + environment: + required: true + type: string + # dev, staging, production + +jobs: + destroy-and-regenerate-dissemination-objects: + if: contains('["tadhg-ohiggins","danswick"]', github.actor) + name: Destroy and regenerate dissemination objects in ${{ inputs.environment }} database + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + env: + space: ${{ inputs.environment }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run Django command to destroy and regenerate dissemination objects in ${{ inputs.environment }} + uses: cloud-gov/cg-cli-tools@main + with: + cf_username: ${{ secrets.CF_USERNAME }} + cf_password: ${{ secrets.CF_PASSWORD }} + cf_org: gsa-tts-oros-fac + cf_space: ${{ env.space }} + command: cf run-task gsa-fac -k 2G -m 2G --name rebuild_dissemination --command "python manage.py delete_and_regenerate_dissemination_from_intake"