This commit is contained in:
2022-02-16 18:05:16 +09:00
parent 298f80ae15
commit 25527e0e89
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
FROM java:8
EXPOSE 8081
EXPOSE 8080
ARG JAR_FILE=./build/libs/drop-the-bit-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]

View File

@@ -46,14 +46,14 @@ pipeline {
stage('dockerizing'){
steps{
sh 'docker build -t jenkins/cryptoapp .'
sh 'docker build -t cryptoapp:0.1 .'
}
}
stage('Deploy') {
steps {
sh 'docker ps -q --filter "name=jenkins-cryptoapp" | grep -q . && docker stop jenkins-cryptoapp && docker rm jenkins-cryptoapp | true'
sh 'docker run -p 8090:8081 -d --name=jenkins-cryptoapp jenkins/cryptoapp'
sh 'docker ps -q --filter "name=cryptoapp" | grep -q . && docker stop cryptoapp && docker rm cryptoapp | true'
sh 'docker run -p 9999:8080 -d --name=cryptoapp cryptoapp:0.1'
sh 'docker rmi -f $(docker images -f "dangling=true" -q) || true'
}