-
-
Notifications
You must be signed in to change notification settings - Fork 41
continuous deployment semi automated
One possible solution to start auto-deploying your project is just to use mvn deploy
instead of mvn install
.
Starting from the Jenkinsfile in the demo project, replace the stage('Local installation')
part with
stage('Deployment')
if (isUnix()) {
sh "${mvnHome}/bin/mvn -DskipTests deploy"
} else {
bat "${mvnHome}\\bin\\mvn -DskipTests deploy"
}
This first change will automatically deploy all commits on all your project' branches if you setup a job like explained in the jenkins-integration-multibranch-pipeline.
Using this simple setup, it is possible to deploy released version of your project using few steps.
If we consider that we release only on the master
branch of the project (like all jgitver projects) then using the above setup you are only few steps away a semi automatic deployment.
Once your are satisfied of a commit on the master branch (probably after a FF merge from a topic branch):
-
tag the HEAD of master:
git tag -a -m "this is release X.Y.Z" X.Y.Z
-
push the tag to your remote:
git push --follow-tags origin master
-
force a build of the master branch:
- by issuing a POST on http://localhost:8080/job/demo-ci-jgitver-maven-plugin/job/master/build (replace with your URL)
- or by manualy clicking the launch build button on your job
any of the above will make a build of the master branch on which the annotated tag
X.Y.Z
is set, and thus will lead in a build/deployment of your project versionX.Y.Z
👍
- easy to setup
- keeps the git history clean
👎
- some manual steps
Usage guide
- Starting from scratch
- Introduce jgitver-maven-plugin in existing project
- Use a lightweight tag to change project version
IDE usage
Continuous integration
- native GIT aware travis-ci circle-ci
- jenkins integration multibranch pipeline
- continuous deployment - semi automated
- automatic builds for maven, jenkins and gitbucket
Developer & contributions guide