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
152151Mirror 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
170170Publish 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
0 commit comments