update snyk to use org for builds

Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
Vishwas Shashidhar 2020-04-01 19:47:52 +05:30
parent 5e5e5414b9
commit 7dd257ca39
4 changed files with 14 additions and 10 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
NODE_REQUIRED_VERSION=v12.13.1
SNYK_API_TOKEN=885953dc-9469-443c-984d-524352d54116
SNYK_ORG=sda
if ! [ -x "$(command -v git)" ]; then
echo 'GIT does not exist! Please set it up before running this script!' >&2
@ -42,7 +42,8 @@ fi
if ! [ -x "$(command -v snyk)" ]; then
echo 'Snyk does not exist! Installing and setting it up' >&2
npm install -g snyk
snyk config set api=$SNYK_API_TOKEN
snyk config set org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
fi
if [ -z "$PARENT_BUILD_VERSION" ]; then
@ -67,7 +68,7 @@ npm install
# Run Snyk Security Tests
echo "Running snyk security tests"
snyk test --file=package.json
snyk test --file=package-lock.json --org="$SNYK_ORG"
# replace url in config
echo "Setting default pod url to https://corporate.symphony.com"

View File

@ -1,7 +1,7 @@
#!/bin/bash
NODE_REQUIRED_VERSION=v12.13.1
SNYK_API_TOKEN=885953dc-9469-443c-984d-524352d54116
SNYK_ORG=sda
# Check basic dependencies
if ! [ -x "$(command -v git)" ]; then
@ -43,7 +43,8 @@ fi
if ! [ -x "$(command -v snyk)" ]; then
echo 'Snyk does not exist! Installing and setting it up' >&2
npm install -g snyk
snyk config set api=$SNYK_API_TOKEN
snyk config set org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
fi
if ! [ -x "$(command -v /usr/local/bin/packagesbuild)" ]; then
@ -81,7 +82,7 @@ npm install
# Run Snyk Security Tests
echo "Running snyk security tests"
snyk test --file=package.json
snyk test --file=package-lock.json --org="$SNYK_ORG"
# Replace url in config
echo "Setting default pod url to https://corporate.symphony.com"

View File

@ -6,7 +6,7 @@ echo %PATH%
set DISABLE_REBUILD=true
set NODE_REQUIRED_VERSION=12.13.1
set SNYK_API_TOKEN=885953dc-9469-443c-984d-524352d54116
set SNYK_ORG=sda
set PATH=%PATH%;C:\Program Files\nodejs\;C:\Program Files\Git\cmd
echo %PATH%
@ -39,6 +39,7 @@ WHERE snyk
if %ERRORLEVEL% NEQ 0 (
echo "Snyk does not exist! Installing and setting it up"
call npm i snyk -g
call snyk config set org=%$SNYK_ORG%
call snyk config set api=%SNYK_API_TOKEN%
)
@ -54,7 +55,7 @@ call npm install
# Run Snyk Security Tests
echo "Running snyk security tests"
call snyk test --file=package.json
call snyk test --file=package-lock.json --org=%SNYK_ORG%
:: Set expiry if required
IF "%EXPIRY_PERIOD%"=="" (

View File

@ -6,7 +6,7 @@ echo %PATH%
set DISABLE_REBUILD=true
set NODE_REQUIRED_VERSION=12.13.1
set SNYK_API_TOKEN=885953dc-9469-443c-984d-524352d54116
set SNYK_ORG=sda
set PATH=%PATH%;C:\Program Files\nodejs\;C:\Program Files\Git\cmd
echo %PATH%
@ -27,6 +27,7 @@ WHERE snyk
if %ERRORLEVEL% NEQ 0 (
echo "Snyk does not exist! Installing and setting it up"
call npm i snyk -g
call snyk config set org=%$SNYK_ORG%
call snyk config set api=%SNYK_API_TOKEN%
)
@ -42,7 +43,7 @@ call npm install
# Run Snyk Security Tests
echo "Running snyk security tests"
call snyk test --file=package.json
call snyk test --file=package-lock.json --org=%SNYK_ORG%
:: Set expiry if required
IF "%EXPIRY_PERIOD%"=="" (