Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions scripts/build_container.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/bin/sh
VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
BYPASS_PYPI_BUILD=$1
ENABLE_PYPI_BUILD=$1
STABLE_VERSION=$2
echo $VERSION
if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
echo "$0 pypi-build=enable stable=true"
echo "\tpypi-build: Build and publish a new version of the package to pypi"
echo "\tstable: Only build and publish a new version for the stable docker tag if it has been tested and going on the changelog"
exit
fi

if [ -z $BYPASS_PYPI_BUILD ] || [ $BYPASS_PYPI_BUILD -eq 0 ]; then
if [ $ENABLE_PYPI_BUILD = "pypi-build=enable" ]; then
python -m build --wheel --sdist
twine upload dist/*$VERSION*
sleep 240
Expand All @@ -12,4 +19,9 @@ fi
docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
&& docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
&& docker push socketdev/cli:$VERSION \
&& docker push socketdev/cli:latest
&& docker push socketdev/cli:latest

if [ $STABLE_VERSION = "stable=true" ]; then
docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:stable . \
&& docker push socketdev/cli:stable
fi
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'socket.dev'
__version__ = '1.0.15'
__version__ = '1.0.17'
8 changes: 6 additions & 2 deletions socketsecurity/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,14 @@ def create_new_diff(
:return:
"""
if no_change:
return Diff()
diff = Diff()
diff.id = "no_diff_id"
return diff
files = Core.find_files(path, new_files)
if files is None or len(files) == 0:
return Diff()
diff = Diff()
diff.id = "no_diff_id"
return diff
try:
head_full_scan_id = Core.get_head_scan_for_repo(params.repo)
if head_full_scan_id is None or head_full_scan_id == "":
Expand Down
4 changes: 2 additions & 2 deletions socketsecurity/core/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self):

@staticmethod
def check_event_type() -> str:
if ci_pipeline_source.lower() == "push" or ci_pipeline_source.lower() == 'merge_request_event':
if ci_pipeline_source.lower() in ["web", 'merge_request_event', "push"]:
if ci_merge_request_iid is None or ci_merge_request_iid == "" or str(ci_merge_request_iid) == "0":
event_type = "main"
else:
Expand All @@ -106,7 +106,7 @@ def check_event_type() -> str:
event_type = "comment"
else:
log.error(f"Unknown event type {ci_pipeline_source}")
sys.exit(1)
sys.exit(0)
return event_type

@staticmethod
Expand Down