{"action":"created","comment":{"url":"https://api.github.com/repos/acquia/moonshot/pulls/comments/78813208","id":78813208,"diff_hunk":"@@ -0,0 +1,90 @@\n+# Auto-Scaling Group LaunchConfig Rollout Tool\n+\n+## Overview\n+\n+This plugin adds support for rolling out changes to Auto Scaling\n+Groups that have happened after a stack update. It supports various\n+pre- and post-actions on the instances (using Moonshot's native SSH\n+support).\n+\n+## Example\n+\n+The ASGRollout class is intended to be used within a method in your\n+project's derived class of the Moonshot::CLI class.\n+\n+```ruby\n+#!/usr/bin/env ruby\n+\n+require 'moonshot'\n+\n+class MyService < Moonshot::CLI\n+  # .. normal configuration ..\n+\n+  desc :asg_rollout, 'Update instances in the Auto Scaling Group'\n+  def asg_rollout\n+    ar = Moonshot::Tools::ASGRollout.new do |config|\n+      config.controller = controller\n+      config.logical_id = 'APIAutoScalingGroup'\n+\n+      # Trigger the worker process to initiate a clean shutdown.\n+      config.predetach = -> { 0 == exec('systemctl stop my-worker-1') }\n+\n+      # Wait for that clean shutdown to happen.\n+      config.terminate_when = -> { 0 == exec('pgrep -f my-worker-1') }\n+    end\n+    ar.run!\n+  end\n+end\n+\n+MyService.start\n+```\n+\n+## Configuration\n+\n+The ASGRollout object accepts two required keyword arguments:\n+  - **controller**: A Moonshot::Controller. If you are using\n+    Moonshot::CLI the `controller` method is most often when you want\n+    to use.\n+  - **logical_id**: The Logical resource ID from the CloudFormation\n+    stack to operate on.\n+\n+By default, the ASGRollout class will build a list of instances with\n+non-conforming LaunchConfiguration, then one at a time perform the\n+following actions:\n+  1. Increase the *Max* and *Desired* sizes of the Auto Scaling Group by one.\n+  2. Wait for the new instance to be *InService*.\n+  3. Detach a non-conforming instance.\n+  4. Wait for the instance to be *OutOfService* or removed from the\n+     Auto Scaling Group.\n+  5. If the Auto Scaling Group has an associated Elastic Load\n+     Balancer, wait for the instance to be *Todo?* there as well.\n+  6. Wait for a new instance to replace it.\n+  7. Wait for that new instance to be *InService* in the Auto Scaling Group.\n+  8. If the Auto Scaling Group has an associated Elastic Load\n+     Balancer, wait for the instance to be *InService* there as well.\n+  9. Terminate the detached non-conforming instance.","path":"docs/plugins/asg_rollout.md","position":65,"original_position":65,"commit_id":"0931254a5867fd44cafdf9537259c90ea0722782","original_commit_id":"0931254a5867fd44cafdf9537259c90ea0722782","user":{"login":"askreet","id":662824,"avatar_url":"https://avatars.githubusercontent.com/u/662824?v=3","gravatar_id":"","url":"https://api.github.com/users/askreet","html_url":"https://github.com/askreet","followers_url":"https://api.github.com/users/askreet/followers","following_url":"https://api.github.com/users/askreet/following{/other_user}","gists_url":"https://api.github.com/users/askreet/gists{/gist_id}","starred_url":"https://api.github.com/users/askreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/askreet/subscriptions","organizations_url":"https://api.github.com/users/askreet/orgs","repos_url":"https://api.github.com/users/askreet/repos","events_url":"https://api.github.com/users/askreet/events{/privacy}","received_events_url":"https://api.github.com/users/askreet/received_events","type":"User","site_admin":false},"body":"It does not. As i'm implementing, I'm thinking there's no value in having both `terminate` and `terminate_when`. The user can implement steps to terminate, which may include waiting or may include running shutdown blindly. I'm going that route.","created_at":"2016-09-14T18:55:07Z","updated_at":"2016-09-14T18:55:12Z","html_url":"https://github.com/acquia/moonshot/pull/124#discussion_r78813208","pull_request_url":"https://api.github.com/repos/acquia/moonshot/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/comments/78813208"},"html":{"href":"https://github.com/acquia/moonshot/pull/124#discussion_r78813208"},"pull_request":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/acquia/moonshot/pulls/124","id":85153694,"html_url":"https://github.com/acquia/moonshot/pull/124","diff_url":"https://github.com/acquia/moonshot/pull/124.diff","patch_url":"https://github.com/acquia/moonshot/pull/124.patch","issue_url":"https://api.github.com/repos/acquia/moonshot/issues/124","number":124,"state":"open","locked":false,"title":"Add documentation concept for ASG Rollout feature.","user":{"login":"askreet","id":662824,"avatar_url":"https://avatars.githubusercontent.com/u/662824?v=3","gravatar_id":"","url":"https://api.github.com/users/askreet","html_url":"https://github.com/askreet","followers_url":"https://api.github.com/users/askreet/followers","following_url":"https://api.github.com/users/askreet/following{/other_user}","gists_url":"https://api.github.com/users/askreet/gists{/gist_id}","starred_url":"https://api.github.com/users/askreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/askreet/subscriptions","organizations_url":"https://api.github.com/users/askreet/orgs","repos_url":"https://api.github.com/users/askreet/repos","events_url":"https://api.github.com/users/askreet/events{/privacy}","received_events_url":"https://api.github.com/users/askreet/received_events","type":"User","site_admin":false},"body":"I'm beginning development on a plugin to core moonshot that will enable a command which rolls out launch configuration update in environments where using something as simple as CloudFormation's UpdatePolicy is not an option.\r\n\r\nI wrote the documentation first, just to get some feedback and solidify my ideas. I don't intend to commit this PR without an implementation, just soliciting feedback.\r\n\r\nThanks!","created_at":"2016-09-14T01:34:53Z","updated_at":"2016-09-14T18:55:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"020fd7f3577e24158d91056380a9ede1a09c6b69","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/acquia/moonshot/pulls/124/commits","review_comments_url":"https://api.github.com/repos/acquia/moonshot/pulls/124/comments","review_comment_url":"https://api.github.com/repos/acquia/moonshot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acquia/moonshot/issues/124/comments","statuses_url":"https://api.github.com/repos/acquia/moonshot/statuses/0931254a5867fd44cafdf9537259c90ea0722782","head":{"label":"acquia:ASGRolloutFeature","ref":"ASGRolloutFeature","sha":"0931254a5867fd44cafdf9537259c90ea0722782","user":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"repo":{"id":53524088,"name":"moonshot","full_name":"acquia/moonshot","owner":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquia/moonshot","description":"Moonshot: Because releasing services shouldn't be a moonshot!","fork":false,"url":"https://api.github.com/repos/acquia/moonshot","forks_url":"https://api.github.com/repos/acquia/moonshot/forks","keys_url":"https://api.github.com/repos/acquia/moonshot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquia/moonshot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquia/moonshot/teams","hooks_url":"https://api.github.com/repos/acquia/moonshot/hooks","issue_events_url":"https://api.github.com/repos/acquia/moonshot/issues/events{/number}","events_url":"https://api.github.com/repos/acquia/moonshot/events","assignees_url":"https://api.github.com/repos/acquia/moonshot/assignees{/user}","branches_url":"https://api.github.com/repos/acquia/moonshot/branches{/branch}","tags_url":"https://api.github.com/repos/acquia/moonshot/tags","blobs_url":"https://api.github.com/repos/acquia/moonshot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquia/moonshot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquia/moonshot/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquia/moonshot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquia/moonshot/statuses/{sha}","languages_url":"https://api.github.com/repos/acquia/moonshot/languages","stargazers_url":"https://api.github.com/repos/acquia/moonshot/stargazers","contributors_url":"https://api.github.com/repos/acquia/moonshot/contributors","subscribers_url":"https://api.github.com/repos/acquia/moonshot/subscribers","subscription_url":"https://api.github.com/repos/acquia/moonshot/subscription","commits_url":"https://api.github.com/repos/acquia/moonshot/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquia/moonshot/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquia/moonshot/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquia/moonshot/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquia/moonshot/contents/{+path}","compare_url":"https://api.github.com/repos/acquia/moonshot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquia/moonshot/merges","archive_url":"https://api.github.com/repos/acquia/moonshot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquia/moonshot/downloads","issues_url":"https://api.github.com/repos/acquia/moonshot/issues{/number}","pulls_url":"https://api.github.com/repos/acquia/moonshot/pulls{/number}","milestones_url":"https://api.github.com/repos/acquia/moonshot/milestones{/number}","notifications_url":"https://api.github.com/repos/acquia/moonshot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquia/moonshot/labels{/name}","releases_url":"https://api.github.com/repos/acquia/moonshot/releases{/id}","deployments_url":"https://api.github.com/repos/acquia/moonshot/deployments","created_at":"2016-03-09T19:06:23Z","updated_at":"2016-08-29T16:42:36Z","pushed_at":"2016-09-14T17:11:12Z","git_url":"git://github.com/acquia/moonshot.git","ssh_url":"git@github.com:acquia/moonshot.git","clone_url":"https://github.com/acquia/moonshot.git","svn_url":"https://github.com/acquia/moonshot","homepage":null,"size":288,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":47,"forks":18,"open_issues":47,"watchers":40,"default_branch":"master"}},"base":{"label":"acquia:master","ref":"master","sha":"d5eb3ba5176e6c39dd352a2cdece48fece9c9d60","user":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"repo":{"id":53524088,"name":"moonshot","full_name":"acquia/moonshot","owner":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquia/moonshot","description":"Moonshot: Because releasing services shouldn't be a moonshot!","fork":false,"url":"https://api.github.com/repos/acquia/moonshot","forks_url":"https://api.github.com/repos/acquia/moonshot/forks","keys_url":"https://api.github.com/repos/acquia/moonshot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquia/moonshot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquia/moonshot/teams","hooks_url":"https://api.github.com/repos/acquia/moonshot/hooks","issue_events_url":"https://api.github.com/repos/acquia/moonshot/issues/events{/number}","events_url":"https://api.github.com/repos/acquia/moonshot/events","assignees_url":"https://api.github.com/repos/acquia/moonshot/assignees{/user}","branches_url":"https://api.github.com/repos/acquia/moonshot/branches{/branch}","tags_url":"https://api.github.com/repos/acquia/moonshot/tags","blobs_url":"https://api.github.com/repos/acquia/moonshot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquia/moonshot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquia/moonshot/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquia/moonshot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquia/moonshot/statuses/{sha}","languages_url":"https://api.github.com/repos/acquia/moonshot/languages","stargazers_url":"https://api.github.com/repos/acquia/moonshot/stargazers","contributors_url":"https://api.github.com/repos/acquia/moonshot/contributors","subscribers_url":"https://api.github.com/repos/acquia/moonshot/subscribers","subscription_url":"https://api.github.com/repos/acquia/moonshot/subscription","commits_url":"https://api.github.com/repos/acquia/moonshot/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquia/moonshot/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquia/moonshot/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquia/moonshot/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquia/moonshot/contents/{+path}","compare_url":"https://api.github.com/repos/acquia/moonshot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquia/moonshot/merges","archive_url":"https://api.github.com/repos/acquia/moonshot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquia/moonshot/downloads","issues_url":"https://api.github.com/repos/acquia/moonshot/issues{/number}","pulls_url":"https://api.github.com/repos/acquia/moonshot/pulls{/number}","milestones_url":"https://api.github.com/repos/acquia/moonshot/milestones{/number}","notifications_url":"https://api.github.com/repos/acquia/moonshot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquia/moonshot/labels{/name}","releases_url":"https://api.github.com/repos/acquia/moonshot/releases{/id}","deployments_url":"https://api.github.com/repos/acquia/moonshot/deployments","created_at":"2016-03-09T19:06:23Z","updated_at":"2016-08-29T16:42:36Z","pushed_at":"2016-09-14T17:11:12Z","git_url":"git://github.com/acquia/moonshot.git","ssh_url":"git@github.com:acquia/moonshot.git","clone_url":"https://github.com/acquia/moonshot.git","svn_url":"https://github.com/acquia/moonshot","homepage":null,"size":288,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":47,"forks":18,"open_issues":47,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/124"},"html":{"href":"https://github.com/acquia/moonshot/pull/124"},"issue":{"href":"https://api.github.com/repos/acquia/moonshot/issues/124"},"comments":{"href":"https://api.github.com/repos/acquia/moonshot/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/acquia/moonshot/statuses/0931254a5867fd44cafdf9537259c90ea0722782"}}}}
{"actor":{"display_login":"askreet"}}