-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
39 lines (39 loc) · 963 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pipeline {
agent { label 'linux-docker-small' }
options {
buildDiscarder(logRotator(numToKeepStr:'25'))
disableConcurrentBuilds()
timestamps()
}
triggers {
/*
Restrict nightly builds to master branch
Note: The BRANCH_NAME will only work with a multi-branch job using the github-branch-source
*/
cron(BRANCH_NAME == "master" ? "H H(6-8) * * *" : "")
}
environment { PATH="${tool 'docker-latest'}/bin:$PATH" }
stages {
stage('Build Images') {
steps {
sh 'make images'
}
}
stage('Deploy Images') {
when {
allOf {
expression { env.CHANGE_ID == null }
expression { env.BRANCH_NAME == "master" }
}
}
environment {
DOCKER_LOGIN = credentials('dockerhub-codicebot')
}
steps {
sh 'docker login -u $DOCKER_LOGIN_USR -p $DOCKER_LOGIN_PSW'
sh 'make push'
sh 'make manifests'
}
}
}
}