{"action":"created","comment":{"url":"https://api.github.com/repos/appc/acbuild/pulls/comments/44735238","id":44735238,"diff_hunk":"@@ -0,0 +1,52 @@\n+# Bash scripts\n+\n+A common way to use acbuild is via a bash script. There's a common template\n+that the examples for acbuild follow, and it makes cleanup a little easier. The\n+template is at the end of this file, and here we explain the reasoning behind\n+the parts of it.\n+\n+The 1st line, `#!/usr/bin/env bash`, is simply good form to make sure the\n+script is executed with bash as opposed to the current shell.\n+\n+The 2nd line, `set -e` makes the script exit in the event of an error. If some\n+command doesn't exit correctly, due to something like a typo in a command, or\n+the command in `acbuild run` encountering an error, it is better to end the\n+script, instead of continuing on and producing an ACI with unintended values or\n+contents.\n+\n+The 4th through the 7th lines check if the script is being run as the root","path":"Documentation/bash-scripts.md","position":17,"original_position":17,"commit_id":"a80a539cf6fba9fb5fba093714d1cf150f9f2c82","original_commit_id":"a80a539cf6fba9fb5fba093714d1cf150f9f2c82","user":{"login":"joshix","id":72905,"avatar_url":"https://avatars.githubusercontent.com/u/72905?v=3","gravatar_id":"","url":"https://api.github.com/users/joshix","html_url":"https://github.com/joshix","followers_url":"https://api.github.com/users/joshix/followers","following_url":"https://api.github.com/users/joshix/following{/other_user}","gists_url":"https://api.github.com/users/joshix/gists{/gist_id}","starred_url":"https://api.github.com/users/joshix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshix/subscriptions","organizations_url":"https://api.github.com/users/joshix/orgs","repos_url":"https://api.github.com/users/joshix/repos","events_url":"https://api.github.com/users/joshix/events{/privacy}","received_events_url":"https://api.github.com/users/joshix/received_events","type":"User","site_admin":false},"body":"If we're `-e` bailing on any nonzero return, why can't we cut this paragraph and these lines from the script? If I'm not root, script will fail and bail if it turns out I need to be root for some step, right? In other words, can we just leave the user handling to the environment. Make any sense?","created_at":"2015-11-13T00:15:53Z","updated_at":"2015-11-13T00:15:53Z","html_url":"https://github.com/appc/acbuild/pull/100#discussion_r44735238","pull_request_url":"https://api.github.com/repos/appc/acbuild/pulls/100","_links":{"self":{"href":"https://api.github.com/repos/appc/acbuild/pulls/comments/44735238"},"html":{"href":"https://github.com/appc/acbuild/pull/100#discussion_r44735238"},"pull_request":{"href":"https://api.github.com/repos/appc/acbuild/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/appc/acbuild/pulls/100","id":50164784,"html_url":"https://github.com/appc/acbuild/pull/100","diff_url":"https://github.com/appc/acbuild/pull/100.diff","patch_url":"https://github.com/appc/acbuild/pull/100.patch","issue_url":"https://api.github.com/repos/appc/acbuild/issues/100","number":100,"state":"open","locked":false,"title":"docs: refactored README into Documentation directory","user":{"login":"dgonyeo","id":2439413,"avatar_url":"https://avatars.githubusercontent.com/u/2439413?v=3","gravatar_id":"","url":"https://api.github.com/users/dgonyeo","html_url":"https://github.com/dgonyeo","followers_url":"https://api.github.com/users/dgonyeo/followers","following_url":"https://api.github.com/users/dgonyeo/following{/other_user}","gists_url":"https://api.github.com/users/dgonyeo/gists{/gist_id}","starred_url":"https://api.github.com/users/dgonyeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgonyeo/subscriptions","organizations_url":"https://api.github.com/users/dgonyeo/orgs","repos_url":"https://api.github.com/users/dgonyeo/repos","events_url":"https://api.github.com/users/dgonyeo/events{/privacy}","received_events_url":"https://api.github.com/users/dgonyeo/received_events","type":"User","site_admin":false},"body":"README was tweaked and greatly shortened. Documentation directory was\r\nadded, which includes a getting started guide, a description of context\r\nfree mode, and a suggested template for acbuild scripts. Each subcommand\r\ngot its own markdown file detailing its features and quirks.\r\n\r\nFixes https://github.com/appc/acbuild/issues/97 https://github.com/appc/acbuild/issues/99 ","created_at":"2015-11-09T19:20:14Z","updated_at":"2015-11-13T00:15:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29fdfa7f7070ebbba7ef841e06cd892a245dfd1a","assignee":null,"milestone":{"url":"https://api.github.com/repos/appc/acbuild/milestones/2","html_url":"https://github.com/appc/acbuild/milestones/v0.2.0","labels_url":"https://api.github.com/repos/appc/acbuild/milestones/2/labels","id":1369436,"number":2,"title":"v0.2.0","description":"","creator":{"login":"jonboulle","id":2601015,"avatar_url":"https://avatars.githubusercontent.com/u/2601015?v=3","gravatar_id":"","url":"https://api.github.com/users/jonboulle","html_url":"https://github.com/jonboulle","followers_url":"https://api.github.com/users/jonboulle/followers","following_url":"https://api.github.com/users/jonboulle/following{/other_user}","gists_url":"https://api.github.com/users/jonboulle/gists{/gist_id}","starred_url":"https://api.github.com/users/jonboulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonboulle/subscriptions","organizations_url":"https://api.github.com/users/jonboulle/orgs","repos_url":"https://api.github.com/users/jonboulle/repos","events_url":"https://api.github.com/users/jonboulle/events{/privacy}","received_events_url":"https://api.github.com/users/jonboulle/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":6,"state":"open","created_at":"2015-10-21T23:36:52Z","updated_at":"2015-11-12T23:15:20Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/appc/acbuild/pulls/100/commits","review_comments_url":"https://api.github.com/repos/appc/acbuild/pulls/100/comments","review_comment_url":"https://api.github.com/repos/appc/acbuild/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appc/acbuild/issues/100/comments","statuses_url":"https://api.github.com/repos/appc/acbuild/statuses/a80a539cf6fba9fb5fba093714d1cf150f9f2c82","head":{"label":"dgonyeo:documentation","ref":"documentation","sha":"a80a539cf6fba9fb5fba093714d1cf150f9f2c82","user":{"login":"dgonyeo","id":2439413,"avatar_url":"https://avatars.githubusercontent.com/u/2439413?v=3","gravatar_id":"","url":"https://api.github.com/users/dgonyeo","html_url":"https://github.com/dgonyeo","followers_url":"https://api.github.com/users/dgonyeo/followers","following_url":"https://api.github.com/users/dgonyeo/following{/other_user}","gists_url":"https://api.github.com/users/dgonyeo/gists{/gist_id}","starred_url":"https://api.github.com/users/dgonyeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgonyeo/subscriptions","organizations_url":"https://api.github.com/users/dgonyeo/orgs","repos_url":"https://api.github.com/users/dgonyeo/repos","events_url":"https://api.github.com/users/dgonyeo/events{/privacy}","received_events_url":"https://api.github.com/users/dgonyeo/received_events","type":"User","site_admin":false},"repo":{"id":43033577,"name":"acbuild","full_name":"dgonyeo/acbuild","owner":{"login":"dgonyeo","id":2439413,"avatar_url":"https://avatars.githubusercontent.com/u/2439413?v=3","gravatar_id":"","url":"https://api.github.com/users/dgonyeo","html_url":"https://github.com/dgonyeo","followers_url":"https://api.github.com/users/dgonyeo/followers","following_url":"https://api.github.com/users/dgonyeo/following{/other_user}","gists_url":"https://api.github.com/users/dgonyeo/gists{/gist_id}","starred_url":"https://api.github.com/users/dgonyeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgonyeo/subscriptions","organizations_url":"https://api.github.com/users/dgonyeo/orgs","repos_url":"https://api.github.com/users/dgonyeo/repos","events_url":"https://api.github.com/users/dgonyeo/events{/privacy}","received_events_url":"https://api.github.com/users/dgonyeo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgonyeo/acbuild","description":"","fork":true,"url":"https://api.github.com/repos/dgonyeo/acbuild","forks_url":"https://api.github.com/repos/dgonyeo/acbuild/forks","keys_url":"https://api.github.com/repos/dgonyeo/acbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgonyeo/acbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgonyeo/acbuild/teams","hooks_url":"https://api.github.com/repos/dgonyeo/acbuild/hooks","issue_events_url":"https://api.github.com/repos/dgonyeo/acbuild/issues/events{/number}","events_url":"https://api.github.com/repos/dgonyeo/acbuild/events","assignees_url":"https://api.github.com/repos/dgonyeo/acbuild/assignees{/user}","branches_url":"https://api.github.com/repos/dgonyeo/acbuild/branches{/branch}","tags_url":"https://api.github.com/repos/dgonyeo/acbuild/tags","blobs_url":"https://api.github.com/repos/dgonyeo/acbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgonyeo/acbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgonyeo/acbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgonyeo/acbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgonyeo/acbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/dgonyeo/acbuild/languages","stargazers_url":"https://api.github.com/repos/dgonyeo/acbuild/stargazers","contributors_url":"https://api.github.com/repos/dgonyeo/acbuild/contributors","subscribers_url":"https://api.github.com/repos/dgonyeo/acbuild/subscribers","subscription_url":"https://api.github.com/repos/dgonyeo/acbuild/subscription","commits_url":"https://api.github.com/repos/dgonyeo/acbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgonyeo/acbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgonyeo/acbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgonyeo/acbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgonyeo/acbuild/contents/{+path}","compare_url":"https://api.github.com/repos/dgonyeo/acbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgonyeo/acbuild/merges","archive_url":"https://api.github.com/repos/dgonyeo/acbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgonyeo/acbuild/downloads","issues_url":"https://api.github.com/repos/dgonyeo/acbuild/issues{/number}","pulls_url":"https://api.github.com/repos/dgonyeo/acbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/dgonyeo/acbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/dgonyeo/acbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgonyeo/acbuild/labels{/name}","releases_url":"https://api.github.com/repos/dgonyeo/acbuild/releases{/id}","created_at":"2015-09-23T23:49:57Z","updated_at":"2015-09-24T00:03:34Z","pushed_at":"2015-11-12T23:15:21Z","git_url":"git://github.com/dgonyeo/acbuild.git","ssh_url":"git@github.com:dgonyeo/acbuild.git","clone_url":"https://github.com/dgonyeo/acbuild.git","svn_url":"https://github.com/dgonyeo/acbuild","homepage":null,"size":2143,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"appc:master","ref":"master","sha":"23b8d335a369e758dcd7cdb7cedcee07c5645604","user":{"login":"appc","id":10080092,"avatar_url":"https://avatars.githubusercontent.com/u/10080092?v=3","gravatar_id":"","url":"https://api.github.com/users/appc","html_url":"https://github.com/appc","followers_url":"https://api.github.com/users/appc/followers","following_url":"https://api.github.com/users/appc/following{/other_user}","gists_url":"https://api.github.com/users/appc/gists{/gist_id}","starred_url":"https://api.github.com/users/appc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appc/subscriptions","organizations_url":"https://api.github.com/users/appc/orgs","repos_url":"https://api.github.com/users/appc/repos","events_url":"https://api.github.com/users/appc/events{/privacy}","received_events_url":"https://api.github.com/users/appc/received_events","type":"Organization","site_admin":false},"repo":{"id":36900260,"name":"acbuild","full_name":"appc/acbuild","owner":{"login":"appc","id":10080092,"avatar_url":"https://avatars.githubusercontent.com/u/10080092?v=3","gravatar_id":"","url":"https://api.github.com/users/appc","html_url":"https://github.com/appc","followers_url":"https://api.github.com/users/appc/followers","following_url":"https://api.github.com/users/appc/following{/other_user}","gists_url":"https://api.github.com/users/appc/gists{/gist_id}","starred_url":"https://api.github.com/users/appc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appc/subscriptions","organizations_url":"https://api.github.com/users/appc/orgs","repos_url":"https://api.github.com/users/appc/repos","events_url":"https://api.github.com/users/appc/events{/privacy}","received_events_url":"https://api.github.com/users/appc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appc/acbuild","description":"a build tool for ACIs","fork":false,"url":"https://api.github.com/repos/appc/acbuild","forks_url":"https://api.github.com/repos/appc/acbuild/forks","keys_url":"https://api.github.com/repos/appc/acbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appc/acbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appc/acbuild/teams","hooks_url":"https://api.github.com/repos/appc/acbuild/hooks","issue_events_url":"https://api.github.com/repos/appc/acbuild/issues/events{/number}","events_url":"https://api.github.com/repos/appc/acbuild/events","assignees_url":"https://api.github.com/repos/appc/acbuild/assignees{/user}","branches_url":"https://api.github.com/repos/appc/acbuild/branches{/branch}","tags_url":"https://api.github.com/repos/appc/acbuild/tags","blobs_url":"https://api.github.com/repos/appc/acbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appc/acbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appc/acbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/appc/acbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appc/acbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/appc/acbuild/languages","stargazers_url":"https://api.github.com/repos/appc/acbuild/stargazers","contributors_url":"https://api.github.com/repos/appc/acbuild/contributors","subscribers_url":"https://api.github.com/repos/appc/acbuild/subscribers","subscription_url":"https://api.github.com/repos/appc/acbuild/subscription","commits_url":"https://api.github.com/repos/appc/acbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/appc/acbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/appc/acbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/appc/acbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/appc/acbuild/contents/{+path}","compare_url":"https://api.github.com/repos/appc/acbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appc/acbuild/merges","archive_url":"https://api.github.com/repos/appc/acbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appc/acbuild/downloads","issues_url":"https://api.github.com/repos/appc/acbuild/issues{/number}","pulls_url":"https://api.github.com/repos/appc/acbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/appc/acbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/appc/acbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appc/acbuild/labels{/name}","releases_url":"https://api.github.com/repos/appc/acbuild/releases{/id}","created_at":"2015-06-04T23:02:32Z","updated_at":"2015-11-11T21:38:25Z","pushed_at":"2015-11-12T23:15:20Z","git_url":"git://github.com/appc/acbuild.git","ssh_url":"git@github.com:appc/acbuild.git","clone_url":"https://github.com/appc/acbuild.git","svn_url":"https://github.com/appc/acbuild","homepage":"","size":6040,"stargazers_count":43,"watchers_count":43,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":24,"forks":15,"open_issues":24,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appc/acbuild/pulls/100"},"html":{"href":"https://github.com/appc/acbuild/pull/100"},"issue":{"href":"https://api.github.com/repos/appc/acbuild/issues/100"},"comments":{"href":"https://api.github.com/repos/appc/acbuild/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/appc/acbuild/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/appc/acbuild/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appc/acbuild/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/appc/acbuild/statuses/a80a539cf6fba9fb5fba093714d1cf150f9f2c82"}}}}