Monday, February 25, 2013

Agile Java deployment for all

Continuous Integration is a necessary milestone to achieve agility. It should be configured to publish snapshots in the artifacts repository to support teams organized on separation of concerns tactics.

There is no need to build again and again the application in many different machines, that just creates waste (more CPU usage for one). For instance your Data and Front End teams might need the latest version of the application from the trunk so they can work on some functionality depending on it. They use completely automated VDI boxes which host a specific application version deployed at the time of the initial build. It makes sense then to have a single command that would get the snapshot deployed in their dev boxes. A simple command they can run themselves.

Configuring Jenkins to deploy into Artifactory is a snap. First the artifactory server is configured in Jenkins as explained and then following that same URL the only thing to do to enable an automated push to artifactory is to go to the "Configure" option for the WAR project and locate "Post-build Actions", check "Deploy artifacts to Artifactory" and select the artifactory server.

You could build your own script that will take care of the magic to deploy the snapshot artifact in apache, tomcat and what not. A hint for such script in terms of parameters could be:
./remoteWarDeploy.sh username desktop.sample.com https://artifactory.sample.com/libs-snapshots-local/com/sample/cool-app/1.2.3-SNAPSHOT/cool-app-1.2.3-SNAPSHOT.war
Needless to say the same script could be used to deploy a released version as well.

No comments:

Followers