This commit is contained in:
2022-02-14 16:34:14 +09:00
parent 1537d3119b
commit 1396d4994a

View File

@@ -46,13 +46,15 @@ pipeline {
stage('dockerizing'){
steps{
sh 'docker build . -t crypto/drop-the-bit'
sh 'docker build -t jenkins/cryptoapp .'
}
}
stage('Deploy') {
steps {
sh 'docker run -d -p 40005:40005 --name crypto_drop-the-bit crypto/drop-the-bit'
sh 'docker ps -q --filter "name=jenkins-cryptoapp" | grep -q . && docker stop jenkins-cryptoapp && docker rm jenkins-cryptoapp | true'
sh 'docker run -p 8090:8080 -d --name=jenkins-cryptoapp jenkins/cryptoapp'
sh 'docker rmi -f $(docker images -f "dangling=true" -q) || true'
}
post {