Skip to content

Commit 2a03316

Browse files
authored
Added support for CycloneDX and SPDX manifest files to the CLI. Also improved build script (#28)
1 parent 32ebbb6 commit 2a03316

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

scripts/build_container.sh

+20-13
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,39 @@ STABLE_VERSION=$2
55
echo $VERSION
66
if [ -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
1111
fi
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
3533
fi
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+

socketsecurity/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '1.0.31'
2+
__version__ = '1.0.32'

socketsecurity/core/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@
5050
log.addHandler(logging.NullHandler())
5151

5252
socket_globs = {
53+
"spdx": {
54+
"spdx.json": {
55+
"pattern": "*[-.]spdx.json"
56+
}
57+
},
58+
"cdx": {
59+
"cyclonedx.json": {
60+
"pattern": "{bom,*[-.]c{yclone,}dx}.json"
61+
},
62+
"xml": {
63+
"pattern": "{bom,*[-.]c{yclone,}dx}.xml"
64+
}
65+
},
5366
"npm": {
5467
"package.json": {
5568
"pattern": "package.json"

0 commit comments

Comments
 (0)