Change Gradle build

This commit is contained in:
Thomas Peetz
2020-06-13 15:38:06 +02:00
parent 964e78cdc7
commit 5d69881eb1
8 changed files with 214 additions and 110 deletions
Vendored
+16 -22
View File
@@ -1,29 +1,23 @@
// Build and test project generations with documentation
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '5', artifactNumToKeepStr: '5', daysToKeepStr: '5', numToKeepStr: '5'))])
properties([
gitLabConnection('IBTP'),
])
node {
stage("Build") {
deleteDir()
stage("Checkout") {
checkout scm
withCredentials([usernamePassword(credentialsId: '201ea374-bda3-4a38-a18a-ccc9c39fb3ff', passwordVariable: 'ORG_GRADLE_PROJECT_nexusPassword', usernameVariable: 'ORG_GRADLE_PROJECT_nexusUsername')]) {
}
gitlabBuilds(builds: ["build", "publish"]) {
stage("Build") {
gitlabCommitStatus("build") {
sh "chmod +x gradlew"
sh "./gradlew clean build asciidoctor -PnexusUrl=https://nexus.ingenieurbuero-peetz.de"
sh "./gradlew clean build"
}
}
withCredentials([usernamePassword(credentialsId: 'IBTPJenkinsBot', passwordVariable: 'TOKEN', usernameVariable: 'CHAT')]) {
sh script:"curl -s -X POST https://api.telegram.org/bot$TOKEN/sendMessage -d chat_id=$CHAT -d text='Job ${env.BUILD_TAG} ended successfully, ${env.BUILD_URL}' > /dev/null", returnStatus: true
stage("Publish Build Results") {
gitlabCommitStatus("publish") {
archiveArtifacts allowEmptyArchive: true, artifacts: "build/asciidoc/pdf/*.pdf"
scanForIssues sourceCodeEncoding: 'UTF-8', tool: taskScanner(highTags: 'FIXME', ignoreCase: true, includePattern: 'src/**/*.adoc', normalTags: 'TODO')
}
}
}
stage("Publish Build Results") {
junit allowEmptyResults: true, testResults: '**/build/test-results/**/*.xml'
openTasks canComputeNew: false, defaultEncoding: 'UTF-8', excludePattern: '', healthy: '', high: '', ignoreCase: true, low: '', normal: '', pattern: '*.gradle,**/*.java,**/*.adoc', unHealthy: ''
archiveArtifacts allowEmptyArchive: true, artifacts: "build/asciidoc/pdf/generations.pdf"
}
stage("Publish HTML") {
publishHTML(target: [
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: false, reportDir: 'build/asciidoc/html5',
reportFiles: "generations.html",
reportName: "generations"
])
}
}