Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webhook bash script #732

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/fiware/image-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
set -e

SOURCE="orchestracities/quantumleap"
DOCKER_TARGET="fiware/quantum-leap"
QUAY_TARGET="quay.io/fiware/quantumleap"

# DOCKER_TARGET="fiware/$(basename $(git rev-parse --show-toplevel))"
# QUAY_TARGET="quay.io/fiware/$(basename $(git rev-parse --show-toplevel))"

VERSION=$(git describe --exclude 'FIWARE*' --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"
docker push -q "$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
fi
if [[ $i == "quay" ]]; then
clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true
fi
echo ""
done

for i in "$@" ; do
if [[ $i == "clean" ]]; then
docker rmi -f $(docker images -a -q) | true
fi
done
Loading