{"action":"created","comment":{"url":"https://api.github.com/repos/acquia/moonshot/pulls/comments/66453341","id":66453341,"diff_hunk":"@@ -0,0 +1,56 @@\n+# Moonshot backup plugin\n+\n+Moonshot plugin for backing up config files.\n+\n+## Functionality\n+\n+The plugin collects and deflates certain files to a single tarball,\n+and uploads that to a a given S3 bucket. The whole process happens\n+in memory, nothing is written to disk. The plugin currently supports single files only, \n+including whole directories in your tarball is not possible yet.\n+\n+The plugin uses the Moonshot AWS config, meaning that the bucket must be\n+present in the same account and region as your deployment.\n+\n+## Basic usage\n+\n+When instantiating a class, you need to set the following options\n+in a block, where the object is provided as a block argument:\n+\n+- `base_path`: the absolute path of your project directory\n+- `bucket`: the name of the S3 bucket you wish to upload the tarball\n+- `files`: a hash with two mandatory and one mandatory value:\n+  - `path` (mandatory): file path as an array, relative to the base path\n+  - `name` (mandatory): name of the file\n+  - `permission` (optional): permission in the target tarball, defaults to `0644`\n+- `hooks`: which hooks to run the backup logic, works with all valid Moonshot hooks\n+- `target_name`: tarball archive name, default: `<app_name>_<timestamp>_<user>.tar.gz`\n+\n+## Placeholders\n+\n+You can use the following placeholders both in your filenames\n+and tarball target names (meanings are pretty self explaining):\n+\n+- `<app_name>`\n+- `<stack_name>`\n+- `<timestamp>`\n+- `<user>`\n+\n+## Example\n+\n+A possible use-case is backing up a CF template and/or\n+parameter file after create or update.\n+\n+```ruby\n+plugin(\n+  Backup.new do |b|\n+    b.base_path = File.expand_path(\"..\", __dir__)\n+    b.bucket = 'acquia-cloud-database-test'\n+    b.files = [\n+      { path: ['cloud_formation'], name: \"<app_name>.json\" },\n+      { path: ['cloud_formation', 'parameters'], name: \"<stack_name>.yml\" }","path":"docs/plugins/backup.md","position":51,"original_position":51,"commit_id":"d0dd3b0333047cd56d574059cbe2d7cda7fea3fa","original_commit_id":"d0dd3b0333047cd56d574059cbe2d7cda7fea3fa","user":{"login":"gergelyborsothy","id":1119941,"avatar_url":"https://avatars.githubusercontent.com/u/1119941?v=3","gravatar_id":"","url":"https://api.github.com/users/gergelyborsothy","html_url":"https://github.com/gergelyborsothy","followers_url":"https://api.github.com/users/gergelyborsothy/followers","following_url":"https://api.github.com/users/gergelyborsothy/following{/other_user}","gists_url":"https://api.github.com/users/gergelyborsothy/gists{/gist_id}","starred_url":"https://api.github.com/users/gergelyborsothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergelyborsothy/subscriptions","organizations_url":"https://api.github.com/users/gergelyborsothy/orgs","repos_url":"https://api.github.com/users/gergelyborsothy/repos","events_url":"https://api.github.com/users/gergelyborsothy/events{/privacy}","received_events_url":"https://api.github.com/users/gergelyborsothy/received_events","type":"User","site_admin":false},"body":"Not anymore. I was preparing this would be a separate plugin as a gem, located somewhere completely else. I think I'm actually gonna remove `base_path`, and just use relatives.","created_at":"2016-06-09T14:39:26Z","updated_at":"2016-06-09T14:39:26Z","html_url":"https://github.com/acquia/moonshot/pull/103#discussion_r66453341","pull_request_url":"https://api.github.com/repos/acquia/moonshot/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/comments/66453341"},"html":{"href":"https://github.com/acquia/moonshot/pull/103#discussion_r66453341"},"pull_request":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/acquia/moonshot/pulls/103","id":73174415,"html_url":"https://github.com/acquia/moonshot/pull/103","diff_url":"https://github.com/acquia/moonshot/pull/103.diff","patch_url":"https://github.com/acquia/moonshot/pull/103.patch","issue_url":"https://api.github.com/repos/acquia/moonshot/issues/103","number":103,"state":"open","locked":false,"title":"Adding backup plugin","user":{"login":"gergelyborsothy","id":1119941,"avatar_url":"https://avatars.githubusercontent.com/u/1119941?v=3","gravatar_id":"","url":"https://api.github.com/users/gergelyborsothy","html_url":"https://github.com/gergelyborsothy","followers_url":"https://api.github.com/users/gergelyborsothy/followers","following_url":"https://api.github.com/users/gergelyborsothy/following{/other_user}","gists_url":"https://api.github.com/users/gergelyborsothy/gists{/gist_id}","starred_url":"https://api.github.com/users/gergelyborsothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergelyborsothy/subscriptions","organizations_url":"https://api.github.com/users/gergelyborsothy/orgs","repos_url":"https://api.github.com/users/gergelyborsothy/repos","events_url":"https://api.github.com/users/gergelyborsothy/events{/privacy}","received_events_url":"https://api.github.com/users/gergelyborsothy/received_events","type":"User","site_admin":false},"body":"This is rather an initial concept. Please review with extra care.","created_at":"2016-06-09T08:27:24Z","updated_at":"2016-06-09T14:39:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cce77eae99867c565d4fb05072bd8d2c38575f0e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/acquia/moonshot/pulls/103/commits","review_comments_url":"https://api.github.com/repos/acquia/moonshot/pulls/103/comments","review_comment_url":"https://api.github.com/repos/acquia/moonshot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acquia/moonshot/issues/103/comments","statuses_url":"https://api.github.com/repos/acquia/moonshot/statuses/d0dd3b0333047cd56d574059cbe2d7cda7fea3fa","head":{"label":"gergelyborsothy:BackupPlugin","ref":"BackupPlugin","sha":"d0dd3b0333047cd56d574059cbe2d7cda7fea3fa","user":{"login":"gergelyborsothy","id":1119941,"avatar_url":"https://avatars.githubusercontent.com/u/1119941?v=3","gravatar_id":"","url":"https://api.github.com/users/gergelyborsothy","html_url":"https://github.com/gergelyborsothy","followers_url":"https://api.github.com/users/gergelyborsothy/followers","following_url":"https://api.github.com/users/gergelyborsothy/following{/other_user}","gists_url":"https://api.github.com/users/gergelyborsothy/gists{/gist_id}","starred_url":"https://api.github.com/users/gergelyborsothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergelyborsothy/subscriptions","organizations_url":"https://api.github.com/users/gergelyborsothy/orgs","repos_url":"https://api.github.com/users/gergelyborsothy/repos","events_url":"https://api.github.com/users/gergelyborsothy/events{/privacy}","received_events_url":"https://api.github.com/users/gergelyborsothy/received_events","type":"User","site_admin":false},"repo":{"id":59117799,"name":"moonshot","full_name":"gergelyborsothy/moonshot","owner":{"login":"gergelyborsothy","id":1119941,"avatar_url":"https://avatars.githubusercontent.com/u/1119941?v=3","gravatar_id":"","url":"https://api.github.com/users/gergelyborsothy","html_url":"https://github.com/gergelyborsothy","followers_url":"https://api.github.com/users/gergelyborsothy/followers","following_url":"https://api.github.com/users/gergelyborsothy/following{/other_user}","gists_url":"https://api.github.com/users/gergelyborsothy/gists{/gist_id}","starred_url":"https://api.github.com/users/gergelyborsothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergelyborsothy/subscriptions","organizations_url":"https://api.github.com/users/gergelyborsothy/orgs","repos_url":"https://api.github.com/users/gergelyborsothy/repos","events_url":"https://api.github.com/users/gergelyborsothy/events{/privacy}","received_events_url":"https://api.github.com/users/gergelyborsothy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gergelyborsothy/moonshot","description":"Moonshot: Because releasing services shouldn't be a moonshot!","fork":true,"url":"https://api.github.com/repos/gergelyborsothy/moonshot","forks_url":"https://api.github.com/repos/gergelyborsothy/moonshot/forks","keys_url":"https://api.github.com/repos/gergelyborsothy/moonshot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gergelyborsothy/moonshot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gergelyborsothy/moonshot/teams","hooks_url":"https://api.github.com/repos/gergelyborsothy/moonshot/hooks","issue_events_url":"https://api.github.com/repos/gergelyborsothy/moonshot/issues/events{/number}","events_url":"https://api.github.com/repos/gergelyborsothy/moonshot/events","assignees_url":"https://api.github.com/repos/gergelyborsothy/moonshot/assignees{/user}","branches_url":"https://api.github.com/repos/gergelyborsothy/moonshot/branches{/branch}","tags_url":"https://api.github.com/repos/gergelyborsothy/moonshot/tags","blobs_url":"https://api.github.com/repos/gergelyborsothy/moonshot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gergelyborsothy/moonshot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gergelyborsothy/moonshot/git/refs{/sha}","trees_url":"https://api.github.com/repos/gergelyborsothy/moonshot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gergelyborsothy/moonshot/statuses/{sha}","languages_url":"https://api.github.com/repos/gergelyborsothy/moonshot/languages","stargazers_url":"https://api.github.com/repos/gergelyborsothy/moonshot/stargazers","contributors_url":"https://api.github.com/repos/gergelyborsothy/moonshot/contributors","subscribers_url":"https://api.github.com/repos/gergelyborsothy/moonshot/subscribers","subscription_url":"https://api.github.com/repos/gergelyborsothy/moonshot/subscription","commits_url":"https://api.github.com/repos/gergelyborsothy/moonshot/commits{/sha}","git_commits_url":"https://api.github.com/repos/gergelyborsothy/moonshot/git/commits{/sha}","comments_url":"https://api.github.com/repos/gergelyborsothy/moonshot/comments{/number}","issue_comment_url":"https://api.github.com/repos/gergelyborsothy/moonshot/issues/comments{/number}","contents_url":"https://api.github.com/repos/gergelyborsothy/moonshot/contents/{+path}","compare_url":"https://api.github.com/repos/gergelyborsothy/moonshot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gergelyborsothy/moonshot/merges","archive_url":"https://api.github.com/repos/gergelyborsothy/moonshot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gergelyborsothy/moonshot/downloads","issues_url":"https://api.github.com/repos/gergelyborsothy/moonshot/issues{/number}","pulls_url":"https://api.github.com/repos/gergelyborsothy/moonshot/pulls{/number}","milestones_url":"https://api.github.com/repos/gergelyborsothy/moonshot/milestones{/number}","notifications_url":"https://api.github.com/repos/gergelyborsothy/moonshot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gergelyborsothy/moonshot/labels{/name}","releases_url":"https://api.github.com/repos/gergelyborsothy/moonshot/releases{/id}","deployments_url":"https://api.github.com/repos/gergelyborsothy/moonshot/deployments","created_at":"2016-05-18T13:25:25Z","updated_at":"2016-05-18T13:25:26Z","pushed_at":"2016-06-09T13:36:35Z","git_url":"git://github.com/gergelyborsothy/moonshot.git","ssh_url":"git@github.com:gergelyborsothy/moonshot.git","clone_url":"https://github.com/gergelyborsothy/moonshot.git","svn_url":"https://github.com/gergelyborsothy/moonshot","homepage":null,"size":216,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"acquia:master","ref":"master","sha":"7660fb2b9ddca5f9114dba2218b22f0146805206","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-05-11T19:34:12Z","pushed_at":"2016-06-09T13:36:35Z","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":227,"stargazers_count":38,"watchers_count":38,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":44,"forks":14,"open_issues":44,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/103"},"html":{"href":"https://github.com/acquia/moonshot/pull/103"},"issue":{"href":"https://api.github.com/repos/acquia/moonshot/issues/103"},"comments":{"href":"https://api.github.com/repos/acquia/moonshot/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acquia/moonshot/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/acquia/moonshot/statuses/d0dd3b0333047cd56d574059cbe2d7cda7fea3fa"}}}}
{"actor":{"display_login":"gergelyborsothy"}}