diff options
author | Tilo Spannagel <development@tilosp.de> | 2017-06-23 16:12:44 +0200 |
---|---|---|
committer | Tilo Spannagel <development@tilosp.de> | 2017-06-23 18:59:00 +0200 |
commit | e5d81338d9fa82d5c7399c58f741acb47f69d8fa (patch) | |
tree | 587083dee040de2c0fd7a7c45e5ab487863db1df /update.sh | |
parent | 2ed2ea4a28d5b292a3b3af5f577e6f73d3eaeec1 (diff) |
Use travis build stages
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -14,14 +14,18 @@ function version_greater_or_equal() { latests=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \ grep -oE 'nextcloud-[[:digit:]]+(.[[:digit:]]+)+' | \ grep -oE '[[:digit:]]+(.[[:digit:]]+)+' | \ - sort -uV ) ) + sort -urV ) ) -find -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+' -exec rm -r '{}' \; +find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+' -exec rm -r '{}' \; travisEnv= for latest in "${latests[@]}"; do version=$(echo "$latest" | cut -d. -f1-2) + if [ -d "$version" ]; then + continue + fi + # Only add versions >= 10 if version_greater_or_equal "$version" "10.0"; then @@ -55,14 +59,14 @@ for latest in "${latests[@]}"; do # Copy apps.config.php cp apps.config.php "$version/$variant/apps.config.php" - travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv" + travisEnv='\n - env: VERSION='"$version"' VARIANT='"$variant$travisEnv" done fi done +# replace the fist '-' with ' ' +travisEnv="$(echo "$travisEnv" | sed '0,/-/{s/-/ /}')" + # update .travis.yml -travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" +travis="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" { $0 = " - stage: test images'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" echo "$travis" > .travis.yml - -# remove duplicate entries -echo "$(awk '!NF || !seen[$0]++' .travis.yml)" > .travis.yml |