-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
42 lines (28 loc) · 1.12 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
36
37
38
39
40
41
42
pipeline {
agent any
stages {
stage('Build') {
steps {
// Build the Dockerfile
sh 'docker build --tag=beyghakymyar/backend:1.0.$BUILD_NUMBER .'
}
}
stage('Tag') {
steps {
// Tag latest image
sh 'docker tag beyghakymyar/backend:1.0.$BUILD_NUMBER beyghakymyar/backend:1.0.$BUILD_NUMBER'
// Tag Image with "latest"
sh 'docker tag beyghakymyar/backend:1.0.$BUILD_NUMBER beyghakymyar/backend:$GIT_COMMIT'
}
}
stage('Push') {
steps {
sh'docker login -u beyghakymyar -p yaaraan@123'
// Push Image to DockerHub
//sh 'docker push beyghakymyar/backend:$BUILD_NUMBER'
// Push Tag to DockerHub
sh 'docker push beyghakymyar/backend:1.0.$BUILD_NUMBER'
}
}
}
}