Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions CI-CD/AzureDevOps/azure-pipelines_maven_cached_ua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'whitesource-cached-ua-azdo-maven'

trigger:
- master

pool:
vmImage: 'ubuntu-latest'

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean install'
mavenOptions: -DskipTests=true
publishJUnitResults: false
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false

- script: |
Comment thread
This conversation was marked as resolved.
echo "Checking for the newer versions for WhiteSource Unified Agent"
res="$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/whitesource/unified-agent-distribution/releases")"
latestRelease="$(echo "$res" | jq -s '.[] | sort_by(.published_at) | last')"
latestVer="$(echo "$latestRelease" | jq -rs '.[] | .tag_name')"
latestVerDate="$(date -d "$(echo "$latestRelease" | jq -rs '.[] | .published_at')" +%s)"
if [ -f "${CI_PROJECT_DIR}/wss-unified-agent.jar" ] ; then
curVerDate="$(stat -c %Y "${CI_PROJECT_DIR}/wss-unified-agent.jar" 2>/dev/null)"
else
curVerDate=0
fi
if [ $latestVerDate -gt $curVerDate ] ; then
echo "Downloading WhiteSource Unified Agent latest version ($latestVer)"
curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
else
echo "Already using the latest version of the WhiteSource Unified Agent"
fi
if [[ "$(curl -sL https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar.sha256)" != "$(sha256sum wss-unified-agent.jar)" ]] ; then
echo "Integrity Check Failed"
else
echo "Integrity Check Passed"
echo "WhiteSource Scan"
java -jar ./wss-unified-agent.jar
env:
WS_APIKEY: $(APIKEY)
WS_USERKEY: $(USERKEY)
WS_WSS_URL: https://saas.whitesourcesoftware.com/agent
WS_PRODUCTNAME: AZDO_$(System.TeamProject)
WS_PROJECTNAME: $(Build.Repository.Name)_$(Build.SourceBranchName)
displayName: 'WhiteSource Scan'
5 changes: 4 additions & 1 deletion CI-CD/GitLab/gitlab-maven-cached-ua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ ws_scan:
else
echo "Already using the latest version of the WhiteSource Unified Agent"
fi

if [[ "$(curl -sL https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar.sha256)" != "$(sha256sum wss-unified-agent.jar)" ]] ; then
echo "Integrity Check Failed"
else
echo "Integrity Check Passed"
echo "WhiteSource Scan"
java -jar ./wss-unified-agent.jar
tags:
Expand Down