cookbooks icon indicating copy to clipboard operation
cookbooks copied to clipboard

support deploying an archive straight from CI in play2 cookbook

Open matthandlersux opened this issue 11 years ago • 4 comments

matthandlersux avatar Oct 01 '14 21:10 matthandlersux

+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?

GitsMcGee avatar Oct 07 '14 22:10 GitsMcGee

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.

Bowbaq avatar Oct 08 '14 19:10 Bowbaq

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)?

GitsMcGee avatar Oct 08 '14 22:10 GitsMcGee

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_play2 definition 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.

Bowbaq avatar Oct 09 '14 16:10 Bowbaq