Skip to content

Commit

Permalink
update: accept github branch as an argument to ncp-update to test dev…
Browse files Browse the repository at this point in the history
…elopment branch
  • Loading branch information
nachoparker committed Feb 16, 2018
1 parent f039311 commit 51b1e5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
7 changes: 6 additions & 1 deletion bin/ncp-update
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

{
[ "$(id -u)" -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }

echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
git clone --depth 20 -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || {

BRANCH="${1:-master}"
[[ "$BRANCH" != "master" ]] && echo "INFO: updating to development branch $BRANCH"

git clone --depth 20 -b "$BRANCH" -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || {
echo "No internet connectivity"
exit 1
}
Expand Down
22 changes: 3 additions & 19 deletions build-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,11 @@ install()
pgrep apt &>/dev/null || break
sleep 1
done
rm -f /etc/apt/apt.conf.d/20nextcloudpi-upgrades

echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
git clone --depth 20 -q -b devel https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp
cd /tmp/ncp-update-tmp || return 1

echo -e "Performing updates"
./update.sh && {

VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format
echo "$VER" > /usr/local/etc/ncp-version
echo "$VER" > /var/run/.ncp-latest-version
}
echo -e "NextCloudPi updated to version $VER"
}

cd / || return 1
rm -rf /tmp/ncp-update-tmp
# disable unattended upgrades
rm -f /etc/apt/apt.conf.d/20nextcloudpi-upgrades

ncp-update devel
}

configure() { :; }
Expand Down

0 comments on commit 51b1e5d

Please sign in to comment.