-
Notifications
You must be signed in to change notification settings - Fork 62
/
Jenkinsfile
25 lines (25 loc) · 1018 Bytes
/
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
pipeline {
agent {
kubernetes {
label 'promo-app' // all your pods will be named with this prefix, followed by a unique id
idleMinutes 5 // how long the pod will live after no jobs have run on it
yamlFile 'build-pod.yaml' // path to the pod definition relative to the root of our project
defaultContainer 'maven' // define a default container if more than a few stages use it, will default to jnlp container
}
}
stages {
stage('Build') {
steps { // no container directive is needed as the maven container is the default
sh "mvn clean package"
}
}
stage('Build Docker Image') {
steps {
container('docker') {
sh "docker build -t vividlukeloresch/promo-app:dev ." // when we run docker in this step, we're running it via a shell on the docker build-pod container,
sh "docker push vividlukeloresch/promo-app:dev" // which is just connecting to the host docker deaemon
}
}
}
}
}