diff --git a/Jenkinsfile b/Jenkinsfile index 9c4124b0b..8dd0b0017 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -50,7 +50,7 @@ node { } // stage: Jacoo } // parallel } // stage: tests - stage ("Docker") { + stage ("Container") { stage('build') { sh """ #!/bin/bash docker image build -f Dockerfile -t ${projectName}:${env.BUILD_ID} . diff --git a/mypetclinic.sh b/mypetclinic.sh index ea60a5c52..21cec1dcb 100755 --- a/mypetclinic.sh +++ b/mypetclinic.sh @@ -23,6 +23,7 @@ clean() { docker image prune -a -f --filter "until=1h" docker container prune -f --filter "until=1h" docker system prune -f --filter "until=1h" + sleep 3 docker rmi -f $(docker images -aq) } startContainer() { @@ -45,6 +46,7 @@ stopContainer() { printf "\n -------- Stop container: ${containerName} -------- \n " # docker container stop ${docker container ls -a | grep postgres | awk '{print $1}'} docker stop $containerName -t 0 + sleep 5 docker rm -f $containerName } diff --git a/readme.md b/readme.md index 3c05326a9..83ab229fa 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,8 @@ Develop a DevOps pipeline to automate tasks such as code compile, unit testing, Note: This process with not deploy to the envionrmnet platform. -### Change log -- Original readme.md renamed as readme-orignial.md +### Changelog +- The original 'readme.md' file has been renamed to 'readme-orignial.md'. - Add new files - readme.md - Dockerfile @@ -57,7 +57,7 @@ This sub-stage generates Jacoco code coverage reports using Apache Maven command ````` mvn jacoco:report ````` -#### Stage: Docker +#### Stage: Container The stage 'Docker' contains the following sub-stages: ##### build This sub-stage builds the Docker image using the Dockerfile. The image is tagged with the project name and the Jenkins build ID.