Skip to content

Commit b678931

Browse files
committed
tatic code analysis stage added
1 parent f43d213 commit b678931

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:8-jdk-alpine
2+
WORKDIR /app
3+
COPY ./taget/*.jar /app.jar
4+
CMD ["java", "-jar", "app.jar"]

Jenkinsfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pipeline{
77
parameters{
88

99
choice(name: 'action', choices: 'create\ndelete', 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
}

0 commit comments

Comments
 (0)