File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 1+ * Added showing release notes while upgrading
2+
13## 1.0.1 (2018-06-06)
24* Added Makefile.sample.mk
35* Added CHANGELOG.md
Original file line number Diff line number Diff line change 3939SAMPLES
4040-------
4141
42- Basic command (you can copy and paste it into your Makefile)
42+ Basic commands (you can copy and paste it into your Makefile)
4343
4444``` makefile
4545up : # # Start all or c=<name> containers in foreground
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
2+ # Get some property from release
3+ # Usage:
4+ # get_latest_release user/repo tag_name
25get_latest_release () {
36 curl --silent " https://api.github.com/repos/$1 /releases/latest" | # Get latest release from GitHub api
4- grep ' "tag_name": ' | # Get tag line
7+ grep " \" $2 \" : " | # Get tag line
58 sed -E ' s/.*"([^"]+)".*/\1/' # Pluck JSON value
69}
7- v=$( get_latest_release $MK_REPO )
810
9- if [ $v = $MK_VERSION ]; then
11+ # Getting last version
12+ NEW_VER=$( get_latest_release $MK_REPO tag_name)
13+
14+ if [ $NEW_VER = $MK_VERSION ]; then
1015 echo ' Up to date' ;
1116else
12- echo " A new version is available" ;
13- echo " Upgrading from $MK_VERSION to $v " ;
14- curl -sL https://raw.githubusercontent.com/$MK_REPO /master/scripts/upgrade.sh | ( echo " MK_REPO=$MK_REPO ; MK_VERSION=$v ; " ; cat - ) | sh
17+ echo " A new version is available"
18+ body=$( get_latest_release $MK_REPO body)
19+ echo " Upgrading from $MK_VERSION to $NEW_VER
20+
21+ Release notes
22+ ************************
23+ $body
24+ ************************
25+ " ;
26+ # Downloading and executing upgrade script
27+ curl -sL https://raw.githubusercontent.com/$MK_REPO /master/scripts/upgrade.sh | ( echo " MK_REPO=$MK_REPO ; MK_VERSION=$NEW_VER ; " ; cat - ) | sh
1528fi ;
You can’t perform that action at this time.
0 commit comments