From 273d94e1553b68d7b37cda01cee44ef473de1845 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Wed, 13 Sep 2023 22:38:19 +0900 Subject: [PATCH 1/6] Bump: 0.2.0 -> 0.2.0-next --- CHANGELOG.md | 2 ++ VERSION | 2 +- setup-fiware.sh | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbc926b..06c2923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## FIWARE Small Bang v0.2.0-next + ## FIWARE Small Bang v0.2.0 - 13 September, 2023 - ADD Elasticsearch 7.17.13 (#14) diff --git a/VERSION b/VERSION index 56fde78..b5b5e40 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=0.2.0 +VERSION=0.2.0-next diff --git a/setup-fiware.sh b/setup-fiware.sh index d1127be..31630f3 100755 --- a/setup-fiware.sh +++ b/setup-fiware.sh @@ -28,7 +28,7 @@ set -Ceuo pipefail -VERSION=0.2.0 +VERSION=0.2.0-next # # Syslog info @@ -397,7 +397,7 @@ EOF IMAGE_ELASTICSEARCH_DB=elasticsearch:7.17.13 - IMAGE_NODE_RED=letsfiware/node-red:v0.2.0 + IMAGE_NODE_RED=letsfiware/node-red:v0.2.0-next MONGO_INSTALLED=false POSTGRES_INSTALLED=false From 51f6450a1b3c833326e1e28297235531f4e25937 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Fri, 15 Sep 2023 23:09:13 +0900 Subject: [PATCH 2/6] ADD Release actions --- .github/workflows/release.yml | 21 +++++++ CHANGELOG.md | 2 + README.md | 2 +- README_ja.md | 2 +- docs/en/installation.md | 2 +- docs/ja/installation.md | 2 +- maintenance/release.sh | 86 +++++++++++++++++++++++++++ maintenance/version-up.sh | 109 ++++++++++++++++++++++++++++++++++ tests/script/coverage.sh | 2 +- 9 files changed, 223 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100755 maintenance/release.sh create mode 100755 maintenance/version-up.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e3a97b7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +on: + push: + branches: + - 'main' + tags: + - 'v*' + +jobs: + create-release-tag: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + REF: ${{ github.ref }} + TZ: 'Asia/Tokyo' + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: Run release + run: ./maintenance/release.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 06c2923..9ca064c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## FIWARE Small Bang v0.2.0-next +- ADD Release actions (#17) + ## FIWARE Small Bang v0.2.0 - 13 September, 2023 - ADD Elasticsearch 7.17.13 (#14) diff --git a/README.md b/README.md index 4d9f795..760e1eb 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Before running the setup script, you need to install docker and docker compose p Download a tar.gz file for the FIWARE Small Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tgz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - ``` Move to the `FIWARE-Small-Bang-0.2.0` directory. diff --git a/README_ja.md b/README_ja.md index 31f5784..d6282ea 100644 --- a/README_ja.md +++ b/README_ja.md @@ -68,7 +68,7 @@ FI-SB は FIWARE Small Bang の略称です。 FIWARE Small Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tgz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - ``` `FIWARE-Small-Bang-0.2.0` ディレクトリに移動します。 diff --git a/docs/en/installation.md b/docs/en/installation.md index a66c4ee..44cdc89 100644 --- a/docs/en/installation.md +++ b/docs/en/installation.md @@ -21,7 +21,7 @@ Before running the setup script, you need to install docker and docker compose p Download a tar.gz file for the FIWARE Small Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tgz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - ``` Move to the `FIWARE-Small-Bang-0.2.0` directory. diff --git a/docs/ja/installation.md b/docs/ja/installation.md index b124fdf..85c5d04 100644 --- a/docs/ja/installation.md +++ b/docs/ja/installation.md @@ -25,7 +25,7 @@ FIWARE Small Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tgz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - ``` `FIWARE-Small-Bang-0.2.0` ディレクトリに移動します。 diff --git a/maintenance/release.sh b/maintenance/release.sh new file mode 100755 index 0000000..9e9998b --- /dev/null +++ b/maintenance/release.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +# MIT License +# +# Copyright (c) 2023 Kazuhito Suda +# +# This file is part of FIWARE Small Bang +# +# https://github.com/lets-fiware/FIWARE-Small-Bang +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set -ue + +cd "$(dirname "$0")" +cd .. + +if ! [ "$(echo "${REF}" | grep "^refs/tags/v")" ]; then + exit 0 +fi + +NAME=${REPO##*/} +TAG=${REF##*/} + +echo "NAME: ${NAME}" +echo "REPO: ${REPO}" +echo "REF: ${REF}" +echo "TAG: ${TAG}" + +FILE=CHANGELOG.md +LINES=$(grep -n "^##" -m 2 "${FILE}" | sed -e 's/:.*//g'| sed -z "s/\n/,/g" | sed "s/,$//") +CHANGE_LOG=$(sed -n "${LINES}p" "${FILE}" | sed -e "/^$/d" -e "/^##/d" | sed -z "s/\n/\\\\n/g") +echo "${CHANGE_LOG}" + +RES=$(curl -X POST \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -d "{ \"tag_name\": \"${TAG}\", \"name\": \"${NAME//-/ } ${TAG}\", \"body\": \"${CHANGE_LOG}\"}" \ + https://api.github.com/repos/${REPO}/releases) + +# Create tar.gz file + +DIR="${NAME}-${TAG//v/}" +mkdir "${DIR}" + +for FILE in LICENSE README.md config.sh setup-fiware.sh +do + cp -a "${FILE}" "${DIR}/" +done + +for FILE in examples +do + cp -ar "${FILE}" "${DIR}/" +done + +FILE="${DIR}.tar.gz" + +tar czvf "${FILE}" "${DIR}" + +rm -fr "${DIR}" + +## Upload tgz file + +UPLOAD_URL=`echo "${RES}" | jq '. | .upload_url' | tr -d '"'` +UPLOAD_URL="${UPLOAD_URL%%\{*}?name=${FILE}" +echo "UPLOAD URL: ${UPLOAD_URL}" + +curl -L -X POST ${UPLOAD_URL} -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H 'Accept: application/vnd.github+json' \ + -H 'Content-Type: application/gzip' \ + --data-binary "@${FILE}" diff --git a/maintenance/version-up.sh b/maintenance/version-up.sh new file mode 100755 index 0000000..87847bd --- /dev/null +++ b/maintenance/version-up.sh @@ -0,0 +1,109 @@ +#!/bin/bash +set -ue + +# MIT License +# +# Copyright (c) 2023 Kazuhito Suda +# +# This file is part of FIWARE Small Bang +# +# https://github.com/lets-fiware/FIWARE-Small-Bang +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +LANG=C +LC_TIME=C + +version_up() { + FISB_HOME=$PWD + OLD=$1 + NEW=$(echo "${OLD}" | awk -F \. -v 'OFS=.' '{print $1, $2+1,$3 }') + + BRANCH="release/${NEW}" + DATE=$(date "+%d %B, %Y") + + git switch -c "${BRANCH}" + + sed -i "1s/${OLD}-next/${NEW} - ${DATE}/" "${FISB_HOME}/CHANGELOG.md" + + for file in README.md README_ja.md VERSION docs/en/installation.md docs/ja/installation.md setup-fiware.sh + do + file="${FISB_HOME}/${file}" + ls -l "${file}" + sed -i -e "s/${OLD}.tar.gz/${NEW}.tar.gz/" "${file}" + sed -i -e "s/FIWARE-Small-Bang-${OLD}/FIWARE-Small-Bang-${NEW}/" "${file}" + sed -i -e "s/${OLD}-next/${NEW}/" "${file}" + sed -i -e "s/v${OLD}/v${NEW}/" "${file}" + done + + sed -i -e "s/${OLD}-next/${NEW}/" "${FISB_HOME}/config.sh" + + sed -i -e "s/${OLD}-next/${NEW}-next/" "${FISB_HOME}/.github/pull_request_template.md" + sed -i -e "s/${OLD}-next/${NEW}-next/" "${FISB_HOME}/CONTRIBUTING.md" + + sed -i -e "s/${OLD}/${NEW}/" "${FISB_HOME}/SECURITY.md" + + git add . + git commit -m "Bump: ${OLD}-next -> ${NEW}" + git push origin "${BRANCH}" +} + +next_version() { + FISB_HOME=$PWD + VER=$1 + + BRANCH="release/${VER}_next" + + git switch -c "${BRANCH}" + + for file in VERSION setup-fiware.sh + do + file="${FISB_HOME}/${file}" + ls -l "${file}" + sed -i -e "s/${VER}/${VER}-next/" "${file}" + done + + sed -i "1i ## FIWARE Small Bang v${VER}-next\n" "${FISB_HOME}/CHANGELOG.md" + + git add . + git commit -m "Bump: ${VER} -> ${VER}-next" + git push origin "${BRANCH}" +} + +main() { + if ! [ -e VERSION ]; then + echo "VERSION file not found" + exit 1 + fi + + VERSION=$(sed "s/VERSION=//" VERSION | sed "s/-next//" | awk -F \. -v 'OFS=.' '{print $1, $2,$3 }') + + set +e + RESULT=$(grep -ic -next VERSION) + set -e + + if [ "${RESULT}" -eq 1 ]; then + version_up ${VERSION} + else + echo "next version" + next_version ${VERSION} + fi +} + +main "$@" diff --git a/tests/script/coverage.sh b/tests/script/coverage.sh index 175cbd7..ddf5852 100755 --- a/tests/script/coverage.sh +++ b/tests/script/coverage.sh @@ -117,7 +117,7 @@ setup() { sudo tar zxf ngsi-${ngsi_go_version}-linux-amd64.tar.gz -C /usr/local/bin rm -f ngsi-${ngsi_go_version}-linux-amd64.tar.gz - KCOV="/usr/local/bin/kcov --exclude-path=tests,.git,setup,coverage,.github,.vscode,examples,docs,.mock" + KCOV="/usr/local/bin/kcov --exclude-path=tests,.git,setup,coverage,.github,.vscode,examples,docs,.mock,maintenance" reset_env } From 42fe68e8c671c35ed504d1dc16d1e9a46cb48a23 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Sun, 17 Sep 2023 09:36:37 +0900 Subject: [PATCH 3/6] Improve Release action --- .github/workflows/release.yml | 9 ++--- .gitignore | 2 + CHANGELOG.md | 3 +- maintenance/release.sh | 69 +++++++++++++++++++++++++++++------ 4 files changed, 64 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3a97b7..0462236 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,7 @@ on: - push: - branches: - - 'main' - tags: - - 'v*' + pull_request: + branches: [main] + types: [closed] jobs: create-release-tag: @@ -11,7 +9,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} - REF: ${{ github.ref }} TZ: 'Asia/Tokyo' steps: - name: Git checkout diff --git a/.gitignore b/.gitignore index bed9d96..10c61fd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ ngsi-v* *.jar setup_ngsi_go.sh .install +*.tar.gz +*.tgz diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca064c..337388c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## FIWARE Small Bang v0.2.0-next -- ADD Release actions (#17) +- Improve release action (#18) +- ADD release action (#17) ## FIWARE Small Bang v0.2.0 - 13 September, 2023 diff --git a/maintenance/release.sh b/maintenance/release.sh index 9e9998b..44522eb 100755 --- a/maintenance/release.sh +++ b/maintenance/release.sh @@ -31,17 +31,34 @@ set -ue cd "$(dirname "$0")" cd .. -if ! [ "$(echo "${REF}" | grep "^refs/tags/v")" ]; then +TAG=$(cat VERSION) +TAG="v${TAG##*=}" +VER=${TAG//v/} +echo "TAG: ${TAG}" +echo "VER: ${VER}" + +if echo "${TAG}" | grep -q "-next" +then + exit 0 +fi + +if git tag | grep -q "${TAG}" +then exit 0 fi +AUTHOR_NAME=$(jq -r '.pull_request.merged_by.login' "$GITHUB_EVENT_PATH") +AUTHOR_EMAIL=$(jq -r '.pull_request.merged_by.email' "$GITHUB_EVENT_PATH") + +git config user.name "${AUTHOR_NAME}" +git config user.email "${AUTHOR_EMAIL}" +git tag "${TAG}" +git push origin "${TAG}" + NAME=${REPO##*/} -TAG=${REF##*/} echo "NAME: ${NAME}" echo "REPO: ${REPO}" -echo "REF: ${REF}" -echo "TAG: ${TAG}" FILE=CHANGELOG.md LINES=$(grep -n "^##" -m 2 "${FILE}" | sed -e 's/:.*//g'| sed -z "s/\n/,/g" | sed "s/,$//") @@ -51,7 +68,7 @@ echo "${CHANGE_LOG}" RES=$(curl -X POST \ -H "Authorization: token ${GITHUB_TOKEN}" \ -d "{ \"tag_name\": \"${TAG}\", \"name\": \"${NAME//-/ } ${TAG}\", \"body\": \"${CHANGE_LOG}\"}" \ - https://api.github.com/repos/${REPO}/releases) + "https://api.github.com/repos/${REPO}/releases") # Create tar.gz file @@ -63,10 +80,11 @@ do cp -a "${FILE}" "${DIR}/" done -for FILE in examples -do - cp -ar "${FILE}" "${DIR}/" -done +# for FILE in examples +# do +# cp -ar "${FILE}" "${DIR}/" +# done +cp -ar examples "${DIR}/" FILE="${DIR}.tar.gz" @@ -74,13 +92,40 @@ tar czvf "${FILE}" "${DIR}" rm -fr "${DIR}" -## Upload tgz file +## Upload tar.gz file -UPLOAD_URL=`echo "${RES}" | jq '. | .upload_url' | tr -d '"'` +UPLOAD_URL=$(echo "${RES}" | jq '. | .upload_url' | tr -d '"') UPLOAD_URL="${UPLOAD_URL%%\{*}?name=${FILE}" echo "UPLOAD URL: ${UPLOAD_URL}" -curl -L -X POST ${UPLOAD_URL} -H "Authorization: Bearer ${GITHUB_TOKEN}" \ +curl -L -X POST "${UPLOAD_URL}" -H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H 'Accept: application/vnd.github+json' \ -H 'Content-Type: application/gzip' \ --data-binary "@${FILE}" + +rm -f "${FILE}" + +## Create -next branch + +git switch -c "${TAG}-next" +git push origin "${TAG}-next" + +## Create branch +git switch -c "release/${VER}_next" + +VER_SED=${VER//\./\\.} + +for FILE in VERSION setup-fiware.sh +do + sed -i -e "s/${VER_SED}/${VER_SED}-next/" "${FILE}" +done + +sed -i "1i ## FIWARE Small Bang v${VER_SED}-next\n" CHANGELOG.md + +git add . +git commit -m "Bump: ${VER} -> ${VER}-next" +git push origin "release/${VER}_next" + +## Create PR + +gh pr create --base "${TAG}-next" --head "release/${VER}_next" --title "Bump: ${VER} -> ${VER}-next" --body "This PR is a preparation for the next release." From bed0b320eca3e29a0d65f1e2824e0fe228619858 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Sun, 17 Sep 2023 16:22:43 +0900 Subject: [PATCH 4/6] UPDATE WireCloud to 1.3.1 and NGSI Proxy to 1.2.2 for arm64 --- CHANGELOG.md | 1 + setup-fiware.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 337388c..aeb3815 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## FIWARE Small Bang v0.2.0-next +- UPDATE WireCloud to 1.3.1 and NGSI Proxy to 1.2.2 for arm64 (#19) - Improve release action (#18) - ADD release action (#17) diff --git a/setup-fiware.sh b/setup-fiware.sh index 31630f3..ce67f9b 100755 --- a/setup-fiware.sh +++ b/setup-fiware.sh @@ -318,7 +318,6 @@ set_amd64_images() { IMAGE_PERSEO_CORE=telefonicaiot/perseo-core:1.13.0 IMAGE_PERSEO_FE=telefonicaiot/perseo-fe:1.27.0 IMAGE_ELASTICSEARCH=elasticsearch:2.4 - IMAGE_POSTGRES=postgres:15 } # @@ -326,8 +325,8 @@ set_amd64_images() { # set_arm64_images() { IMAGE_ORION=letsfiware/orion:3.10.1 - IMAGE_WIRECLOUD=letsfiware/wirecloud:1.3 - IMAGE_NGSIPROXY=letsfiware/ngsiproxy:1.2.0 + IMAGE_WIRECLOUD=letsfiware/wirecloud:1.3.1 + IMAGE_NGSIPROXY=letsfiware/ngsiproxy:1.2.2 IMAGE_COMET=letsfiware/sth-comet:2.10.0 IMAGE_CYGNUS=letsfiware/fiware-cygnus:3.2.0 IMAGE_IOTAGENT_UL=letsfiware/iotagent-ul:2.3.0 @@ -336,7 +335,6 @@ set_arm64_images() { IMAGE_PERSEO_CORE=letsfiware/perseo-core:1.13.0 IMAGE_PERSEO_FE=letsfiware/perseo-fe:1.27.0 IMAGE_ELASTICSEARCH=letsfiware/elasticsearch:2.4 - IMAGE_POSTGRES=postgres:9.6 } # @@ -395,6 +393,8 @@ EOF IMAGE_MYSQL=mysql:8.1 + IMAGE_POSTGRES=postgres:15 + IMAGE_ELASTICSEARCH_DB=elasticsearch:7.17.13 IMAGE_NODE_RED=letsfiware/node-red:v0.2.0-next @@ -1495,7 +1495,7 @@ http { } location / { proxy_pass http://wirecloud:8000; - proxy_set_header Host $host; + proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } From 6586725211d91faedd95131f1ab5991e3d7c5943 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Sun, 17 Sep 2023 19:34:15 +0900 Subject: [PATCH 5/6] ADD IP address option --- CHANGELOG.md | 1 + setup-fiware.sh | 33 ++++++++++++++++++++------------- tests/script/coverage.sh | 4 ++-- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb3815..cabad16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## FIWARE Small Bang v0.2.0-next +- ADD IP address option (#20) - UPDATE WireCloud to 1.3.1 and NGSI Proxy to 1.2.2 for arm64 (#19) - Improve release action (#18) - ADD release action (#17) diff --git a/setup-fiware.sh b/setup-fiware.sh index ce67f9b..196918f 100755 --- a/setup-fiware.sh +++ b/setup-fiware.sh @@ -54,10 +54,12 @@ logging_err() { get_ip_address() { logging_info "${FUNCNAME[0]}" - if [ "${OS}" = "linux" ]; then - IP_ADDRESS=$(hostname -I | awk '{ print $1 }') - else - IP_ADDRESS=$("${IPCONFIG_CMD}" getifaddr en0) + if [ -z "${IP_ADDRESS}" ]; then + if [ "${OS}" = "linux" ]; then + IP_ADDRESS=$(hostname -I | awk '{ print $1 }') + else + IP_ADDRESS=$("${IPCONFIG_CMD}" getifaddr en0) + fi fi } @@ -1625,15 +1627,15 @@ create_script_to_setup_ngsi_go() { rm -f "${SCRIPT_FILE}" fi { - echo -e "#!/bin/bash\n\n# This file was created by FIWARE Small Bang.\n# See http://github.com/lets-fiware/ngsi-go for how to install NGSI Go.\n"; - echo "ngsi broker add --host orion.${IP_ADDRESS} --ngsiType v2 --brokerHost http://${IP_ADDRESS}:1026 --overWrite"; + echo -e "#!/bin/bash\n\n# This file was created by FIWARE Small Bang.\n# See http://github.com/lets-fiware/ngsi-go for how to install NGSI Go.\n\nIP_ADDRESS=${IP_ADDRESS}\n"; + echo "ngsi broker add --host orion.\${IP_ADDRESS} --ngsiType v2 --brokerHost http://\${IP_ADDRESS}:1026 --overWrite"; } > "${SCRIPT_FILE}" - ${CYGNUS} && echo "ngsi server add --host cygnus.${IP_ADDRESS} --serverType cygnus --serverHost http://${IP_ADDRESS}:5080 --overWrite" >> "${SCRIPT_FILE}" - ${COMET} && echo "ngsi server add --host comet.${IP_ADDRESS} --serverType comet --serverHost http://${IP_ADDRESS}:8666 --overWrite" >> "${SCRIPT_FILE}" - ${WIRECLOUD} && echo "ngsi server add --host wirecloud.${IP_ADDRESS} --serverType wirecloud --serverHost http://${IP_ADDRESS} --overWrite" >> "${SCRIPT_FILE}" - ${IOTAGENT} && echo "ngsi server add --host iotagent.${IP_ADDRESS} --serverType iota --serverHost http://${IP_ADDRESS}:4041 --service openiot --path / --overWrite" >> "${SCRIPT_FILE}" - ${QUANTUMLEAP} && echo "ngsi server add --host quantumleap.${IP_ADDRESS} --serverType quantumleap --serverHost http://${IP_ADDRESS}:8668 --overWrite" >> "${SCRIPT_FILE}" - ${PERSEO} && echo "ngsi server add --host perseo.${IP_ADDRESS} --serverType perseo --serverHost http://${IP_ADDRESS}:9090 --overWrite" >> "${SCRIPT_FILE}" + ${CYGNUS} && echo "ngsi server add --host cygnus.\${IP_ADDRESS} --serverType cygnus --serverHost http://\${IP_ADDRESS}:5080 --overWrite" >> "${SCRIPT_FILE}" + ${COMET} && echo "ngsi server add --host comet.\${IP_ADDRESS} --serverType comet --serverHost http://\${IP_ADDRESS}:8666 --overWrite" >> "${SCRIPT_FILE}" + ${WIRECLOUD} && echo "ngsi server add --host wirecloud.\${IP_ADDRESS} --serverType wirecloud --serverHost http://\${IP_ADDRESS} --overWrite" >> "${SCRIPT_FILE}" + ${IOTAGENT} && echo "ngsi server add --host iotagent.\${IP_ADDRESS} --serverType iota --serverHost http://\${IP_ADDRESS}:4041 --service openiot --path / --overWrite" >> "${SCRIPT_FILE}" + ${QUANTUMLEAP} && echo "ngsi server add --host quantumleap.\${IP_ADDRESS} --serverType quantumleap --serverHost http://\${IP_ADDRESS}:8668 --overWrite" >> "${SCRIPT_FILE}" + ${PERSEO} && echo "ngsi server add --host perseo.\${IP_ADDRESS} --serverType perseo --serverHost http://\${IP_ADDRESS}:9090 --overWrite" >> "${SCRIPT_FILE}" chmod 0755 "${SCRIPT_FILE}" } @@ -1695,13 +1697,18 @@ init_env() { LOGGER="${LOGGER:-false}" SED_LF=$(printf '\\\012_') SED_LF=${SED_LF%_} + + IP_ADDRESS= + if [ $# -ge 1 ]; then + IP_ADDRESS=$(echo "${1}" | sed -n -r -e "s/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/\1/p") + fi } # # main # main() { - init_env + init_env "$@" init_cmd diff --git a/tests/script/coverage.sh b/tests/script/coverage.sh index ddf5852..2a0cf75 100755 --- a/tests/script/coverage.sh +++ b/tests/script/coverage.sh @@ -184,7 +184,7 @@ install_test2() { sed -i -e "s/^\(IOTAGENT_JSON=\).*/\1true/" config.sh sed -i -e "s/^\(START_CONTAINER=\).*/\1N/" config.sh - ${KCOV} ./coverage ./setup-fiware.sh + ${KCOV} ./coverage ./setup-fiware.sh 192.168.0.1 reset_env @@ -215,7 +215,7 @@ install_test_darwin_arm64() { sed -i -e "s/^\(WIRECLOUD=\).*/\1y/" config.sh sed -i -e "s/^\(START_CONTAINER=\).*/\1n/" config.sh - ${KCOV} ./coverage ./setup-fiware.sh + ${KCOV} ./coverage ./setup-fiware.sh aaa export FISB_TEST_UNAME_CMD= rm -f "${MOCK_DIR}/uname" From f5ae4c09dae88a6b13a2736d5659a9799357a1a9 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Mon, 18 Sep 2023 09:30:12 +0900 Subject: [PATCH 6/6] Bump: 0.2.0-next -> 0.3.0 --- .github/pull_request_template.md | 4 ++-- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 6 +++--- README_ja.md | 6 +++--- SECURITY.md | 4 ++-- VERSION | 2 +- docs/en/installation.md | 6 +++--- docs/ja/installation.md | 6 +++--- setup-fiware.sh | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4a71094..34959f9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,7 +2,7 @@ Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. Please send a pull request to -the `v0.2.0-next` branch. +the `v0.3.0-next` branch. ## Types of changes @@ -23,7 +23,7 @@ merging your code._ - [ ] I have read the [CONTRIBUTING](https://github.com/lets-fiware/FIWARE-Small-Bang/blob/main/CONTRIBUTING.md) doc - [ ] I have signed the [CLA](https://github.com/lets-fiware/FIWARE-Small-Bang/blob/main/FIWARE-Small-Bang-individual-cla.pdf) - [ ] I have updated the change log (CHANGELOG.md) -- [ ] I send this pull request to the `v0.2.0-next` branch. +- [ ] I send this pull request to the `v0.3.0-next` branch. - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) - [ ] Any dependent changes have been merged and published in downstream modules diff --git a/CHANGELOG.md b/CHANGELOG.md index cabad16..c903275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## FIWARE Small Bang v0.2.0-next +## FIWARE Small Bang v0.3.0 - 18 September, 2023 - ADD IP address option (#20) - UPDATE WireCloud to 1.3.1 and NGSI Proxy to 1.2.2 for arm64 (#19) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d585f2..40c1ef7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ If you don't see your idea listed, and you think it fits into the goals of this - **If your contribution is minor,** such as a typo fix, open a pull request. - **If your contribution is major,** such as a new guide, start by opening an issue first. That way, other people can weigh in on the discussion before you do any work. -- Send a pull request to the `v0.2.0-next` branch (not main branch). +- Send a pull request to the `v0.3.0-next` branch (not main branch). ## Community diff --git a/README.md b/README.md index 760e1eb..812cbf9 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,13 @@ Before running the setup script, you need to install docker and docker compose p Download a tar.gz file for the FIWARE Small Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.3.0/FIWARE-Small-Bang-0.3.0.tar.gz | tar zxf - ``` -Move to the `FIWARE-Small-Bang-0.2.0` directory. +Move to the `FIWARE-Small-Bang-0.3.0` directory. ```bash -cd FIWARE-Small-Bang-0.2.0/ +cd FIWARE-Small-Bang-0.3.0/ ``` Run the `setup-fiware.sh` script. diff --git a/README_ja.md b/README_ja.md index d6282ea..d588dcf 100644 --- a/README_ja.md +++ b/README_ja.md @@ -68,13 +68,13 @@ FI-SB は FIWARE Small Bang の略称です。 FIWARE Small Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.3.0/FIWARE-Small-Bang-0.3.0.tar.gz | tar zxf - ``` -`FIWARE-Small-Bang-0.2.0` ディレクトリに移動します。 +`FIWARE-Small-Bang-0.3.0` ディレクトリに移動します。 ```bash -cd FIWARE-Small-Bang-0.2.0/ +cd FIWARE-Small-Bang-0.3.0/ ``` `setup-fiware.sh` スクリプトを実行します。 diff --git a/SECURITY.md b/SECURITY.md index df93398..d48d588 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ | Version | Supported | | -------- | ------------------ | -| 0.2.0 | :white_check_mark: | -| < 0.2.0 | :x: | +| 0.3.0 | :white_check_mark: | +| < 0.3.0 | :x: | ## Reporting a Vulnerability diff --git a/VERSION b/VERSION index b5b5e40..a2a557d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=0.2.0-next +VERSION=0.3.0 diff --git a/docs/en/installation.md b/docs/en/installation.md index 44cdc89..e37e92c 100644 --- a/docs/en/installation.md +++ b/docs/en/installation.md @@ -21,13 +21,13 @@ Before running the setup script, you need to install docker and docker compose p Download a tar.gz file for the FIWARE Small Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.3.0/FIWARE-Small-Bang-0.3.0.tar.gz | tar zxf - ``` -Move to the `FIWARE-Small-Bang-0.2.0` directory. +Move to the `FIWARE-Small-Bang-0.3.0` directory. ```bash -cd FIWARE-Small-Bang-0.2.0/ +cd FIWARE-Small-Bang-0.3.0/ ``` Run the `setup-fiware.sh` script. diff --git a/docs/ja/installation.md b/docs/ja/installation.md index 85c5d04..fb87612 100644 --- a/docs/ja/installation.md +++ b/docs/ja/installation.md @@ -25,13 +25,13 @@ FIWARE Small Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.2.0/FIWARE-Small-Bang-0.2.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Small-Bang/releases/download/v0.3.0/FIWARE-Small-Bang-0.3.0.tar.gz | tar zxf - ``` -`FIWARE-Small-Bang-0.2.0` ディレクトリに移動します。 +`FIWARE-Small-Bang-0.3.0` ディレクトリに移動します。 ```bash -cd FIWARE-Small-Bang-0.2.0/ +cd FIWARE-Small-Bang-0.3.0/ ``` `setup-fiware.sh` スクリプトを実行します。 diff --git a/setup-fiware.sh b/setup-fiware.sh index 196918f..02a6b2a 100755 --- a/setup-fiware.sh +++ b/setup-fiware.sh @@ -28,7 +28,7 @@ set -Ceuo pipefail -VERSION=0.2.0-next +VERSION=0.3.0 # # Syslog info @@ -399,7 +399,7 @@ EOF IMAGE_ELASTICSEARCH_DB=elasticsearch:7.17.13 - IMAGE_NODE_RED=letsfiware/node-red:v0.2.0-next + IMAGE_NODE_RED=letsfiware/node-red:v0.3.0 MONGO_INSTALLED=false POSTGRES_INSTALLED=false