Skip to content

Commit

Permalink
Merge pull request #154 from jason-fox/feature/webhook
Browse files Browse the repository at this point in the history
Add webhook bash script
  • Loading branch information
aalonsog authored Aug 30, 2023
2 parents df28627 + d345895 commit 1dad122
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/fiware/image-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
set -e

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

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

for i in "$@" ; do
if [[ $i == "clean" ]]; then
docker rmi -f $(docker images -a -q) | true
fi
done
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
# npm run pre-commit
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1dad122

Please sign in to comment.