@@ -5,32 +5,39 @@ STABLE_VERSION=$2
5
5
echo $VERSION
6
6
if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
7
7
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 "
9
9
echo " \tstable: Only build and publish a new version for the stable docker tag if it has been tested and going on the changelog"
10
10
exit
11
11
fi
12
12
13
- if [ $ENABLE_PYPI_BUILD = " pypi-build=enable " ]; then
13
+ if [ $ENABLE_PYPI_BUILD = " pypi-build=prod " ]; then
14
14
echo " Doing production build"
15
15
python -m build --wheel --sdist
16
16
twine upload dist/* $VERSION *
17
- sleep 240
17
+ sleep 120
18
18
docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
19
19
&& docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
20
20
&& docker push socketdev/cli:$VERSION \
21
21
&& 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
27
25
echo " Doing test build"
28
26
python -m build --wheel --sdist
29
27
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
35
33
fi
36
34
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