1919# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2020#
2121
22+ ME=" $( basename " ${BASH_SOURCE[0]} " ) "
23+ ROOTDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && cd .. && pwd ) "
24+ CONFDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
25+
2226build_docs=1
2327build_image=1
2428release=0
@@ -44,30 +48,30 @@ while [ $# -ne 0 ]; do
4448done
4549
4650black --line-length=150 .
47- rm -rf build dist
48- python3 setup.py bdist_wheel
51+ rm -rf $ROOTDIR / build $ROOTDIR / dist
52+ python3 $ROOTDIR / setup.py bdist_wheel
4953
5054# Deploy locally for tests
51- pip install --upgrade --force-reinstall dist/sonar_tools-* -py3-* .whl
55+ pip install --upgrade --force-reinstall $ROOTDIR / dist/sonar_tools-* -py3-* .whl
5256
5357if [ " $build_image " == " 1" ]; then
54- docker build -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f snapshot.Dockerfile . --load
58+ docker build -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f $CONFDIR / snapshot.Dockerfile $ROOTDIR --load
5559fi
5660
5761if [ " $build_docs " == " 1" ]; then
58- rm -rf api- doc/build
59- sphinx-build -b html api- doc/source api- doc/build
62+ rm -rf doc/api /build
63+ sphinx-build -b html doc/api/ source doc/api /build
6064fi
6165
6266# Deploy on pypi.org once released
6367if [ " $release " = " 1" ]; then
6468 echo " Confirm release [y/n] ?"
6569 read -r confirm
6670 if [ " $confirm " = " y" ]; then
67- python3 -m twine upload dist/sonar_tools-* -py3-* .whl
71+ python3 -m twine upload $ROOTDIR / dist/sonar_tools-* -py3-* .whl
6872 fi
6973fi
7074
7175if [ " $release_docker " = " 1" ]; then
72- docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f release.Dockerfile .
76+ docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f $ROOTDIR / release.Dockerfile .
7377fi
0 commit comments