Skip to content

Commit 9ad9b08

Browse files
committed
Build everything from repo root
1 parent b23e5ce commit 9ad9b08

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

migration/deploy.sh

Lines changed: 10 additions & 6 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_image=1
2327
release=0
2428

@@ -40,25 +44,25 @@ while [ $# -ne 0 ]; do
4044
done
4145

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

4953
if [ "$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
5155
fi
5256

5357
# Deploy on pypi.org once released
5458
if [ "$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
6064
fi
6165

6266
if [ "$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
6468
fi

0 commit comments

Comments
 (0)