File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM openjdk:8-jdk-alpine
2+ WORKDIR /app
3+ COPY ./taget/*.jar /app.jar
4+ CMD ["java" , "-jar" , "app.jar" ]
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ pipeline{
77 parameters{
88
99 choice(name : ' action' , choices : ' create\n delete' , description : ' Choose create/Destroy' )
10+ string(name : ' ImageName' , description : " name of the docker build" , defaultvalue : ' javapp' )
11+ string(name : ' ImageTag' , description : " tag of the docker build" , defaultvalue : ' v1' )
12+ string(name : ' AppName' , description : " name of the Application" , defaultvalue : ' springboot' )
1013 }
1114
1215 stages{
@@ -69,6 +72,15 @@ pipeline{
6972 }
7073 }
7174 }
75+ stage(' Docker Image Build' ){
76+ when { expression { params. action == ' create' } }
77+ steps{
78+ script{
79+
80+ dockerBuild(" ${ params.ImageName} " ," ${ params.ImageTag} " ," ${ params.AppName} " )
81+ }
82+ }
83+ }
7284
7385 }
7486}
You can’t perform that action at this time.
0 commit comments