forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·85 lines (71 loc) · 2.38 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·85 lines (71 loc) · 2.38 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# a simple help
if [ "$1" == "-h" ]; then
usage="$(basename "$0") [-h] -- program to trigger the deployment of devel/rc and release pkgs
where:
-h show this help text
-d devel build tag in the form X.X.X[dev]/[rc]number, ie: 0.10.0dev1
-p previous tag in the form X.X.X (for releases)
-r proposed new tag in the form X.X.X (for releases)
"
echo "$usage"
exit 0
fi
# option management
while getopts d:p:r: option
do
case "${option}" in
d) dtag=${OPTARG};;
p) ptag=${OPTARG};;
r) rtag=${OPTARG};;
esac
done
# main
if [[ -z "$dtag" && ! -z "$ptag" && ! -z "$rtag" ]]; then
echo "You have triggered the release process"
# create a new branch
git checkout -b release_$rtag
# version number updates
python version_update.py $rtag $ptag
git add ../bokehjs/src/coffee/main.coffee
git add ../bokehjs/package.json
git add ../sphinx/source/conf.py
git commit -m "Updating version to $rtag."
# CHANGELOG generation
python issues.py -p $ptag -r $rtag
ret=$?
if [ $ret -ne 0 ]; then
echo "Exiting because CHANGELOG generation failed."
echo "Check you actually have a ../sphinx/source/docs/releases/<tag>/.rst file."
exit 1
fi
git add ../CHANGELOG
git commit -m "Updating CHANGELOG."
# Merge branch into master and push to origin
git checkout master
git pull origin
git merge --no-ff release_$rtag -m "Merge branch release_$rtag"
git push origin master
git branch -d release_$rtag
git tag -a $rtag -m "Release $rtag".
git push origin $rtag
elif [[ ! -z "$dtag" && -z "$ptag" && -z "$rtag" ]]; then
echo "You have triggered the devel build process"
# check the tag
taglist=`git tag --list --sort=version:refname`
tagarray=($taglist)
lasttag=${tagarray[-1]}
if [[ "$lasttag" == "$dtag" ]]; then
echo "The latest tag detected is $lasttag and you are trying to use the same tag, please bump your dev/rc tag."
exit 1
fi
# tag it locally
git tag -a $dtag -m "New devel[rc] build $dtag."
# and push the tag
git push origin $dtag
echo "The new devel build was triggered."
else
echo "You have to pass a -d tag (dev build) OR -p and -r tags (for releases)."
echo "Run ./deploy.sh -h to get some more help with the args to pass."
exit 0
fi