[chef] Re: nexus and chef


Chronological Thread 
  • From: "Upayavira" < >
  • To:
  • Subject: [chef] Re: nexus and chef
  • Date: Thu, 19 May 2011 20:46:55 +0100

Can't you do a HEAD request on the resource, and look for a last modified timestamp header to see if it has changed?
 
Upayavira
 
On Thu, 19 May 2011 12:22 -0700, "Yvonne Lam" < > wrote:
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.

§