-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
39 lines (32 loc) · 1.01 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
pipeline {
agent any
stages {
stage('Build app') {
steps {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/sonadukane18/Jenkins_Docker_Demo_Repo.git']])
}
}
stage('Build Docker Image') {
steps {
script {
bat 'docker build -t jenkinsdocker .'
}
}
}
stage('Rename Image Tag') {
steps {
script {
bat 'docker tag jenkinsdocker sonadukane18/jenkinsdockerapp:image'
}
}
}
stage('Push Image to Docker Hub') {
steps {
script {
bat "docker login -u sonadukane18 -p Kashmir@25"
bat 'docker push sonadukane18/jenkinsdockerapp:image'
}
}
}
}
}