Skip to content

Commit 55d4e62

Browse files
committed
PATCH: minor fixes for builds
1 parent 431c974 commit 55d4e62

2 files changed

Lines changed: 32 additions & 23 deletions

File tree

.gitlab-ci.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
############################# Helper Anchors ##################################
22

3-
3+
.use_github_repo: &use_github_repo |
44
eval $(ssh-agent -s)
55
ssh-add ~/.ssh/${GITHUB_HOST}
66

@@ -71,8 +71,8 @@ SCA Test: # run SCA on any branch
7171
tags:
7272
- python
7373

74-
script:
75-
- curl -sSL https://download.sourceclear.com/ci.sh | bash
74+
script:
75+
- curl -sSL https://download.sourceclear.com/ci.sh | bash
7676
# | tee sca_results.txt
7777
#
7878
# artifacts:
@@ -89,14 +89,14 @@ SAST Sandbox Test: # this only runs on the dev branch, so run a Sandbox scan
8989
tags:
9090
- python
9191

92-
script:
93-
- zip project.zip
92+
script:
93+
- zip project.zip
9494
setup.* LICENCE.txt -r $(echo ${CI_PROJECT_NAME} | cut -d'-' -f1)
9595
- pip3 install veracode-python
9696

9797
- veracode-cli scan
9898
--app="${CI_PROJECT_NAME}"
99-
--name="$(date) - ${CI_COMMIT_SHORT_SHA}"
99+
--name="$(date) - ${CI_COMMIT_SHORT_SHA}"
100100
--sandbox='Development Build'
101101
--files='project.zip'
102102
--timeout=30
@@ -112,15 +112,14 @@ SAST Policy Test: # this is on master so run a SAST policy scan
112112
tags:
113113
- python
114114

115-
script:
116-
- zip project.zip
115+
script:
116+
- zip project.zip
117117
setup.* LICENCE.txt -r $(echo ${CI_PROJECT_NAME} | cut -d'-' -f1)
118-
# - pip3 install veracode-python
119-
- pip3 install -e .
118+
- pip3 install veracode-python
120119

121120
- veracode-cli scan
122121
--app="${CI_PROJECT_NAME}"
123-
--name="$(date) - ${CI_COMMIT_SHORT_SHA}"
122+
--name="$(date) - ${CI_COMMIT_SHORT_SHA}"
124123
--files='project.zip'
125124
--timeout=30
126125

@@ -133,7 +132,7 @@ Create Release: # increment version and create release tag
133132
- python
134133

135134
script:
136-
- *use_gitlab_repo
135+
- *use_gitlab_repo
137136
- git pull origin master
138137
- git checkout master
139138
- export RELEASE=$(git log -1 --pretty='format:%B' | cut -d':' -f1)
@@ -146,15 +145,16 @@ Create Release: # increment version and create release tag
146145
- git tag -a v${VERSION} -m "Release ${VERSION}"
147146
- git push origin v${VERSION}
148147
149-
only:
150-
- master
148+
only:
149+
- master
151150
152151
Mirror to Github: # mirror Github and use API to create release
153152
stage: publish
154153
tags:
155154
- python
156155
157156
script:
157+
- *use_gitlab_repo
158158
- git pull origin master
159159
- git checkout master
160160
- echo 'Packaging version: ' $(python3 setup.py -d version)
@@ -164,15 +164,16 @@ Mirror to Github: # mirror Github and use API to create release
164164
- pip3 install requests # needed for github release
165165
- python3 setup.py github --create-release ${GITHUB_API_TOKEN}
166166

167-
only:
168-
- master
167+
only:
168+
- master
169169

170170
Publish to PyPi: # publish on PyPi
171171
stage: publish
172-
tags:
172+
tags:
173173
- python
174174

175175
script:
176+
- *use_gitlab_repo
176177
- git pull origin master
177178
- git checkout master
178179

@@ -181,6 +182,6 @@ Publish to PyPi: # publish on PyPi
181182
- python3 setup.py sdist
182183
- twine upload -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD} dist/*
183184

184-
only:
185-
- master
185+
only:
186+
- master
186187

veracode/build.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ def __init__(self, obj=None, app=None):
6666
self.analysis = Analysis(info.build)
6767
self.policy = Policy(info.build)
6868

69+
@property
70+
def name(self):
71+
return self.version
72+
73+
@name.setter
74+
def name(self, name):
75+
self.version = name
76+
6977
def upload(self, files, compress=False):
7078
if isinstance(files, list):
7179
self._modules = [os.path.expanduser(f) for f in files]
@@ -128,11 +136,11 @@ def __init__(self, obj=None):
128136
self._properties = [
129137
'analysis_type',
130138
'engine_version',
131-
'publish_date',
139+
'published_date',
132140
'status'
133141
]
134142
self._renamed_properties = [
135-
'type', 'engine_version','publish_date','status']
143+
'type', 'engine_version','published_date','status']
136144
self._update_properties()
137145

138146
if hasattr(obj, 'analysis_unit'):
@@ -154,7 +162,7 @@ def __init__(self, obj=None):
154162
'policy_version'
155163
]
156164
self._renamed_properties = [
157-
'compliance', 'name', 'updated', 'version']
165+
'compliance', 'name', 'updated_date', 'version']
158166
self._update_properties(obj)
159167

160168
def __repr__(self):
@@ -196,7 +204,7 @@ def __repr__(self):
196204
self.sandbox_name = None
197205
return ("<Veracode Report: application='{}', sandbox='{}',"
198206
"build='{}', flaws={}>".format(
199-
self._app_name, self.sandbox_name,
207+
self.app_name, self.sandbox_name,
200208
self._build.version, self.total_flaws))
201209

202210
class Flaw(Properties):

0 commit comments

Comments
 (0)