forked from LandmarkTechnology/spring-boot-mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline-script
32 lines (30 loc) · 1.06 KB
/
pipeline-script
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
node {
stage("Git Clone"){
git credentialsId: 'GIT_CREDENTIALS', url: 'https://github.com/slegah/spring-boot-mongo-docker.git'
}
stage("Maven Clean Build"){
def mavenHome = tool name: "Maven-3.6.3", type: "maven"
def mavenCMD = "${mavenHome}/bin/mvn "
sh "${mavenCMD} clean package"
}
stage("Build Docker Image"){
sh "docker build -t legah2045/spring-boot-mongo ."
}
stage("Docker Push"){
withCredentials([string(credentialsId: 'DOCKER_HUB_CREDENTIALS', variable: 'DOCKER_HUB_CREDENTIALS3')]) {
sh "docker login -u legah2045 -p ${DOCKER_HUB_CREDENTIALS3}"
}
sh "docker push legah2045/spring-boot-mongo"
}
stage('Manual Approval'){
echo 'Hi, this is Winifred from Rogers Digital Team'
input('Do you want to proceed?')
}
stage("Deploy Application in labs Cluster"){
kubernetesDeploy(
configs: 'springBootMongo.yml',
kubeconfigId: 'KUBERNETES_CLUSTER_CONFIG1',
enableConfigSubstitution: true
)
}
}