From 9ba487b975c2ef41aa4d91c26ffe80c6ebc9e860 Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Mon, 16 Oct 2023 11:40:33 +0200 Subject: [PATCH] Add Scorpio. --- .github/fiware/core/cygnus.sh | 2 +- .../fiware/core/scorpio-at-context-server.sh | 41 +++++++++++++++++++ .github/fiware/core/scorpio-entity-manager.sh | 40 ++++++++++++++++++ .github/fiware/core/scorpio-history-entity.sh | 41 +++++++++++++++++++ .github/fiware/core/scorpio-history-query.sh | 41 +++++++++++++++++++ .github/fiware/core/scorpio-query-manager.sh | 41 +++++++++++++++++++ .../fiware/core/scorpio-registry-manager.sh | 41 +++++++++++++++++++ .../core/scorpio-subscription-manager.sh | 41 +++++++++++++++++++ .../core/scorpio-subscription-registry.sh | 41 +++++++++++++++++++ .../fiware/core/{x-scorpio.sh => scorpio.sh} | 16 +++++--- .github/fiware/image-clone.sh | 3 +- 11 files changed, 341 insertions(+), 7 deletions(-) create mode 100755 .github/fiware/core/scorpio-at-context-server.sh create mode 100755 .github/fiware/core/scorpio-entity-manager.sh create mode 100755 .github/fiware/core/scorpio-history-entity.sh create mode 100755 .github/fiware/core/scorpio-history-query.sh create mode 100755 .github/fiware/core/scorpio-query-manager.sh create mode 100755 .github/fiware/core/scorpio-registry-manager.sh create mode 100755 .github/fiware/core/scorpio-subscription-manager.sh create mode 100755 .github/fiware/core/scorpio-subscription-registry.sh rename .github/fiware/core/{x-scorpio.sh => scorpio.sh} (51%) diff --git a/.github/fiware/core/cygnus.sh b/.github/fiware/core/cygnus.sh index 4f099d32b..43782c52a 100755 --- a/.github/fiware/core/cygnus.sh +++ b/.github/fiware/core/cygnus.sh @@ -9,7 +9,7 @@ REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" VERSION=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) -echo "NOT DONE - $VERSION" +echo "VERSION - $VERSION" function clone { echo 'cloning from '"$1 $2"' to '"$3" diff --git a/.github/fiware/core/scorpio-at-context-server.sh b/.github/fiware/core/scorpio-at-context-server.sh new file mode 100755 index 000000000..766bebcb7 --- /dev/null +++ b/.github/fiware/core/scorpio-at-context-server.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/at-context-server" +DOCKER_TARGET="fiware/scorpio-at-context-server" +QUAY_TARGET="quay.io/fiware/scorpio-at-context-server" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-entity-manager.sh b/.github/fiware/core/scorpio-entity-manager.sh new file mode 100755 index 000000000..bfee8bf4d --- /dev/null +++ b/.github/fiware/core/scorpio-entity-manager.sh @@ -0,0 +1,40 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/entity-manager" +DOCKER_TARGET="fiware/scorpio-entity-manager" +QUAY_TARGET="quay.io/fiware/scorpio-entity-manager" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-history-entity.sh b/.github/fiware/core/scorpio-history-entity.sh new file mode 100755 index 000000000..9a23b1236 --- /dev/null +++ b/.github/fiware/core/scorpio-history-entity.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/history-entity-manager" +DOCKER_TARGET="fiware/scorpio-history-entity" +QUAY_TARGET="quay.io/fiware/scorpio-history-entity" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-history-query.sh b/.github/fiware/core/scorpio-history-query.sh new file mode 100755 index 000000000..0b5e887f3 --- /dev/null +++ b/.github/fiware/core/scorpio-history-query.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/history-query-manager" +DOCKER_TARGET="fiware/scorpio-history-query" +QUAY_TARGET="quay.io/fiware/scorpio-history-query" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-query-manager.sh b/.github/fiware/core/scorpio-query-manager.sh new file mode 100755 index 000000000..791a72131 --- /dev/null +++ b/.github/fiware/core/scorpio-query-manager.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/query-manager" +DOCKER_TARGET="fiware/scorpio-query-manager" +QUAY_TARGET="quay.io/fiware/scorpio-query-manager" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-registry-manager.sh b/.github/fiware/core/scorpio-registry-manager.sh new file mode 100755 index 000000000..941134150 --- /dev/null +++ b/.github/fiware/core/scorpio-registry-manager.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/registry-manager" +DOCKER_TARGET="fiware/scorpio-registry-manager" +QUAY_TARGET="quay.io/fiware/scorpio-registry-manager" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-subscription-manager.sh b/.github/fiware/core/scorpio-subscription-manager.sh new file mode 100755 index 000000000..4914c23f3 --- /dev/null +++ b/.github/fiware/core/scorpio-subscription-manager.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/subscription-manager" +DOCKER_TARGET="fiware/scorpio-subscription-manager" +QUAY_TARGET="quay.io/fiware/scorpio-subscription-manager" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/scorpio-subscription-registry.sh b/.github/fiware/core/scorpio-subscription-registry.sh new file mode 100755 index 000000000..e11e36a6a --- /dev/null +++ b/.github/fiware/core/scorpio-subscription-registry.sh @@ -0,0 +1,41 @@ +set -e + +NAME="core/scorpio" +SOURCE="scorpiobroker/registry-subscription-manager" +DOCKER_TARGET="fiware/scorpio-subscription-registry" +QUAY_TARGET="quay.io/fiware/scorpio-subscription-registry" + +REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" +TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) + +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` + +echo "VERSION - $VERSION" + +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" java-kafka-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" || true + fi + if [[ $i == "quay" ]]; then + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" + fi + echo "" +done + + diff --git a/.github/fiware/core/x-scorpio.sh b/.github/fiware/core/scorpio.sh similarity index 51% rename from .github/fiware/core/x-scorpio.sh rename to .github/fiware/core/scorpio.sh index bb8f28059..46322c70d 100755 --- a/.github/fiware/core/x-scorpio.sh +++ b/.github/fiware/core/scorpio.sh @@ -7,10 +7,10 @@ QUAY_TARGET="quay.io/fiware/scorpio" REPOSITORY="$(git rev-parse --show-toplevel)/$NAME" TAGS="$(git -C $REPOSITORY rev-list --tags --max-count=1 )" -VERSION=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) +VERSIONv=$(git -C $REPOSITORY describe --exclude 'FIWARE*' --tags $TAGS ) +VERSION=`echo ${VERSIONv} | sed 's/-.*//'` -echo "NOT DONE - $VERSION" -exit 0 +echo "VERSION - $VERSION" function clone { echo 'cloning from '"$1 $2"' to '"$3" @@ -27,10 +27,16 @@ function clone { for i in "$@" ; do if [[ $i == "docker" ]]; then - clone "$SOURCE" "$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" java-"$VERSION" "$DOCKER_TARGET" true + clone "$SOURCE" java-kafka-"$VERSION" "$DOCKER_TARGET" + clone "$SOURCE" ubuntu-"$VERSION" "$DOCKER_TARGET" + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$DOCKER_TARGET" fi if [[ $i == "quay" ]]; then - clone "$SOURCE" "$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" java-"$VERSION" "$QUAY_TARGET" true + clone "$SOURCE" java-kafka-"$VERSION" "$QUAY_TARGET" + clone "$SOURCE" ubuntu-"$VERSION" "$QUAY_TARGET" + clone "$SOURCE" ubuntu-kafka-"$VERSION" "$QUAY_TARGET" fi echo "" done diff --git a/.github/fiware/image-clone.sh b/.github/fiware/image-clone.sh index 875b3af9c..379a4df7a 100755 --- a/.github/fiware/image-clone.sh +++ b/.github/fiware/image-clone.sh @@ -2,6 +2,7 @@ MY_PATH="`dirname \"$0\"`" +git submodule update --recursive --remote for file in "$MY_PATH/$1"/*.sh do @@ -24,6 +25,6 @@ done for i in "$@" ; do if [[ $i == "clean" ]]; then - docker rmi -f $(docker images -a -q) | true + docker rmi -f $(docker images -a -q) || true fi done