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_image=1
2327release=0
2428
@@ -40,25 +44,25 @@ while [ $# -ne 0 ]; do
4044done
4145
4246black --line-length=150 .
43- rm -rf build dist
44- python3 setup_migration.py bdist_wheel
47+ rm -rf $ROOTDIR / build $ROOTDIR / dist
48+ python3 $ROOTDIR / setup_migration.py bdist_wheel
4549
4650# Deploy locally for tests
47- pip install --upgrade --force-reinstall dist/sonar_migration-* -py3-* .whl
51+ pip install --upgrade --force-reinstall $ROOTDIR / dist/sonar_migration-* -py3-* .whl
4852
4953if [ " $build_image " == " 1" ]; then
50- docker build -t olivierkorach/sonar-migration:latest -f migration/snapshot.Dockerfile . --load
54+ docker build -t olivierkorach/sonar-migration:latest -f migration/snapshot.Dockerfile $ROOTDIR --load
5155fi
5256
5357# Deploy on pypi.org once released
5458if [ " $release " = " 1" ]; then
5559 echo " Confirm release [y/n] ?"
5660 read -r confirm
5761 if [ " $confirm " = " y" ]; then
58- python3 -m twine upload dist/sonar_migration-* -py3-* .whl
62+ python3 -m twine upload $ROOTDIR / dist/sonar_migration-* -py3-* .whl
5963 fi
6064fi
6165
6266if [ " $release_docker " = " 1" ]; then
63- docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.3 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile .
67+ docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.3 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile $ROOTDIR
6468fi
0 commit comments