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 20:05:15 +05:30
parent 7dd257ca39
commit ecef6e69db
4 changed files with 12 additions and 8 deletions

View File

@ -42,9 +42,10 @@ 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 org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
fi
echo "Setting snyk org to $SNYK_ORG and api token to $SNYK_API_TOKEN"
snyk config set org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
if [ -z "$PARENT_BUILD_VERSION" ]; then
echo "PARENT_BUILD_VERSION is empty, setting default"

View File

@ -43,9 +43,10 @@ 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 org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
fi
echo "Setting snyk org to $SNYK_ORG and api token to $SNYK_API_TOKEN"
snyk config set org="$SNYK_ORG"
snyk config set api="$SNYK_API_TOKEN"
if ! [ -x "$(command -v /usr/local/bin/packagesbuild)" ]; then
echo 'Packages build does not exist! Please set it up before running this script!' >&2

View File

@ -39,9 +39,10 @@ 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%
)
echo "Setting snyk org to %SNYK_ORG% and api token to %SNYK_API_TOKEN%"
call snyk config set org=%SNYK_ORG%
call snyk config set api=%SNYK_API_TOKEN%
:: Below command replaces buildVersion with the appropriate build number from jenkins
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\":\"%PARENT_BUILD_VERSION%\"/g" package.json

View File

@ -27,9 +27,10 @@ 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%
)
echo "Setting snyk org to %SNYK_ORG% and api token to %SNYK_API_TOKEN%"
call snyk config set org=%SNYK_ORG%
call snyk config set api=%SNYK_API_TOKEN%
:: Below command replaces buildVersion with the appropriate build number from jenkins
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\":\"%PARENT_BUILD_VERSION%\"/g" package.json