diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-07-22 02:23:51 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-07-22 02:23:51 +0300 |
commit | ce170197341ddaf240dd276e4ba55e155b43889e (patch) | |
tree | 330c6c70f6ca52d03cf8cd230b8fbde67e79801d | |
parent | 4aea7f7a807ba0228ae07fda06c41d06f372c3d7 (diff) |
add helper script, WIPv24.0.3
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | _bump.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/_bump.sh b/_bump.sh new file mode 100644 index 0000000..7e07f25 --- /dev/null +++ b/_bump.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# to be called from this directory +# usage: _bump.sh TARGET_VERSION + +TARGET_VERSION=${1} + +function main() { + # OLD_VERSION=$(grep -Po '^ADD.*nextcloud-\K[0-9]{2,3}\.[0-9]\.[0-9]{1,2}[^\.]*' Dockerfile) + sed -i -E "s/nextcloud-[0-9]{2,3}\.[0-9]\.[0-9]{1,2}[^\.]*/nextcloud-${TARGET_VERSION}/" Dockerfile + + SHIPPED_APPS=(richdocuments onlyoffice) + for APPID in ${SHIPPED_APPS[@]}; do + DOWNLOADLINK=$(get_app_download_uri ${APPID}) + sed -i -E "s#ADD.* /root/${APPID}.tar.gz#ADD ${DOWNLOADLINK} /root/${APPID}.tar.gz#" Dockerfile + echo $DOWNLOADLINK + done + + +} + +function get_app_download_uri() { + APPID=${1} + echo $(get_apps_json | jq -r -c ".[] | select(.id == \"${APPID}\") | .releases | .[0] | .download") +} + +function get_apps_json() { + # downloads it just once from poor appstore + APPS_JSON=${APPS_JSON:=$(curl --silent https://apps.nextcloud.com/api/v1/platform/${TARGET_VERSION}/apps.json)} + echo ${APPS_JSON} +} + +main |