Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p curl jq gnugrep nix-update coreutils 3set -ex 4 5TAGS=$(curl -s https://api.github.com/repos/owncloud/ocis/releases | jq -r ".[].tag_name") 6 7for tag in $TAGS; do 8 main_version_old=$(echo "v$UPDATE_NIX_OLD_VERSION" | cut -d'.' -f1) 9 main_version_new=$(echo "$tag" | cut -d'.' -f1) 10 11 # Compare the main versions 12 if [[ "$main_version_old" == "$main_version_new" ]]; then 13 UPDATE_NIX_NEW_VERSION=$tag 14 break 15 else 16 continue 17 fi 18done 19 20OCIS_WEB_VERSION=$(curl -s https://raw.githubusercontent.com/owncloud/ocis/$UPDATE_NIX_NEW_VERSION/services/web/Makefile | grep -oP '(?<=WEB_ASSETS_VERSION = )v[0-9]+\.[0-9]+\.[0-9]+') 21nix-update -vr 'v(.*)' --version=$OCIS_WEB_VERSION ocis.web 22nix-update -vr 'v(.*)' --version=$UPDATE_NIX_NEW_VERSION ocis