forked from hortonworks-spark/shc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
53 lines (53 loc) · 1.4 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
@Library('infraLib') _
pipeline {
agent {
label 'linux-agents'
}
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('Set Maven credentials') {
steps {
script {
nexus.generateAuthorizedMavenSettingsXML("./settings.xml")
}
}
}
stage('Docker stage') {
agent {
docker {
image 'maven:3-jdk-8-slim'
args '-e MAVEN_OPTS="-Dmaven.repo.local=${WORKSPACE}/.m2/repository"'
reuseNode true
}
}
stages {
stage('Package') {
steps {
// at the moment it's impossible to run tests on Jenkins, because of unnamed container user (-u 1000:1000)
// java.io.IOException: failure to login
// Cause: javax.security.auth.login.LoginException: java.lang.NullPointerException: invalid null input: name
sh 'mvn package'
}
}
stage('Publish') {
when {
// publish only for `master`
branch 'master'
}
steps {
sh """mvn deploy \
--settings ${WORKSPACE}/settings.xml \
-DskipTests \
-Dmaven.install.skip=true \
-Drepoid=delphi-nexus \
-Dreponame=Nexus \
-Drepourl=https://artifacts.apollo.stream/repository/maven-releases/
"""
}
}
}
}
}
}