Mercurial > kallithea
comparison scripts/make-release @ 7191:dba4e770d4b6
make-release: cleanup and fix bitrot
Try to make the build process more stable and maintainable.
So far, this leaves a problem with node_modules/bootstrap/ and
kallithea/public/css/style.css missing from the release .tar.gz .
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 06 Mar 2018 01:27:15 +0100 |
parents | 87496864d4c6 |
children | b3289fef0daa |
comparison
equal
deleted
inserted
replaced
7190:710b2eb8cc37 | 7191:dba4e770d4b6 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 set -e | 2 set -e |
3 set -x | 3 set -x |
4 | 4 |
5 echo "Checking tools needed for uploading stuff" | 5 echo "Install/verify tools needed for building and uploading stuff" |
6 pip freeze | grep '^Sphinx==' || pip install Sphinx | 6 pip install --upgrade -e . |
7 pip freeze | grep '^Sphinx-PyPI-upload==' || pip install Sphinx-PyPI-upload | 7 pip install --upgrade -r dev_requirements.txt Sphinx Sphinx-PyPI-upload |
8 | 8 |
9 echo "Verifying everything can build" | 9 echo "Cleanup and update copyrights ... and clean checkout" |
10 hg purge --all dist | 10 scripts/run-all-cleanup |
11 python2 setup.py build_sphinx | 11 scripts/update-copyrights.py |
12 python2 setup.py compile_catalog # TODO: check for errors | 12 hg up -cr . |
13 | |
14 echo "Make release build from clean checkout in build/" | |
15 rm -rf build dist | |
16 hg archive build | |
17 cd build | |
18 | |
19 echo "Check MANIFEST.in" | |
20 sed -e 's/[^ ]*[ ]*\([^ ]*\).*/\1/g' MANIFEST.in | grep -v '^node_modules/bootstrap\|^kallithea/public/css/style.css' | xargs ls -lad | |
21 | |
22 echo "Build dist" | |
23 python2 setup.py compile_catalog | |
13 python2 setup.py sdist | 24 python2 setup.py sdist |
14 | 25 |
15 echo "Verifying VERSION from kallithea/__init__.py" | 26 echo "Verify VERSION from kallithea/__init__.py" |
16 namerel=$(cd dist && echo Kallithea-*.tar.gz) | 27 namerel=$(cd dist && echo Kallithea-*.tar.gz) |
17 namerel=${namerel%.tar.gz} | 28 namerel=${namerel%.tar.gz} |
18 version=${namerel#Kallithea-} | 29 version=${namerel#Kallithea-} |
30 ls -l $(pwd)/dist/$namerel.tar.gz | |
19 echo "Releasing Kallithea $version in directory $namerel" | 31 echo "Releasing Kallithea $version in directory $namerel" |
20 echo "Verifying current revision is tagged for $version" | 32 |
33 echo "Verify dist file content" | |
34 diff -u <((hg mani | grep -v '^\.hg') | LANG=C sort) <(tar tf dist/Kallithea-$version.tar.gz | sed "s|^$namerel/||" | grep . | grep -v '^kallithea/i18n/.*/LC_MESSAGES/kallithea.mo$\|^Kallithea.egg-info/\|^PKG-INFO$\|/$' | LANG=C sort) | |
35 ! tar tf dist/Kallithea-$version.tar.gz | grep "$namerel/node_modules/bootstrap/\$" | |
36 | |
37 echo "Verify docs build" | |
38 python2 setup.py build_sphinx # not used yet ... but we want to make sure it builds | |
39 | |
40 cat - << EOT | |
41 | |
42 Now, make sure | |
43 * the copyright and contributor lists have been updated | |
44 * all tests are passing | |
45 * release note is ready | |
46 * announcement is ready | |
47 * source has been pushed to https://kallithea-scm.org/repos/kallithea | |
48 | |
49 EOT | |
50 | |
51 echo "Verify current revision is tagged for $version" | |
21 hg log -r "'$version'&." | grep . | 52 hg log -r "'$version'&." | grep . |
22 | |
23 echo "Cleaning before making release build" | |
24 hg up -c . | |
25 hg revert -a -r null | |
26 hg up -C "'$version'&." | |
27 hg purge --all | |
28 | |
29 echo "Building dist file" | |
30 python2 setup.py compile_catalog | |
31 python2 setup.py sdist | |
32 | |
33 echo "Verifying dist file content" | |
34 diff -u <(hg mani | grep -v '^\.hg' | LANG=C sort) <(tar tf dist/Kallithea-*.tar.gz | sed "s|^$namerel/||" | grep . | grep -v '^kallithea/i18n/.*/LC_MESSAGES/kallithea.mo$\|^Kallithea.egg-info/\|^PKG-INFO$\|/$' | LANG=C sort) | |
35 | |
36 echo "Now, make sure" | |
37 echo "* the copyright and contributor lists have been updated" | |
38 echo "* all tests are passing" | |
39 echo "* release note is ready" | |
40 echo "* announcement is ready" | |
41 echo "* source has been pushed to https://kallithea-scm.org/repos/kallithea" | |
42 echo | |
43 | 53 |
44 echo -n "Enter \"pypi\" to upload Kallithea $version to pypi: " | 54 echo -n "Enter \"pypi\" to upload Kallithea $version to pypi: " |
45 read answer | 55 read answer |
46 [ "$answer" = "pypi" ] | 56 [ "$answer" = "pypi" ] |
47 extraargs=${EMAIL:+--identity=$EMAIL} | |
48 python2 setup.py sdist upload --sign $extraargs | |
49 xdg-open https://pypi.python.org/pypi/Kallithea | |
50 | 57 |
51 echo "Uploading docs to pypi" | 58 echo "Upload docs to pypi" |
52 # See https://wiki.python.org/moin/PyPiDocumentationHosting | 59 # See https://wiki.python.org/moin/PyPiDocumentationHosting |
53 python2 setup.py build_sphinx upload_sphinx | 60 python2 setup.py build_sphinx upload_sphinx |
54 xdg-open https://pythonhosted.org/Kallithea/ | 61 xdg-open https://pythonhosted.org/Kallithea/ |
55 xdg-open http://packages.python.org/Kallithea/installation.html | 62 xdg-open http://packages.python.org/Kallithea/installation.html |
56 | 63 |
57 echo "Rebuilding readthedocs for docs.kallithea-scm.org" | 64 echo "Rebuild readthedocs for docs.kallithea-scm.org" |
58 xdg-open https://readthedocs.org/projects/kallithea/ | 65 xdg-open https://readthedocs.org/projects/kallithea/ |
59 curl -X POST http://readthedocs.org/build/kallithea | 66 curl -X POST http://readthedocs.org/build/kallithea |
60 xdg-open https://readthedocs.org/builds/kallithea/ | 67 xdg-open https://readthedocs.org/builds/kallithea/ |
61 xdg-open http://docs.kallithea-scm.org/en/latest/ # or whatever the branch is | 68 xdg-open http://docs.kallithea-scm.org/en/latest/ # or whatever the branch is |
69 | |
70 extraargs=${EMAIL:+--identity=$EMAIL} | |
71 python2 setup.py sdist upload --sign $extraargs | |
72 xdg-open https://pypi.python.org/pypi/Kallithea |