[chef] nexus and chef


Chronological Thread 
  • From: Yvonne Lam < >
  • To:
  • Subject: [chef] nexus and chef
  • Date: Thu, 19 May 2011 12:22:59 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SGHnIK1FAcNm2XKyAxd4xjc66G+H76R54jcI7owlRANfO66F8S3zMKf17T0LSRj/qB 4vh+1aLMyITiPPsH2ynGfbUr7xJiiVsFf2OxTRME3rflVHryKvSw4IZoinrGG/SoUu3D DDh9Urc9hvfYmV9GlRw2dcUot9gBX0HhEAqCQ=

I asked a couple of people at the chef meetup in Seattle about this; they gave me some good ideas and suggested that I ask the mailing list for more, so...  Does anyone have a nice way of using chef to deploy maven snapshots from nexus that they would be willing to share?  At my job, we've extended the deploy resource to know how to use the nexus search functionality to find artifacts and download them.  It works great, except that due to the nature of maven snapshots (*), it downloads snapshots whether it needs to or not.  Ideas so far:

1.  Hit nexus, download thing-1.0-SNAPSHOT.war snapshot, compare it to the existing one.  If they are the same, then tell the nexus/deploy resource somehow not to move the symlinks.  Issue:  I don't know how to tell the deploy resource not to move the symlinks.
2.  Give thing-1.0-SNAPSHOT.war a unique identifier (timestamp/build number/checksum) in a file in the target node's filesystem.  When the recipe next runs, scrape the nexus output to determine whether there is a new snapshot that needs to be downloaded.  If there isn't, don't download anything, and gracefully exit the nexus/deploy resource.  Issue:  I don't know how to make the graceful exit.
3.  Add code to check nexus for new snapshots separately, and only run the nexus resource if there are changes.  This is what I'm planning to implement for now.  Issues:  None really, except that (1) or (2) seem to me to be cleaner solutions if I could make them work.
4.  Add a build step to jenkins to run the chef client and update nodes when a new snapshot is built.  Issue:  I don't love the idea of adding an explicit dependency on jenkins, although I suppose I could be convinced otherwise.

In case it matters, we're using nexus 1.5 open source, for which API documentation seems to be not quite available.  

Yvonne

(*)  Basically, thing-1.0-SNAPSHOT.war refers to the most recent of thing-<timestamp1>.war, thing-<timestamp2>.war,...,thing-<timestampN>.war.



Archive powered by MHonArc 2.6.16.

§