Skip to content

Commit

Permalink
Add script to tag and push images
Browse files Browse the repository at this point in the history
  • Loading branch information
birkland committed Sep 29, 2021
1 parent a422e26 commit accbe1a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tag_and_push_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

GIT_TAG=$(git describe --tags --always)

for image_uri in $(cat docker-compose.yml | grep ghcr | awk '{print $2}'); do
image_name=$(echo ${image_uri} | tr ':' ' ' | awk '{print $1}' | awk -F "/" '{print $NF}')
echo $image_name

dest_url=${DOCKER_PUSH_REPOSITORY}/${image_name}:${GIT_TAG}

docker tag $image_uri $dest_url
docker push $dest_url
done

0 comments on commit accbe1a

Please sign in to comment.