Skip to content

Commit

Permalink
ncp-config: show changelog on updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Dec 5, 2017
1 parent 0fe56d8 commit 4f63c34
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
9 changes: 9 additions & 0 deletions bin/ncp-check-version
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@

ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }

rm -rf /tmp/ncp-check-tmp

git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1

cd /tmp/ncp-check-tmp || exit 1
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
echo "$VER" > /var/run/.ncp-latest-version

# write changelog
git log --graph --oneline --decorate \
--pretty=format:"[%D] %s" --date=short | \
grep 'tag: v' | \
sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
}
cd / || exit 1

Expand Down
7 changes: 7 additions & 0 deletions bin/ncp-update
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
echo "$VER" > /usr/local/etc/ncp-version
echo "$VER" > /var/run/.ncp-latest-version

# write changelog
git log --graph --oneline --decorate \
--pretty=format:"[%D] %s" --date=short | \
grep 'tag: v' | \
sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
}
echo -e "NextCloudPi updated to version $VER"
}
Expand Down
7 changes: 5 additions & 2 deletions bin/nextcloudpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ function nextcloud-config()
test -f $VERFILE || ncp-check-version

# ask for update if outdated

test -f /usr/local/etc/ncp-changelog && \
local CHANGELOG=$( head -4 /usr/local/etc/ncp-changelog )
ncp-test-updates && \
whiptail --backtitle "$BACKTITLE $( cat /usr/local/etc/ncp-version )" \
--title "NextCloudPi update available" \
--clear --yesno "Update to $( cat $VERFILE )?\n\n\n\nSee changes at\n\nhttps://github.com/nextcloud/nextcloudpi/blob/master/changelog.md" \
20 70
--clear --yesno "Update to $( cat $VERFILE )?\n\n$CHANGELOG" \
15 70
[[ $? -eq $DIALOG_OK ]] && ncp-update

while true; do
Expand Down
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

[v0.41.5](https://github.com/nextcloud/nextcloudpi/commit/b174061) (2017-12-05) nc-database: accept BTRFS filesystems
[v0.41.6](https://github.com/nextcloud/nextcloudpi/commit/c7c709a) (2017-12-05) ncp-config: show changelog on updates

[v0.41.5](https://github.com/nextcloud/nextcloudpi/commit/0fe56d8) (2017-12-05) nc-database: accept BTRFS filesystems

[v0.41.4 ](https://github.com/nextcloud/nextcloudpi/commit/231ede0) (2017-11-29) nc-limits: added PHP threads and Redis mem limits

[v0.41.3](https://github.com/nextcloud/nextcloudpi/commit/1014845) (2017-12-05) SSH: enhance security
[v0.41.3 ](https://github.com/nextcloud/nextcloudpi/commit/1014845) (2017-12-05) SSH: enhance security

[v0.41.2 ](https://github.com/nextcloud/nextcloudpi/commit/a2c5de7) (2017-12-04) nc-automount: check for USBdrive labeled drive case

Expand Down

0 comments on commit 4f63c34

Please sign in to comment.