-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
68 lines (59 loc) · 2.18 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pipeline {
agent any
stages {
stage('Test') {
steps {
withCredentials([
string(credentialsId: 'ADDRESS_SONAR', variable: 'address_sonar'),
string(credentialsId: 'SONAR_COMMON_TOKEN', variable: 'common_token'),
[$class: 'UsernamePasswordMultiBinding', credentialsId: 'dockerhub',
usernameVariable: 'DOCKER_IO_USER', passwordVariable: 'DOCKER_IO_PASSWORD']]) {
sh 'DOCKER_IO_USER=$DOCKER_IO_USER DOCKER_IO_PASSWORD=$DOCKER_IO_PASSWORD ./gradlew clean test sonarqube -Dsonar.projectKey=iexec-common -Dsonar.host.url=$address_sonar -Dsonar.login=$common_token --no-daemon -i'
}
junit 'build/test-results/**/*.xml'
jacoco()
}
}
stage('Build') {
steps {
sh './gradlew build -x test --no-daemon'
}
}
stage('Upload Archive') {
when {
anyOf{
branch 'master'
branch 'develop'
}
}
steps {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'nexus', usernameVariable: 'NEXUS_USER', passwordVariable: 'NEXUS_PASSWORD']]) {
sh './gradlew publish -PnexusUser=$NEXUS_USER -PnexusPassword=$NEXUS_PASSWORD --no-daemon'
}
archiveArtifacts artifacts: 'build/libs/*.jar'
}
}
stage ("Notify iexec-core") {
when {
anyOf{
branch 'master'
branch 'develop'
}
}
steps {
build job: 'iexec-core/'+ env.BRANCH_NAME, propagate: true, wait: false
}
}
stage ("Notify iexec-worker") {
when {
anyOf{
branch 'master'
branch 'develop'
}
}
steps {
build job: 'iexec-worker/'+ env.BRANCH_NAME, propagate: true, wait: false
}
}
}
}