From 727084fbd50bb6a6df03757dbf630eea7e7c8841 Mon Sep 17 00:00:00 2001 From: Robert Kibble Date: Fri, 9 Feb 2024 10:50:59 +0000 Subject: [PATCH] Move to this workflow for testing for now --- .github/workflows/standard-deploy.yml | 49 ++++++++------------------- scripts/list-versions.sh | 8 +++++ 2 files changed, 22 insertions(+), 35 deletions(-) create mode 100755 scripts/list-versions.sh diff --git a/.github/workflows/standard-deploy.yml b/.github/workflows/standard-deploy.yml index e98ec7ff..42c85a67 100644 --- a/.github/workflows/standard-deploy.yml +++ b/.github/workflows/standard-deploy.yml @@ -1,29 +1,21 @@ +name: List running service versions on ${{ inputs.environment }} + on: - # Triggers the workflow on push or pull request events but only for the main branch - workflow_call: + # Only runs manually + workflow_dispatch: inputs: - app_name: - required: false - type: string environment: + description: Which AWS Account to use + type: choice required: true - type: string - version: - required: true - type: string - db_name: - required: false - type: string - default: '' - secrets: - AWS_ACCOUNT: - required: true + options: + - dev + - test + - uat + - prod jobs: - deploy: - concurrency: - group: 'fsd-preaward-${{ inputs.environment }}' - cancel-in-progress: false + list-versions: permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout @@ -58,19 +50,6 @@ jobs: exit 1 fi - - name: Inject Git SHA into manifest - run: | - yq -i '.variables.GITHUB_SHA = "${{ github.sha }}"' copilot/fsd-${{ inputs.app_name }}/manifest.yml - - - name: Inject replacement image into manifest - run: | - yq -i '.image.location = "ghcr.io/communitiesuk/funding-service-design-${{ inputs.app_name }}:${{ inputs.version }}"' copilot/fsd-${{ inputs.app_name }}/manifest.yml - - - name: Run database migrations - if: ${{ inputs.db_name != '' }} - run: scripts/migration-task-script.py ${{ inputs.environment }} ${{ inputs.db_name }} - - - name: Copilot ${{ inputs.environment }} deploy - id: deploy_build + - name: List running versions run: | - copilot svc deploy --env ${{ inputs.environment }} --app pre-award + scripts/list-versions.sh diff --git a/scripts/list-versions.sh b/scripts/list-versions.sh new file mode 100755 index 00000000..1b5a63b0 --- /dev/null +++ b/scripts/list-versions.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd apps/pre-award +copilot svc ls --json | yq -r '.services[] | select(.app=="pre-award").name' | grep -v exit | while read svc +do + sha=$(copilot svc show -n $svc --json | yq -r '.variables[] | select(.name=="GITHUB_SHA").value') + printf "%22s %s\n" $svc $sha +done