{"id":361,"date":"2014-06-27T18:42:50","date_gmt":"2014-06-27T18:42:50","guid":{"rendered":"http:\/\/blogs.nd.edu\/devops\/?p=361"},"modified":"2014-06-27T18:50:05","modified_gmt":"2014-06-27T18:50:05","slug":"launchpad-a-rails-app-deployment-platform","status":"publish","type":"post","link":"https:\/\/sites.nd.edu\/devops\/2014\/06\/27\/launchpad-a-rails-app-deployment-platform\/","title":{"rendered":"Launchpad: A Rails app deployment platform"},"content":{"rendered":"<p><a href=\"http:\/\/capistranorb.com\/\">Capistrano<\/a> is a great tool for building scripts that execute on remote hosts. \u00a0While its functionality lends itself to many different applications, it&#8217;s a de facto standard for deploying Ruby on Rails apps. \u00a0A few months ago, I used it to automate app deployments and other tasks such as restarting server processes, and behold, it was very good.<\/p>\n<p>I had provisioned each of the remote hosts using Puppet, so I knew that my machine configurations were good. \u00a0This meant that I could use the same capistrano scripts for multiple apps, as long as they used the same server stack\u00a0and ran on one of these hosts. \u00a0In short, <strong>c<\/strong><strong>onsistency enables automation<\/strong><strong>.<\/strong><\/p>\n<p>However, these are a few issues with this approach.<\/p>\n<ul>\n<li><span style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 15px;font-style: inherit;font-weight: bold;line-height: 1.625\">Distribution of Credentials. \u00a0<\/span>Capistrano needs a login to the remote host. \u00a0I can&#8217;t just give passwords or pem files to developers; our separation of responsibilities policy doesn&#8217;t allow it.<\/li>\n<li><span style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 15px;font-style: inherit;font-weight: bold;line-height: 1.625\">Proliferation of Cap Scripts. \u00a0<\/span>I can&#8217;t hand over scripts to developers and expect them to stay the same. \u00a0I need to centralize these things and maintain one copy in one place.<\/li>\n<li><span style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 15px;font-style: inherit;font-weight: bold;line-height: 1.625\">Visibility. \u00a0<\/span>I need these automated tools\u00a0to work in tandem with our change control processes. \u00a0That means auditing and logging.<\/li>\n<li><span style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 15px;font-style: inherit;font-weight: bold;line-height: 1.625\">Access Control. \u00a0<\/span>If I&#8217;m going to centralize, I need some way to say who can do what.<\/li>\n<\/ul>\n<h2>Enter Launchpad.<\/h2>\n<p>This is my solution: a web app that wraps all this functionality. \u00a0Launchpad has the following features:<\/p>\n<ul>\n<li>A centralized repository of application data\n<ul>\n<li>git urls<\/li>\n<li>deploy targets (dev, test, prod)<\/li>\n<li>remote hosts<\/li>\n<\/ul>\n<\/li>\n<li>A UI for running capistrano tasks<\/li>\n<li>Fine-grained access control per app\/environment\/task<\/li>\n<li>Notification groups for deployment events (partially implemented)<\/li>\n<li>Full audit trails of all actions taken in the system and the resulting output<\/li>\n<li>Support for multiple stacks \/ capistrano scripts<\/li>\n<li>JSON API (deploying soon)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Launchpad owns the remote host credentials, so users never have to see them. \u00a0As a result,<strong> I can give developers the ability to deploy outside of dev in a way that is safe, consistent, and thoroughly auditable.<\/strong> \u00a0My next blog post will outline the ways in which our Change Control team has worked to accommodate this new ability.<\/p>\n<p>Right now, the only stack implemented in Launchpad is an NGINX\/Unicorn stack for Rails apps, but there really is no limit to what we can deploy with this tool on top of capistrano.<\/p>\n<p>Launchpad is available to internal OIT developers; see me for details.<\/p>\n<p><strong>Better, Faster, More Consistent<\/strong><\/p>\n<p>It wasn&#8217;t long ago that OIT wasted time and energy having DBAs manually execute\u00a0SQL scripts created by developers. \u00a0Then, Sharif Nijim developed\u00a0the &#8220;autodeploy&#8221; tool that allows us to run SQL scripts automatically from SVN tags. \u00a0Developers have a faster way to run SQL without imposing on DBAs, and DBAs have their valuable time freed up for more important work. \u00a0We have never looked back. \u00a0I&#8217;m hoping Launchpad will do the same with application deployments. \u00a0Onward!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Capistrano is a great tool for building scripts that execute on remote hosts. \u00a0While its functionality lends itself to many different applications, it&#8217;s a de facto standard for deploying Ruby on Rails apps. \u00a0A few months ago, I used it &hellip; <a href=\"https:\/\/sites.nd.edu\/devops\/2014\/06\/27\/launchpad-a-rails-app-deployment-platform\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1550,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/users\/1550"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":6,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":369,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/posts\/361\/revisions\/369"}],"wp:attachment":[{"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.nd.edu\/devops\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}