Skip to content

Commit b23e5ce

Browse files
committed
Run everything all relative to repo root
1 parent 60f8079 commit b23e5ce

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

conf/deploy.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
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+
2226
build_docs=1
2327
build_image=1
2428
release=0
@@ -44,30 +48,30 @@ while [ $# -ne 0 ]; do
4448
done
4549

4650
black --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

5357
if [ "$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
5559
fi
5660

5761
if [ "$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
6064
fi
6165

6266
# Deploy on pypi.org once released
6367
if [ "$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
6973
fi
7074

7175
if [ "$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 .
7377
fi

0 commit comments

Comments
 (0)