-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
41 lines (33 loc) · 906 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
40
41
pipeline {
agent any
environment {
DOCKERHUB_CREDENTIALS=credentials('DockerHub')
}
stages {
stage('Clone Repo') {
steps {
git branch: 'main', credentialsId: 'github', url: 'https://github.com/shrenik-jain/face-physiognomy.git'
}
}
stage('Docker Build') {
steps {
sh "docker build -t ${DOCKERHUB_CREDENTIALS_USR}/face-physiognomy:latest ."
}
}
stage('Docker Login') {
steps {
sh "docker login -u ${DOCKERHUB_CREDENTIALS_USR} -p ${DOCKERHUB_CREDENTIALS_PSW}"
}
}
stage('Docker Push') {
steps {
sh "docker push ${DOCKERHUB_CREDENTIALS_USR}/face-physiognomy:latest"
}
}
}
post {
always {
sh "docker logout"
}
}
}