Update ENV vars syntax for reports.ci.yml
This commit is contained in:
parent
f98758753a
commit
d0375db249
1 changed files with 46 additions and 8 deletions
|
@ -26,11 +26,31 @@ sast:
|
|||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- | # this is required to avoid undesirable reset of Docker image ENV variables being set on build stage
|
||||
function propagate_env_vars() {
|
||||
CURRENT_ENV=$(printenv)
|
||||
|
||||
for VAR_NAME; do
|
||||
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
|
||||
done
|
||||
}
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
||||
--volume "$PWD:/code"
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
- |
|
||||
docker run \
|
||||
$(propagate_env_vars \
|
||||
SAST_ANALYZER_IMAGES \
|
||||
SAST_ANALYZER_IMAGE_PREFIX \
|
||||
SAST_ANALYZER_IMAGE_TAG \
|
||||
SAST_DEFAULT_ANALYZERS \
|
||||
SAST_BRAKEMAN_LEVEL \
|
||||
SAST_GOSEC_LEVEL \
|
||||
SAST_FLAWFINDER_LEVEL \
|
||||
SAST_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
|
||||
SAST_PULL_ANALYZER_IMAGE_TIMEOUT \
|
||||
SAST_RUN_ANALYZER_TIMEOUT \
|
||||
) \
|
||||
--volume "$PWD:/code" \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
||||
artifacts:
|
||||
reports:
|
||||
|
@ -50,10 +70,28 @@ dependency_scanning:
|
|||
- docker:stable-dind
|
||||
script:
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
|
||||
--volume "$PWD:/code"
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
- | # this is required to avoid undesirable reset of Docker image ENV variables being set on build stage
|
||||
function propagate_env_vars() {
|
||||
CURRENT_ENV=$(printenv)
|
||||
|
||||
for VAR_NAME; do
|
||||
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
|
||||
done
|
||||
}
|
||||
- |
|
||||
docker run \
|
||||
$(propagate_env_vars \
|
||||
DS_ANALYZER_IMAGES \
|
||||
DS_ANALYZER_IMAGE_PREFIX \
|
||||
DS_ANALYZER_IMAGE_TAG \
|
||||
DS_DEFAULT_ANALYZERS \
|
||||
DEP_SCAN_DISABLE_REMOTE_CHECKS \
|
||||
DS_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
|
||||
DS_PULL_ANALYZER_IMAGE_TIMEOUT \
|
||||
DS_RUN_ANALYZER_TIMEOUT \
|
||||
) \
|
||||
--volume "$PWD:/code" \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
|
||||
artifacts:
|
||||
reports:
|
||||
|
|
Loading…
Reference in a new issue