Created
January 22, 2020 17:25
-
-
Save smilelikeshit/5a5debf20f6a0ca5de7509451081edee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent none | |
environment { | |
PASSWORD = "${env.PASSWORD}" | |
USERNAME = "${env.USERNAME}" | |
PROJECTKEY = "${env.PROJECTKEY}" | |
URL = "${env.URL}" | |
} | |
stages { | |
stage('versioning') { | |
agent { | |
docker { image 'alpine:latest' | |
args '-u root' | |
} | |
} | |
steps { | |
sh 'apk add git' | |
sh 'git version' | |
} | |
} | |
stage('SonarQube analysis') { | |
agent { | |
docker { image 'newtmitch/sonar-scanner:alpine' | |
args '-u root --entrypoint=\'\' -v lib-sonar:/usr/src' | |
} | |
} | |
steps { | |
sh 'sonar-scanner \ | |
-Dsonar.projectKey="${PROJECTKEY}" \ | |
-Dsonar.sources=. \ | |
-Dsonar.host.url="${URL}" \ | |
-Dsonar.login=jenkins -Dsonar.login="admin" -Dsonar.password="${PASSWORD}" -X' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment