Skip to content

Commit

Permalink
Whitesource update to new url (SAP#2422)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDoberer authored Dec 16, 2021
1 parent 8a50d10 commit be6ad2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules
# IDEs
.idea
.angulardoc.json
.vscode/diff
.vscode/settings.json

# Lerna
lerna-debug.log
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 17 additions & 5 deletions scripts/whiteSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit be6ad2a

Please sign in to comment.