From be6ad2a9064a22ab620d861c18c271bb89c4f12a Mon Sep 17 00:00:00 2001 From: JohannesDoberer Date: Thu, 16 Dec 2021 13:45:05 +0100 Subject: [PATCH] Whitesource update to new url (#2422) --- .gitignore | 2 ++ .travis.yml | 2 +- scripts/whiteSource.sh | 22 +++++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 76ae4a4049..ce1906d998 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ node_modules # IDEs .idea .angulardoc.json +.vscode/diff +.vscode/settings.json # Lerna lerna-debug.log diff --git a/.travis.yml b/.travis.yml index 9a1db32fea..30f979cd72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ cache: - $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular - $TRAVIS_BUILD_DIR/client-frameworks-support/testing-utilities/dist - $HOME/.cache/Cypress + - $HOME/.cache/whitesource notifications: slack: secure: nls0RW4RKEHLnRBgOi25UTpjjSBFGnXgOnbxuiPsSjBFWehXvH8SfMYGfsDdp6lfH9ljDFA6KiJFauAAgQ+vImaZNHvrHeCitQDqWraXeD1CyzOYGp+8Bx/JyR1bcBKewvQVqNpnhk4hoIEI4Gu2i1NGq1/pAkHOeetw7PVmnpEG/QyQQ8YDXbySzWl39iZc8HWVT4svKV8BqYx+KzqRqE09XSfhiecZ00DVjZEMyKD6oCttOlJ/Vo0Z7QgzAEDaIhb+jrojJ2HD1PPWjiQqfpuyBY6GjeFGwNebevhmVngvQ3+69xn0ydOct3HTR/uSNJexY/Hq9W98QuGliihWwx1ksjFZnKtZ42FRY9p8jD/hw+ySJRwrAvbZtrWA0xmU85Fz/kRMocum5I7UJDGOTvklNYMFT/Rlh5w08DWXx8YCYyvXxsTee7dNELwefYnOL/FZRzHaNKnXqimYsE8dIlbfMBKD2Kh4Hr0+NZlBBaZ71w2+4Cp1mdJnSEFN7zuOrwqdQdjCDAeqttcSOvuQAR/BMGwtN30BrjW16n2YOuqwBoWsp7zUdpSyWp600mTn+vYulue4hvpwpbfELVXRtaggrVvolW9fBtACXE6+G9rqzJRgRLLNGM9i7dbiX2OFx1olMTu0n7XN7MNFdwFH4X0sycfi02GlZb/5L/ntrJY= @@ -134,7 +135,6 @@ jobs: npm --prefix ./core ci ./core; npm --prefix ./website/landingpage/dev install ./website/landingpage/dev; npm --prefix ./website/fiddle install ./website/fiddle; - npm i -g whitesource; bash ./scripts/whiteSource.sh; fi' before_cache: diff --git a/scripts/whiteSource.sh b/scripts/whiteSource.sh index 5317d4ae4d..38a2b2dc36 100755 --- a/scripts/whiteSource.sh +++ b/scripts/whiteSource.sh @@ -20,13 +20,25 @@ declare -a PROJECT_TOKENS=("a63fd5aaaa2343199327aac6d3e2b5346e930927d66441bf9211 "56eb623145264763a82330025e4f11efd538074a3cd04791ab6ab87293174aca" ) -for ((i=0;i<${#FOLDERS[@]};++i)); do - cd $BASE_DIR/../${FOLDERS[i]} - - echo $(printf '{"apiKey": "%s","userKey": "%s","productName": "%s", "projectToken": "%s", "devDep": "false","forceUpdate": true,"checkPolicies": true}' "$WHITESOURCE_APIKEY" "$WHITESOURCE_USER_TOKEN" "$WHITESOURCE_PRODUCT_TOKEN" "${PROJECT_TOKENS[i]}" ) > $BASE_DIR/../${FOLDERS[i]}/whitesource.config.json - whitesource run +if [ -f "$CACHED_WHITESOURCE_UA" ]; then + echo "$CACHED_WHITESOURCE_UA exists. Take from Cache." +else + # download jar file to /home/.cache/whitesource + cd $BASE_DIR/../../../../.cache/whitesource + CACHED_WHITESOURCE_UA=$BASE_DIR/../../../../.cache/whitesource/wss-unified-agent.jar + echo "$CACHED_WHITESOURCE_UA does not exist." + echo "Start download.." + curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar + echo "Downloaded" +fi +for ((i=0;i<${#FOLDERS[@]};++i)); do + cd $BASE_DIR/../${FOLDERS[i]} + echo "Create config File:" + echo $'apiKey='${WHITESOURCE_APIKEY}$'\nuserKey='$WHITESOURCE_USER_TOKEN$'\nproductName='$WHITESOURCE_PRODUCT_TOKEN$'\nprojectToken='${PROJECT_TOKENS[i]}$'\ndevDep=false\nforceUpdate=true\ncheckPolicies=true\nwss.url=https://sap.whitesourcesoftware.com/agent' > wss-generated-file.config + java -jar $BASE_DIR/../../../../.cache/whitesource/wss-unified-agent.jar -c wss-generated-file.config -d . -scanComment "$(date)" + RV=$? echo "Exit code: $RV"