forked from adikarthik/b7-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile
More file actions
32 lines (28 loc) · 817 Bytes
/
JenkinsFile
File metadata and controls
32 lines (28 loc) · 817 Bytes
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
pipeline {
agent any
stages {
stage('build') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/main']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/Bheemashankar-AY/b7-java.git']]])
sh 'mvn clean install'
}
}
stage('build docker image') {
steps {
script {
sh 'docker build -t cidc:1.0 .'
}
}
}
stage('push image to Hub'){
steps{
script{
withCredentials([string(credentialsId: 'dockerpwd', variable: 'dockerpwd')]) {
sh 'docker login --username bheema9161 -p ${dockerpwd}'
sh 'docker push bheema9161/cicd:1.0'
}
}
}
}
}
}