-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkins-file
38 lines (37 loc) · 1.06 KB
/
Jenkins-file
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
pipeline {
agent any
tools {
maven 'maven-3.9.6'
}
stages {
stage('build jar') {
steps {
script {
echo "building the app.."
sh "mvn package"
}
}
}
stage('build docker image') {
steps {
script {
echo "building the dockerimage.."
withCredentials([
usernamePassword(credentials: 'docker-hub-creds', usernameVariable: 'USER', passwordVariable: 'PAT')
]) {
sh "docker build -t hemu07/hemali_repo:jma-1.0 ."
sh "echo ${PAT} | docker login -u ${USER} --password-stdin"
sh "docker push hemu07/hemali_repo:jma-1.0"
}
}
}
}
stage('deploying the app') {
steps {
script {
echo "deploying the app.."
}
}
}
}
}