-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·48 lines (40 loc) · 854 Bytes
/
release.sh
File metadata and controls
executable file
·48 lines (40 loc) · 854 Bytes
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
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
# helper function used to promot the user for how they would like to proceed
function checkYN {
while true
do
read -p "$1 (Y/N): " action
case $action in
n|N|no)
return 1
;;
y|Y|yes)
return 0
;;
*)
echo "type Y or N"
;;
esac
done
}
if [[ "$1" == "" ]]
then
echo "Missing version e.g 5 11 2"
echo -e "\nUsage:\n ./release.sh 5 11 2 \n"
exit 1
fi
if ! checkYN "Add new release 'v$1.$2.$3'?"; then
echo exiting
exit 1
fi
echo "Setting version to v$1.$2.$3"
VERSION_CODE="__version__ = 'v$1.$2.$3'"
sed -i'.bak' "s/^__version__.*$/${VERSION_CODE}/" btrdbextras/__init__.py
rm btrdbextras/__init__.py.bak
git add btrdbextras/__init__.py
git commit -m "Release v$1.$2.$3"
git tag v$1.$2.$3
git push origin v$1.$2.$3
sleep 10
git push