Skip to content

Commit

Permalink
update jenkins-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyuanzhao000 committed Dec 22, 2019
1 parent 1ffc4df commit b16d36d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions jenkins-ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ pipeline {
jdk 'jdk8'
maven 'maven-3.6.1'
}
// At this stage, the jar artifacts are first built using maven, and then the docker images are built.
stages {

// At this stage, the jar artifacts are first built using maven, and then the docker images are built.
stage('Build') {
steps {
echo "Build..."
Expand All @@ -16,6 +17,7 @@ pipeline {
echo "Building images Successful!"
}
}

// TODO: This stage will perform unit tests, etc.
stage('Test') {
steps {
Expand All @@ -26,6 +28,7 @@ pipeline {
sh 'mvn clean'
}
}

// This stage will push the images built to the docker hub.
// After this stage is successful, you can directly pull the image from the docker hub to build the TrainTicket cluster application.
// Note: The tag of the image you build at this time is latest. Please modify it when deploying the application.
Expand All @@ -41,5 +44,6 @@ pipeline {
sh 'sudo /bin/bash ./jenkins-ci/clean.sh'
}
}

}
}
}
5 changes: 4 additions & 1 deletion jenkins-ci/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ sudo docker rmi ts/ts-admin-travel-service:latest
sudo docker rmi ts/ts-admin-user-service:latest
sudo docker rmi ts/ts-news-service:latest
sudo docker rmi ts/ts-ticket-office-service:latest
sudo docker rmi ts/ts-voucher-service:latest
sudo docker rmi ts/ts-voucher-service:latest

sudo docker rmi $(docker image ls -qf dangling=true)
sudo docker image prune -f

0 comments on commit b16d36d

Please sign in to comment.