-
Notifications
You must be signed in to change notification settings - Fork 21
/
release-sr
39 lines (26 loc) · 1.1 KB
/
release-sr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
git fetch --all
# Go to master
git checkout master
# Clean up 1.0
git branch -D 1.0 || echo
# Checkout 1.0
git checkout origin/1.0 -b 1.0
git reset origin/1.0 --hard
# for now this script is hardcoded to release on 1.0.x versions intentionally
# update to version 2 or 1.1 would require a major reorganisation on the release
# process
CURRENT_VERSION=`git tag | grep "^1\+\.0\+\.[0-9]\+$" | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1`
NEXT_MINOR_VERSION=$((`echo $CURRENT_VERSION | cut -f3 -d.`+1))
echo "###################################################################"
echo "You are about to release a new version of SlapOS Software Release"
echo "Lastest release: $CURRENT_VERSION"
echo "Next Release to be Tagged: 1.0.$NEXT_MINOR_VERSION"
echo "###################################################################"
git tag 1.0.$NEXT_MINOR_VERSION -m "Release 1.0.$NEXT_MINOR_VERSION"
echo " Please review current tag and then push it:"
echo " To review use git log 1.0.$NEXT_MINOR_VERSION"
echo ""
echo " To push into main repository:"
echo " git push origin 1.0.$NEXT_MINOR_VERSION"