diff --git a/Jenkinsfile b/Jenkinsfile index f48da41..4959acd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,32 @@ +//pipeline { +// stages { +// stage('Build image') { +// checkout scm +// dir('SessionCompanion') { +// docker.build("session-companion:${env.BUILD_ID}") +// } +// } +// stage('Build app') { +// docker.image("session-companion:${env.BUILD_ID}").withRun('-p 5050:5050') +// } +// } +//} pipeline { - stages { + agent any + stages { stage('Build image') { - checkout scm - dir('SessionCompanion') { - docker.build("session-companion:${env.BUILD_ID}") - } + steps { + echo "Building docker image" + script { + def customImage = docker.build("session-companion:${env.BUILD_ID}") + customImage.withRun('-p 5050:5050') + } + } } - stage('Build app') { - docker.image("session-companion:${env.BUILD_ID}").withRun('-p 5050:5050') + stage('Delete image') { + steps { + sh "docker rmi session-companion:${env.BUILD_ID}" + } } } }