-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathJenkinsfile
39 lines (35 loc) · 1.11 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
pipeline {
agent {
label "jenkins-maven"
}
stages {
stage('Build Release') {
steps {
container('maven') {
sh "mvn versions:set -DnewVersion=\$(jx-release-version)"
}
dir ('./helm/spring-boot-web-example') {
container('maven') {
// until kubernetes plugin supports init containers https://github.com/jenkinsci/kubernetes-plugin/pull/229/
sh 'cp /root/netrc/.netrc ~/.netrc'
sh "make tag"
}
}
container('maven') {
sh "mvn clean deploy fabric8:build fabric8:push -Ddocker.push.registry=$JENKINS_X_DOCKER_REGISTRY_SERVICE_HOST:$JENKINS_X_DOCKER_REGISTRY_SERVICE_PORT"
}
}
}
stage('Deploy Staging') {
steps {
dir ('./helm/spring-boot-web-example') {
container('maven') {
sh 'make release'
sh 'helm install . --namespace staging --name example-release'
sh 'exposecontroller --namespace staging --http' // until we switch to git environments where helm hooks will expose services
}
}
}
}
}
}