-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
35 lines (32 loc) · 1.05 KB
/
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
pipeline{
agent any
environment {
DOCKER_USER = credentials('docker_user')
DOCKER_PSWD = credentials('docker_password')
}
stages{
stage("Git Checkout"){
steps{
git branch: 'master', url: 'https://github.com/georgetoolit1/notejam-django.git'
}
}
stage("Docker Image Build"){
steps{
script {
sh 'docker image build -t $JOB_NAME:v1.$BUILD_ID .'
sh 'docker image tag $JOB_NAME:v1.$BUILD_ID nevis256/$JOB_NAME:v1.$BUILD_ID'
sh 'docker image tag $JOB_NAME:v1.$BUILD_ID nevis256/$JOB_NAME:latest'
}
}
}
stage('Push Image to Dockerhub') {
steps{
script{
sh 'docker login -u ${DOCKER_USER} -p ${DOCKER_PSWD}'
sh 'docker image push nevis256/$JOB_NAME:v1.$BUILD_ID'
sh 'docker image push nevis256/$JOB_NAME:latest'
}
}
}
}
}