added kaniko example
[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           """
29         }
30       }
31     }
32   }
33   post {
34     changed {
35       mail to: "jenkins@wamblee.org",
36       subject: "jenkins build:${currentBuild.currentResult}: ${env.JOB_NAME}",
37       body: "${currentBuild.currentResult}: Job ${env.JOB_NAME}\nMore Info can be found here: ${env.BUILD_URL}"
38     }
39   }
40 }