Skip to content

Commit 418054e

Browse files
authored
Fix-docker-overviews (#1409)
* Fixes #1408 * Fixes #1407 * Fix next release number * Collect version on the fly in docker build cmd * Fix release dockerfile * Use dynamic version for pypi release * Fix docker builds
1 parent a81eca2 commit 418054e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

conf/deploy.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ python3 $ROOTDIR/setup.py bdist_wheel
5454
# Deploy locally for tests
5555
pip install --upgrade --force-reinstall $ROOTDIR/dist/sonar_tools-*-py3-*.whl
5656

57+
version=$(grep PACKAGE_VERSION $ROOTDIR/sonar/version.py | cut -d "=" -f 2 | sed -e "s/[\'\" ]//g" -e "s/^ +//" -e "s/ +$//")
58+
5759
if [ "$build_image" == "1" ]; then
58-
docker build -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f $CONFDIR/snapshot.Dockerfile $ROOTDIR --load
60+
docker build -t olivierkorach/sonar-tools:$version -t olivierkorach/sonar-tools:latest -f $CONFDIR/snapshot.Dockerfile $ROOTDIR --load
5961
fi
6062

6163
if [ "$build_docs" == "1" ]; then
@@ -68,10 +70,11 @@ if [ "$release" = "1" ]; then
6870
echo "Confirm release [y/n] ?"
6971
read -r confirm
7072
if [ "$confirm" = "y" ]; then
71-
python3 -m twine upload $ROOTDIR/dist/sonar_tools-*-py3-*.whl
73+
python3 -m twine upload $ROOTDIR/dist/sonar_tools-$version-py3-none-any.whl
7274
fi
7375
fi
7476

7577
if [ "$release_docker" = "1" ]; then
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 .
78+
docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-tools:$version -t olivierkorach/sonar-tools:latest -f $CONFDIR/release.Dockerfile $ROOTDIR
79+
cd $ROOTDIR && docker pushrm olivierkorach/sonar-tools
7780
fi

conf/release.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COPY ./LICENSE .
3131
COPY ./sonar/audit sonar/audit
3232

3333
RUN pip install --upgrade pip \
34-
&& pip install sonar-tools==3.4
34+
&& pip install sonar-tools==3.5
3535

3636
USER ${USERNAME}
3737
WORKDIR /home/${USERNAME}

migration/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ fi
6565

6666
if [ "$release_docker" = "1" ]; then
6767
docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.4 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile $ROOTDIR
68+
cd $CONFDIR && docker pushrm olivierkorach/sonar-migration
6869
fi

0 commit comments

Comments
 (0)