@@ -5,32 +5,39 @@ STABLE_VERSION=$2
55echo $VERSION
66if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
77 echo " $0 pypi-build=enable stable=true"
8- echo " \tpypi-build: Build and publish a new version of the package to pypi"
8+ echo " \tpypi-build: Build and publish a new version of the package to pypi. Options are prod or test "
99 echo " \tstable: Only build and publish a new version for the stable docker tag if it has been tested and going on the changelog"
1010 exit
1111fi
1212
13- if [ $ENABLE_PYPI_BUILD = " pypi-build=enable " ]; then
13+ if [ $ENABLE_PYPI_BUILD = " pypi-build=prod " ]; then
1414 echo " Doing production build"
1515 python -m build --wheel --sdist
1616 twine upload dist/* $VERSION *
17- sleep 240
17+ sleep 120
1818 docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
1919 && docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
2020 && docker push socketdev/cli:$VERSION \
2121 && docker push socketdev/cli:latest
22- if [ $STABLE_VERSION = " stable=true" ]; then
23- docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:stable . \
24- && docker push socketdev/cli:stable
25- fi
26- else
22+ fi
23+
24+ if [ $ENABLE_PYPI_BUILD = " pypi-build=test" ]; then
2725 echo " Doing test build"
2826 python -m build --wheel --sdist
2927 twine upload --repository testpypi dist/* $VERSION *
30- # sleep 240
31- # docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
32- # && docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
33- # && docker push socketdev/cli:$VERSION-test \
34- # && docker push socketdev/cli:test
28+ sleep 120
29+ docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
30+ && docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
31+ && docker push socketdev/cli:$VERSION -test \
32+ && docker push socketdev/cli:test
3533fi
3634
35+
36+ if [ $STABLE_VERSION = " stable=true" ]; then
37+ if [ $ENABLE_PYPI_BUILD = " pypi-build=enable" ]; then
38+ sleep 120
39+ fi
40+ docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:stable . \
41+ && docker push socketdev/cli:stable
42+ fi
43+
0 commit comments