-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
26 lines (26 loc) · 873 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pipeline {
agent {
label 'maven'
}
environment {
MAVEN_OPTS = "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS = "--batch-mode --errors --fail-at-end --show-version --no-transfer-progress -DinstallAtEnd=true -DdeployAtEnd=true"
}
stages {
stage('Test') {
steps {
sh 'mvn $MAVEN_CLI_OPTS test'
}
}
stage('SonarQube') {
steps {
sh 'mvn clean verify sonar:sonar -Dsonar.projectKey=CiExampleJenkins -Dsonar.host.url=https://sonarqube.base2code.dev -Dsonar.login=${SONAR_TOKEN}c'
}
}
stage('Build') {
steps {
sh 'mvn $MAVEN_CLI_OPTS package'
}
}
}
}