first try to push to nexus
[upnpmonitor] / Jenkinsfile
1 String cron_string = BRANCH_NAME == "trunk" ? "10 3 * * *" : ""
2
3
4 pipeline {
5   agent {
6     kubernetes agentsetup(containers: 'java8,kaniko') 
7   }
8   options {
9     disableConcurrentBuilds()
10   }
11   triggers { cron(cron_string) }
12   
13   stages {
14     stage('Main') {
15       steps {  
16         sh """
17           #No longer building the code since cling-core is no longer 
18           #maintained
19           #mvn install
20           (
21             cd site
22             mvn -N -Ddistrib=/data/www/http.upnpmonitor.wamblee.org/ site site:deploy
23           )
24         """   
25         container('kaniko') { 
26           sh """
27             echo 'Hello world' 
28             /kaniko/executor --dockerfile Dockerfile \
29                              --cache=true \
30                              --cache-ttl=100000h \
31                              --context \$(  pwd ) \
32                              --destination cat.wamblee.org/rockyrocks:${env.BRANCH_NAME}
33           """
34         }
35       }
36     }
37   }
38   post {
39     changed {
40       mail to: "jenkins@wamblee.org",
41       subject: "jenkins build:${currentBuild.currentResult}: ${env.JOB_NAME}",
42       body: "${currentBuild.currentResult}: Job ${env.JOB_NAME}\nMore Info can be found here: ${env.BUILD_URL}"
43     }
44   }
45 }