0

What I want to achieve is two step build automation

Step A - Build & Upload to artifact repo

  1. Create build job in Jenkins which will create build after every check-in
  2. Upload every successful build on Archiva server

Step B - Get latest artifact & deploy on required servers

  1. After every desired interval, get latest build from Archiva
  2. Deploy build uploaded in Step A.2 to dev/qa/stg server by unzipping its content in web server directory.

I was able to do achieve Step A by using maven goals in my project pom.xml but any idea/suggestions/best practices for Step B.

I understand/agree, I would need two different jobs having different pom.xml, question remains how will we get latest war from repo in pom and how will be deploy that latest war on remote server by unzipping it, as tomcat there does not have admin module.

Amol Ghotankar
  • 2,008
  • 5
  • 28
  • 42

2 Answers2

0

I would deploy not a jar/war artifact on step 2, but would create a RPM that contains a needed files structure. With maven it's quite easy to do with a maven rpm plugin

3-4. Nexus has built in YUM repository support, so you can use yum to install the latest rpm version

Yuri G.
  • 4,323
  • 1
  • 17
  • 32
-1

So I've always found it better to separate the builds and the deploys. The schedule for those can be independently managed then.

Assuming you are using linux on the servers you could use the ssh-plugins in jenkins to download the artifact in archiva

wget http://server/repository/internal/group/artifact/version/artifact-version.jar

As for the deploy, you could sftp them over to the deploy server also using jenkins SFTP plugin.

Sai Hegde
  • 623
  • 5
  • 12