Sugested way of working - Jenkins promotions or artifactory releases will deploy a war

725 views Asked by At

We have a jenkins Job that package a WAR snapshot on every commit on SVN. We also use the Release plugin that generate a versioned WAR on artifactory.

example:web:1.1-SNAPSHOT >> 1.1

We want include the deployment task on the jenkins work flow. On different project we also work with the promote plugin.

We are not sure which is the better approach for work with the automated deployment task, based on the number of future problems that we could found.

The first solution planned is :

  • Use the release plugin for generate a release stagging.
  • Use the promotion plugin for authorize the automated deployment.
  • This promotion launch a different job that download the last available WAR file from artifactory and deploy it.

We have discused if we can do it on the same "promotion action" or found a different solution.

Which solution is the most common for those cases? How we can restrict the accidental deployment of unauthorized versions?

1

There are 1 answers

5
Paul Hicks On BEST ANSWER

Don't deploy the latest version, since you'll unintentionally deploy the wrong version, sooner or later. Use parameterized builds to deploy a particular version. The deploy-to-artifactory job sets the parameter and uses the parameterized trigger plugin to kick off all deploy-to-machine jobs.

You may want to parameterize all jobs in the pipeline after the deploy-to-artifactory job. I think there are other plugins that put the parameter into an entire pipeline, but I can't see them at the moment. There is a wide range of plugins that you can leverage in this workflow to suit your needs, such as the BuildResultTrigger plugin and the Build Flow plugin. And matrix builds are great for deploying to a range of machines, OSes, etc.