Skip to content

Commit

Permalink
Add webhook bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Aug 3, 2023
1 parent 80bf61a commit 66b07f8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/fiware/image-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set -e

SOURCE="ging/fiware-idm"
DOCKER_TARGET="fiware/idm"
QUAY_TARGET="quay.io/fiware/idm"

# 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 tag "$1":"$2" "$3":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"
fi
if [[ $i == "quay" ]]; then
clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true
clone "$SOURCE" "$VERSION"-distroless "$QUAY_TARGET"
fi
echo ""
done

0 comments on commit 66b07f8

Please sign in to comment.