-
Notifications
You must be signed in to change notification settings - Fork 19
/
release.sh
executable file
·53 lines (43 loc) · 1.68 KB
/
release.sh
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
#!/bin/bash
function err {
echo "ERROR: $*";
exit 1;
}
function confirm {
# thank you, http://stackoverflow.com/a/3232082
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
source bin/activate || err "couldnt activate virtualenv";
VERSION=$(cat src/jottalib/__init__.py | cut -b14- | sed s/\'//) || err "couldnt get version";
echo "RUNNING TESTS FOR RELEASE v$VERSION"
echo "=======================";
PYTHONPATH=src py.test tests/ || err "Tests failed";
tests/fusetest.sh || err "FUSE tests failed";
tests/clitest.sh || err "CLI tests failed";
confirm "Continue with release of v$VERSION?" || exit 0;
echo "RELEASE JOTTALIB AND JOTTACLOUDCLIENT VERSION $VERSION:"
echo "=======================";
printf "Uploading cheese to pypi";
printf "... jottalib ";
python setup.py sdist bdist_wheel upload || err "jottalib setup.py upload failed";
echo "=======================";
echo "Creating git tag $VERSION and pushing it to git server";
git tag -a "v$VERSION" -m "Version $VERSION release" || err "couldnt tag git tree";
git push --tags || err "problems pushing tags to central repository";
echo "=======================";
echo "Creating docs with pdoc";
(cd src; pdoc --overwrite --html-dir ../dist/docs/"$VERSION"/ --html jottalib;) || err "pdoc generating docs failed";
echo "=======================";
echo "Uploading docs to pypi";
python setup.py upload_docs --upload-dir dist/docs/"$VERSION"/jottalib || err "couldnt upload docs to pypi";
echo "=======================";
echo "Enjoy your fresh $VERSION release!"