File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
VERSION=$( grep -o " __version__.*" socketsecurity/__init__.py | awk ' {print $3}' | tr -d " '" )
3
- BYPASS_PYPI_BUILD=$1
3
+ ENABLE_PYPI_BUILD=$1
4
+ STABLE_VERSION=$2
4
5
echo $VERSION
6
+ if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
7
+ echo " $0 pypi-build=enable stable=true"
8
+ echo " \tpypi-build: Build and publish a new version of the package to pypi"
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
+ exit
11
+ fi
5
12
6
- if [ -z $BYPASS_PYPI_BUILD ] || [ $BYPASS_PYPI_BUILD -eq 0 ]; then
13
+ if [ $ENABLE_PYPI_BUILD = " pypi-build=enable " ]; then
7
14
python -m build --wheel --sdist
8
15
twine upload dist/* $VERSION *
9
16
sleep 240
12
19
docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
13
20
&& docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
14
21
&& docker push socketdev/cli:$VERSION \
15
- && docker push socketdev/cli:latest
22
+ && docker push socketdev/cli:latest
23
+
24
+ if [ $STABLE_VERSION = " stable=true" ]; then
25
+ docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:stable . \
26
+ && docker push socketdev/cli:stable
27
+ fi
Original file line number Diff line number Diff line change 1
1
__author__ = 'socket.dev'
2
- __version__ = '1.0.15 '
2
+ __version__ = '1.0.17 '
Original file line number Diff line number Diff line change @@ -532,10 +532,14 @@ def create_new_diff(
532
532
:return:
533
533
"""
534
534
if no_change :
535
- return Diff ()
535
+ diff = Diff ()
536
+ diff .id = "no_diff_id"
537
+ return diff
536
538
files = Core .find_files (path , new_files )
537
539
if files is None or len (files ) == 0 :
538
- return Diff ()
540
+ diff = Diff ()
541
+ diff .id = "no_diff_id"
542
+ return diff
539
543
try :
540
544
head_full_scan_id = Core .get_head_scan_for_repo (params .repo )
541
545
if head_full_scan_id is None or head_full_scan_id == "" :
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def __init__(self):
97
97
98
98
@staticmethod
99
99
def check_event_type () -> str :
100
- if ci_pipeline_source .lower () == "push" or ci_pipeline_source . lower () == 'merge_request_event' :
100
+ if ci_pipeline_source .lower () in [ "web" , 'merge_request_event' , "push" ] :
101
101
if ci_merge_request_iid is None or ci_merge_request_iid == "" or str (ci_merge_request_iid ) == "0" :
102
102
event_type = "main"
103
103
else :
@@ -106,7 +106,7 @@ def check_event_type() -> str:
106
106
event_type = "comment"
107
107
else :
108
108
log .error (f"Unknown event type { ci_pipeline_source } " )
109
- sys .exit (1 )
109
+ sys .exit (0 )
110
110
return event_type
111
111
112
112
@staticmethod
You can’t perform that action at this time.
0 commit comments