Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Rajpal Chauhan <[email protected]>
  • Loading branch information
rajpalc7 committed Mar 7, 2024
1 parent 08d2f83 commit 5f30ed1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ jobs:
run: |
tags=$(echo "${{ steps.meta.outputs.tags }}" | grep -oE ':([^[:space:]]+)' | sed '/label/d' | sed 's/://g' | tr '\n' ' ')
single_tag=$(echo "$tags" | cut -d " " -f 1)
remaining_tags=$(echo "$tags" | cut -d' ' -f2-)
echo "tags=$tags" >> $GITHUB_OUTPUT
echo "single_tag=$single_tag" >> $GITHUB_OUTPUT
echo "remaining_tags=$remaining_tags" >> $GITHUB_OUTPUT
- name: Pull database image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
Expand All @@ -186,12 +188,20 @@ jobs:
tags: ${{ steps.extract.outputs.tags }}
# labels would have to be added to the image after the S2I build

- name: Apply Labels to Database Image
- name: Apply Labels and tags to Database Image
id: apply_labels
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
echo "FROM ${{ steps.build_image.outputs.image }}:${{ steps.extract.outputs.single_tag }}" | docker build -t ${{ steps.build_image.outputs.image }}:${{ steps.extract.outputs.single_tag }} --label ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} --label ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} -
- name: Apply Tags to Docker Image
run: |
remaining_tags="${{ steps.extract.outputs.remaining_tags }}"
image_name="${{ steps.build_image.outputs.image }}"
IFS=' ' read -r -a tags_array <<< "$remaining_tags"
# Loop through the tags and apply each one to the Docker image
for tag in "${tags_array[@]}"; do
docker tag "$image_name:${{ steps.extract.outputs.single_tag }}" "$image_name:$tag"
done
- name: Push database image
id: push
Expand Down

0 comments on commit 5f30ed1

Please sign in to comment.