-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
38 lines (36 loc) · 914 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
#!/usr/bin/env groovy
library identifier: 'jenkins-shared-library@main', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'https://github.com/ibrahim-osama-amin/Jenkins-shared-library.git',
credentialsId: 'github-credentials'
]
)
pipeline {
agent any
tools {
maven 'Maven'
}
environment {
IMAGE_NAME = 'ibrahimosama/my-repo:java-maven-2.0'
}
stages {
stage('build app') {
steps {
script {
echo 'building application jar...'
buildJar()
}
}
}
stage('build image') {
steps {
script {
echo 'building docker image...'
buildImage(env.IMAGE_NAME)
dockerLogin()
dockerPush(env.IMAGE_NAME)
}
}
}
}
}