Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

#!/bin/bash
echo "Downloading Sealights Agents..."
wget -nv https://agents.sealights.co/sealights-java/sealights-java-latest.zip
unzip -o sealights-java-latest.zip

 
# sample values
export SL_APP_NAME="myApp"
export SL_PACKAGES_INCLUDED="*com.mycompany.*"
export SL_PR_TARGETBRANCH = "master"

# Pull request parameters per the Sealights documentation
if $GIT_PULL_REQUEST not null
      #Pull Request context
      java -jar sl-build-scanner.jar -prConfig -token $SL_TOKEN -appname $SL_APP_NAME \
            -targetBranch $SL_PR_TARGETBRANCH -pullRequestNumber $GIT_PULL_REQUEST \
            -latestCommit $GIT_COMMIT -repoUrl $GIT_REPO_URL -pi $SL_PACKAGES_INCLUDED
else
      #Regular Build
      java -jar sl-build-scanner.jar -config -token $SL_TOKEN -appname $SL_APP_NAME \
            -branchname "${GIT_BRANCH}" -buildname "${BUILD_NUMBER}" -pi $SL_PACKAGES_INCLUDED
fi

echo  '{
		"token": ${SL_TOKEN},
		"createBuildSessionId": false,
		"buildSessionIdFile": "./buildSessionId.txt",
		"filesIncluded": "*.class",
		"filesExcluded": "*test-classes*",
		"recursive": true,
		"includeResources": true,
		"testStage": "Unit Tests",
		"labId": null,
		"executionType": "full",
		"logEnabled": false,
		"logDestination": "console",
		"logLevel": "warn",
		"logFolder": "/tmp",
		"sealightsJvmParams": {},
		"enabled": true,
		"filesStorage": "/tmp"
}' > slmaven.json
  
echo "Updating POM with Sealights..."
java -jar sl-build-scanner.jar -pom -configfile slmaven.json -workspacepath .

  • No labels