From b469bf992c331b14a2c10f6532c32fce5c7ea0bd Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Mon, 24 Jul 2023 11:36:50 +0200 Subject: [PATCH 1/6] Add webhook bash script --- .github/fiware/image-clone.sh | 31 +++++++++++++++++++++++++++++++ README.md | 7 ++++--- 2 files changed, 35 insertions(+), 3 deletions(-) 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..5bc1296 --- /dev/null +++ b/.github/fiware/image-clone.sh @@ -0,0 +1,31 @@ +set -e + +SOURCE="telefonicaiot/fiware-pep-steelskin" +DOCKER_TARGET="fiware/pep-steelskin" +QUAY_TARGET="quay.io/fiware/pep-steelskin" + +# 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" + + 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 + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true + fi + echo "" +done \ No newline at end of file diff --git a/README.md b/README.md index 949002e..efbccd9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![FIWARE Security](https://nexus.lab.fiware.org/static/badges/chapters/security.svg)](https://www.fiware.org/developers/catalogue/) [![License: APGL](https://img.shields.io/github/license/telefonicaid/fiware-pep-steelskin.svg)](https://opensource.org/licenses/AGPL-3.0) +[![Docker badge](https://img.shields.io/badge/quay.io-fiware%2Fpep--steelskin-grey?logo=red%20hat&labelColor=EE0000)](https://quay.io/repository/fiware/pep-steelskin)
[![CI](https://github.com/telefonicaid/fiware-pep-steelskin/workflows/CI/badge.svg)](https://github.com/telefonicaid/fiware-pep-steelskin/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/github/telefonicaid/fiware-pep-steelskin/badge.svg?branch=master)](https://coveralls.io/github/telefonicaid/fiware-pep-steelskin?branch=master) @@ -45,7 +46,7 @@ Three other documents provide further information about the PEP Proxy: ### Dependencies The PEP Proxy is standard Node.js app and doesn't require more dependencies than the Node.js interpreter (0.10 or higher) and the NPM package utility. For RPM installations using Yum, those dependencies should be automatically installed. -### Without RPM Packages +### Without RPM Packages Just checkout this directory and install the Node.js dependencies using: ``` @@ -399,7 +400,7 @@ For testing purposes it might be interesting to launch the process directly with Take into account that when the process is executed manually the system configuration for the script (in /etc/sysconfig/pepProxy) is not loaded and the default configuration (in /opt/pepProxy/config.js) is used. -#### Stop service +#### Stop service To stop the service, use either the service command: ``` service pepProxy stop @@ -710,7 +711,7 @@ An up-to-date list of the convenience operations can be found [here](https://doc | GET | /v1/contextTypes | R | | GET | /v1/contextTypes{typename} | R | -#### NGSIv2 +#### NGSIv2 | Method | Path | Action | | ------ |:--------------------------------------------------------------------------------------- | ---:| | GET | /v2 | R | From dafdd482371ca6b8c0e3222a5e9547a4612e21ac Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Mon, 24 Jul 2023 12:04:57 +0200 Subject: [PATCH 2/6] Update image-clone.sh --- .github/fiware/image-clone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index 5bc1296..46d5d29 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -16,6 +16,7 @@ function clone { if ! [ -z "$4" ]; then echo 'pushing '"$1 $2"' to latest' + docker tag "$1":"$2" "$3":latest docker push -q "$3":latest fi } @@ -28,4 +29,4 @@ for i in "$@" ; do clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true fi echo "" -done \ No newline at end of file +done From 2c928bef6a3f556fdc4a6fd28c27fab34ef78cc6 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 3 Aug 2023 20:04:07 +0200 Subject: [PATCH 3/6] 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 46d5d29..e682546 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 d9d61831863a7ec24b13470d38e850f5f6f25c8e Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Fri, 11 Aug 2023 13:07:35 +0200 Subject: [PATCH 4/6] Add clean --- .github/fiware/image-clone.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index e682546..6f2dec4 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -31,3 +31,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 From 64ccb90357c39b645c6e9a93fce4ebd5014d22e9 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Fri, 15 Sep 2023 11:50:39 +0200 Subject: [PATCH 5/6] Delete .github/fiware/image-clone.sh --- .github/fiware/image-clone.sh | 39 ----------------------------------- 1 file changed, 39 deletions(-) delete mode 100755 .github/fiware/image-clone.sh diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh deleted file mode 100755 index 6f2dec4..0000000 --- a/.github/fiware/image-clone.sh +++ /dev/null @@ -1,39 +0,0 @@ -set -e - -SOURCE="telefonicaiot/fiware-pep-steelskin" -DOCKER_TARGET="fiware/pep-steelskin" -QUAY_TARGET="quay.io/fiware/pep-steelskin" - -# 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 From cf4d1d7b35a003f399c3295933678da6458afc42 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Fri, 15 Sep 2023 13:38:31 +0200 Subject: [PATCH 6/6] Update README.md Co-authored-by: mapedraza <40356341+mapedraza@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index efbccd9..a087903 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![FIWARE Security](https://nexus.lab.fiware.org/static/badges/chapters/security.svg)](https://www.fiware.org/developers/catalogue/) [![License: APGL](https://img.shields.io/github/license/telefonicaid/fiware-pep-steelskin.svg)](https://opensource.org/licenses/AGPL-3.0) -[![Docker badge](https://img.shields.io/badge/quay.io-fiware%2Fpep--steelskin-grey?logo=red%20hat&labelColor=EE0000)](https://quay.io/repository/fiware/pep-steelskin) +[![Quay badge](https://img.shields.io/badge/quay.io-fiware%2Fpep--steelskin-grey?logo=red%20hat&labelColor=EE0000)](https://quay.io/repository/fiware/pep-steelskin) +[![Docker badge](https://img.shields.io/badge/docker-telefonicaiot%2Ffiware--pep--steelskin-blue?logo=docker)](https://hub.docker.com/r/telefonicaiot/fiware-pep-steelskin)
[![CI](https://github.com/telefonicaid/fiware-pep-steelskin/workflows/CI/badge.svg)](https://github.com/telefonicaid/fiware-pep-steelskin/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/github/telefonicaid/fiware-pep-steelskin/badge.svg?branch=master)](https://coveralls.io/github/telefonicaid/fiware-pep-steelskin?branch=master)