Skip to content

Commit

Permalink
Keep track of release versions in manifest db
Browse files Browse the repository at this point in the history
  • Loading branch information
shooshmand-sol authored Aug 1, 2023
1 parent 33362f0 commit 17fbb40
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ jobs:
aws ecr put-image --repository-name ${{ github.event.repository.name }} \
--image-tag ${{ github.event.inputs.releaseVersion }} \
--image-manifest "$MANIFEST" --region ${{ secrets.EMA_AWS_DEFAULT_REGION }}
--image-manifest "$MANIFEST" --region ${{ secrets.EMA_AWS_DEFAULT_REGION }}
- name: Update Release Manifest DB
run: |
export squad="event-portal"
export repository="event-management-agent"
export release_tag=production
export version=${{ github.event.inputs.releaseVersion }}
export release_version=${{ github.event.inputs.releaseVersion }}
export image_tag=${{ github.event.inputs.releaseVersion }}
export chart_version="n/a"
export sha=${{ github.sha }}
./.github/workflows/release_scripts/update_release_manifest.sh
35 changes: 35 additions & 0 deletions .github/workflows/release_scripts/update_release_manifest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

##The Variables below are required!

#Dynamo DB URL: https://us-east-1.console.aws.amazon.com/dynamodbv2/home?region=us-east-1#item-explorer?initialTagKey=&table=solace-cloud-manifest
#Example:
# export AWS_ACCESS_KEY_ID=xxxxxx
# export AWS_SECRET_ACCESS_KEY=xxxxx
# export release_version="v100.100"
# export version="v100"
# export image_tag="rc-abcdef"
# export chart_version="n/a"
# export sha="abcdef"
# export squad='mission-control'
# export repository='maas-cloud-agent-k8s'
# export release_tag='rc'

aws dynamodb update-item \
--table-name solace-cloud-manifest \
--key "{\"squad\":{\"S\":\"${squad}\"},\"repository\": {\"S\": \"${repository}\"} }"\
--update-expression "SET ${release_tag} = :r" \
--expression-attribute-values \
"""{\":r\":
{\"M\":
{
\"version\":{\"S\":\"${version}\"},
\"image_tag\":{\"S\":\"${image_tag}\"},
\"chart_version\": {\"S\": \"${chart_version}\"},
\"sha\": {\"S\": \"${sha}\"},
\"release_version\": {\"S\": \"${release_version}\"}
}
}
}""" \
--return-values ALL_NEW

0 comments on commit 17fbb40

Please sign in to comment.