diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c364c615d47a271f902c90246b0a64210d0fc92f..ce8e2ab889c89dffed2bbb32357baf3743989fe1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -260,9 +260,14 @@ amd64:linux.tps: - ./prod_build/pack.sh --target linux release - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb -.amd64:linux.updtr: +amd64:linux.updtr: extends: .build + stage: build image: demlabs/debian/amd64:qt5 + rules: + - when: manual + allow_failure: true + before_script: - /opt/buildtools/prepare_environment.sh amd64-linux - *fill_version_mk diff --git a/dist.linux/share/update.sh b/dist.linux/share/update.sh index e15f4fe875fceba530b78e1e5c276c77b84967f1..43710d3001bab27292376256df75370803225f1d 100755 --- a/dist.linux/share/update.sh +++ b/dist.linux/share/update.sh @@ -1,6 +1,7 @@ - #! /bin/bash +#! /bin/bash set -e -STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master/updates +STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master + MACHINE=$(uname -m) @@ -45,13 +46,22 @@ CURRENT_REBUILD=$(echo $INSTALLED_VERSION | grep -Po "[0-9]([0-9]+)") echo "Available patch: $MAX_REBUILD | Current patch: $CURRENT_REBUILD" if (( MAX_REBUILD > CURRENT_REBUILD )); then - echo "Need update cellframe-node to 5.2-$MAX_REBUILD..." + # Determine the full version (e.g. 5.3-354) from AVAILABLE_VERSIONS by the patch we found + for ver in "${AVAILABLE_VERSIONS[@]}" + do + patch=$(echo $ver | cut -d'-' -f2) + if [ "$patch" = "$MAX_REBUILD" ]; then + NEW_VERSION=$ver + break + fi + done + echo "Need update cellframe-node to $NEW_VERSION..." else echo "No need to update cellframe-node" exit 0 fi -PACKAGE_NAME="cellframe-node-5.2-$MAX_REBUILD-updtr-amd64.deb" +PACKAGE_NAME="cellframe-node-$NEW_VERSION-updtr-${POSTFIX}.deb" echo "wget" mkdir -p /tmp/cfupd/ wget $STORAGE_URL/$PACKAGE_NAME -O /tmp/cfupd/$PACKAGE_NAME @@ -73,4 +83,4 @@ fi dpkg -i /tmp/cfupd/$PACKAGE_NAME -service cellframe-node restart \ No newline at end of file +service cellframe-node restart