Skip to content

Commit

Permalink
Merge fe2522a into a346aa2
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jul 24, 2023
2 parents a346aa2 + fe2522a commit 19c2cec
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/fiware/image-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
set -e

SOURCE="telefonicaiot/perseo-fe"

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))

function clone {
echo 'cloning from '"$1 $2"' to '"$3"
docker pull -q "$1":"$2"
docker tag "$1":"$2" "$3":"$2"

if ! [ -z "$4" ]; then
echo 'pushing '"$1 $2"' to latest'
docker push -q "$3":latest
fi
}

for i in "$@" ; do
if [[ $i == "docker" ]]; then

clone "$SOURCE" "$VERSION" "$DOCKER_TARGET" true
clone "$SOURCE" "$VERSION"-distroless "$DOCKER_TARGET"-distroless
fi
if [[ $i == "quay" ]]; then
clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true
clone "$SOURCE" "$VERSION"-distroless "$QUAY_TARGET"-distroless
fi
echo ""
done

0 comments on commit 19c2cec

Please sign in to comment.