CodeScan with Linux/Unix Agents
Requirements
Setup Jenkins
node {
stage('Pull from Git') {
git 'https://wherever.com/me/my-repo.git'
}
withCredentials([string(credentialsId: 'credential_name', variable: 'codescan_token')]) {
stage('CodeScan') {
sh '''
export PATH="$(pwd)/.sfdx-install/bin/:$PATH"
if [ ! -f .sfdx-install/bin/sfdx ]; then
mkdir .sfdx-install
wget -q https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz -O .sfdx-install/sfdx.tar.xz
tar xJf .sfdx-install/sfdx.tar.xz -C .sfdx-install --strip-components 1
echo y|sfdx plugins:install sfdx-codescan-plugin
sfdx plugins:update
fi
sfdx codescan:run --token=$codescan_token --projectkey=my_project --organization=my_organization
exit $?
''' }
} }Last updated
Was this helpful?

