forked from tjhubz/PittBOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
33 lines (27 loc) · 839 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
node {
def app
stage('Clone repository') {
/* Let's make sure we have the repository cloned to our workspace */
checkout scm
}
stage('Build image') {
/* This builds the actual image; synonymous to
* docker build on the command line */
app = docker.build("tjhubz/pittbot")
}
if(env.BRANCH_NAME == 'dev'){
stage("push image"){
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
app.push("dev")
}
}
}
if(env.BRANCH_NAME == 'main'){
stage("push image"){
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
}
}