-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
30 lines (28 loc) · 1.59 KB
/
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
27
28
29
30
properties([authorizationMatrix(inheritanceStrategy: nonInheriting(), permissions: ['com.cloudbees.plugins.credentials.CredentialsProvider.Create:authenticated', 'com.cloudbees.plugins.credentials.CredentialsProvider.Delete:authenticated', 'com.cloudbees.plugins.credentials.CredentialsProvider.ManageDomains:authenticated', 'com.cloudbees.plugins.credentials.CredentialsProvider.Update:authenticated', 'com.cloudbees.plugins.credentials.CredentialsProvider.View:authenticated', 'hudson.model.Item.Build:authenticated', 'hudson.model.Item.Cancel:authenticated', 'hudson.model.Item.Configure:authenticated', 'hudson.model.Item.Delete:authenticated', 'hudson.model.Item.Discover:authenticated', 'hudson.model.Item.Move:authenticated', 'hudson.model.Item.Read:anonymous', 'hudson.model.Item.Read:authenticated', 'hudson.model.Item.Workspace:authenticated', 'hudson.model.Run.Delete:authenticated', 'hudson.model.Run.Replay:authenticated', 'hudson.model.Run.Update:authenticated', 'hudson.scm.SCM.Tag:authenticated'])])
pipeline {
agent {
docker {
image 'openjdk:8'
}
}
stages {
stage('Build') {
steps {
sh '''chmod -R 777 .
bash ./gradlew assemble'''
}
}
stage('Test') {
steps {
sh 'bash ./gradlew test'
}
}
stage('Sonar') {
steps {
withCredentials([string(credentialsId: 'SonarExecutor', variable: 'SONAR_TOKEN')]) {
sh 'bash ./gradlew jacocoTestReport sonarqube -Dsonar.projectKey=xue -Dsonar.projectName=xue-$BRANCH_NAME -Dsonar.host.url=https://sonar.rschrage.org -Dsonar.login=$SONAR_TOKEN'
}
}
}
}
}