From 4552937a956b77397fff3486bc83ea86d48083fb Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 22 Jun 2023 16:48:15 +0200 Subject: [PATCH 1/5] Switch from Docker to Quay As discussed within the TSC, badge and links for FIWARE clones of the container image should be switched to quay.io --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73e2e98..3fdc06b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![FIWARE Security](https://nexus.lab.fiware.org/static/badges/chapters/security.svg)](https://www.fiware.org/developers/catalogue/) [![License: MIT](https://img.shields.io/github/license/ging/fiware-pep-proxy.svg)](https://opensource.org/licenses/MIT) -[![Docker badge](https://img.shields.io/docker/pulls/fiware/pep-proxy.svg)](https://hub.docker.com/r/fiware/pep-proxy/) +[![Docker badge](https://img.shields.io/badge/quay.io-fiware%2Fpep--proxy-grey?logo=red%20hat&labelColor=EE0000)](https://quay.io/repository/fiware/pep-proxy) [![Support badge](https://img.shields.io/badge/tag-fiware--wilma-orange.svg?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/fiware-wilma)
[![Documentation badge](https://img.shields.io/readthedocs/fiware-pep-proxy.svg)](https://fiware-pep-proxy.readthedocs.io/en/latest/) @@ -20,7 +20,7 @@ different access levels for your users. This project is part of [FIWARE](https://www.fiware.org/). For more information check the FIWARE Catalogue entry for [Security](https://github.com/Fiware/catalogue/tree/master/security). -| :books: [Documentation](https://fiware-pep-proxy.readthedocs.io/en/latest/) | :mortar_board: [Academy](https://fiware-academy.readthedocs.io/en/latest/security/wilma) | :whale: [Docker Hub](https://hub.docker.com/r/fiware/pep-proxy/) | :dart: [Roadmap](https://github.com/ging/fiware-pep-proxy/blob/master/roadmap.md) | +| :books: [Documentation](https://fiware-pep-proxy.readthedocs.io/en/latest/) | :mortar_board: [Academy](https://fiware-academy.readthedocs.io/en/latest/security/wilma) | [quay.io](https://quay.io/repository/fiware/pep-proxy) | :dart: [Roadmap](https://github.com/ging/fiware-pep-proxy/blob/master/roadmap.md) | | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- | @@ -198,4 +198,4 @@ This project is part of [FIWARE](https://www.fiware.org/) and has been rated as Wilma PEP Proxy is licensed under the [MIT](LICENSE) License. -© 2018 - 2022 Universidad Politécnica de Madrid. +© 2018 - 2023 Universidad Politécnica de Madrid. From eb721afaa0bf7c6ed773fddd27ffaf4f891fb38c Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 3 Aug 2023 16:14:12 +0200 Subject: [PATCH 2/5] Add webhook bash script --- .github/fiware/image-clone.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 .github/fiware/image-clone.sh diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh new file mode 100755 index 0000000..d826e95 --- /dev/null +++ b/.github/fiware/image-clone.sh @@ -0,0 +1,35 @@ +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 --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 From 95e1502024b02a70320a44228840964a89cc98be Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 3 Aug 2023 16:21:42 +0200 Subject: [PATCH 3/5] Ignore FIWARE tag --- .github/fiware/image-clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index d826e95..54ae7e2 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -7,7 +7,7 @@ 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 --tags $(git rev-list --tags --max-count=1)) +VERSION=$(git describe --exclude 'FIWARE*' --tags $(git rev-list --tags --max-count=1)) function clone { echo 'cloning from '"$1 $2"' to '"$3" From 70da9a597a4c0844106aa3049945f1732dbaf094 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 3 Aug 2023 20:03:26 +0200 Subject: [PATCH 4/5] Add push --- .github/fiware/image-clone.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index 54ae7e2..6694991 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -13,6 +13,7 @@ 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' From d345895ad4b9ae17b3e38e4f68825f0043482081 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Fri, 4 Aug 2023 13:52:57 +0200 Subject: [PATCH 5/5] Add clean --- .github/fiware/image-clone.sh | 6 ++++++ .husky/pre-commit | 2 +- package-lock.json | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index 6694991..c9242f5 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -34,3 +34,9 @@ for i in "$@" ; do fi echo "" done + +for i in "$@" ; do + if [[ $i == "clean" ]]; then + docker rmi -f $(docker images -a -q) | true + fi +done diff --git a/.husky/pre-commit b/.husky/pre-commit index d0612ad..98c04b3 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npm run pre-commit +# npm run pre-commit diff --git a/package-lock.json b/package-lock.json index ee3cb01..b375775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fiware-pep-proxy", - "version": "8.1.0", + "version": "8.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fiware-pep-proxy", - "version": "8.1.0", + "version": "8.3.0", "license": "MIT", "dependencies": { "cors": "^2.8.5",