cookbooks
cookbooks copied to clipboard
support deploying an archive straight from CI in play2 cookbook
+1 This ticket is important to me, and I'd be happy to help out, though I am quite new to Chef and OpsWorks. To achieve this, are you thinking of, not running the setup recipe, then having a second deploy_from_archive recipe for the deploy stage?
OpsWorks has options to specify a regular link or an S3 link as the application source. I was planning to detect what kind of application source we're dealing with, and then use the proper fetching method accordingly. Currently, the logic is at https://github.com/Originate/cookbooks/blob/master/play2/definitions/opsworks_play2.rb#L57
The advantage of doing it that way is that it would "just work". It could be slightly more complex though.
Cool. Just to make sure I understand. The plan is that users would upload a full distribution (result of "activator dist") to S3, then the recipe would react accordingly. I which case, the setup recipe would no longer be needed. Or are you thinking not a full distribution (with play bundled into it)?
Mostly, it would go something like:
- run
activator dist - upload the resulting zip file to S3 / some HTTP accessible location
- trigger a deployment in opsworks. in the JSON blob, add the location of the archive
- the
opsworks_play2definition would inspect the JSON, and do one of:- check out the repo, build the code, deploy if the JSON contains SCM info
- download the archive, deploy if the JSON contains a url to an archive
The setup recipe would still be needed. In the blog's example, we're only installing / deploying Play!, but in a real setup there is usually a few other things to do.