Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_bump.sh - github.com/nextcloud/univention-app.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7e07f25a1bfbefe86baa4682f8f2bade9a85174b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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