Skip to content

Commit

Permalink
Move to this workflow for testing for now
Browse files Browse the repository at this point in the history
  • Loading branch information
robk-dluhc committed Feb 9, 2024
1 parent 9138ed8 commit 727084f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
49 changes: 14 additions & 35 deletions .github/workflows/standard-deploy.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
8 changes: 8 additions & 0 deletions scripts/list-versions.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 727084f

Please sign in to comment.