Skip to content

Commit

Permalink
Create image-clone.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox authored Jul 21, 2023
1 parent 083f032 commit 98267aa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/fiware/image-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set -e

SOURCE="telefonicaiot/fiware-orion"

DOCKER_TARGET="fiware/$(basename $(git rev-parse --show-toplevel))"
QUAY_TARGET="quay.io/fiware/$(basename $(git rev-parse --show-toplevel))"
VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))

docker pull --platform amd64 "$SOURCE":"$VERSION"

for i in "$@" ; do
if [[ $i == "docker" ]]; then
echo 'cloning from '"$SOURCE $VERSION"' to '"$DOCKER_TARGET"
docker tag "$SOURCE":"$VERSION" "$DOCKER_TARGET":"$VERSION"
docker tag "$SOURCE":"$VERSION" "$DOCKER_TARGET":latest
docker push -q "$DOCKER_TARGET":"$VERSION"
docker push -q "$DOCKER_TARGET":latest
fi
if [[ $i == "quay" ]]; then
echo 'cloning from '"$SOURCE" "$VERSION"' to '"$QUAY_TARGET"
docker tag "$SOURCE":"$VERSION" "$QUAY_TARGET":"$VERSION"
docker tag "$SOURCE":"$VERSION" "$QUAY_TARGET":latest
docker push -q "$QUAY_TARGET":"$VERSION"
docker push -q "$QUAY_TARGET":latest
fi
done

0 comments on commit 98267aa

Please sign in to comment.