{"action":"created","comment":{"url":"https://api.github.com/repos/chain/chain/pulls/comments/89194864","pull_request_review_id":9741609,"id":89194864,"diff_hunk":"@@ -0,0 +1,57 @@\n+#!/bin/sh\n+set -e\n+\n+usage() {\n+  echo \"Usage: $0 <releaseRef> <outputDir>\"\n+  echo\n+  echo \"Envvars:\"\n+  echo \"GOOS:   target OS\"\n+  echo \"GOARCH: target CPU architecture\"\n+  echo \"DATE:   build date; defaults to now\"\n+  exit 1\n+}\n+\n+trap usage ERR\n+\n+if [ -z \"$1\" -o -z \"$2\" ]; then\n+  usage\n+fi\n+\n+releaseRef=$1\n+cd $2; outputDir=`pwd` # verify output dir and expand to absolute\n+\n+echo \"Building ref $releaseRef to output directory $outputDir...\"\n+\n+# Clone repository into tempdir and check out specified release ref.\n+buildGoPath=`mktemp -d`\n+trap \"rm -rf $buildGoPath\" EXIT\n+\n+newChain=$buildGoPath/src/chain\n+mkdir -p $newChain\n+git clone $CHAIN $newChain\n+cd $newChain\n+git checkout $releaseRef\n+\n+# Cross-compilation args for cored and corectl\n+export GOPATH=$buildGoPath\n+export GOOS\n+export GOARCH","path":"bin/build-cored-release","position":38,"original_position":38,"commit_id":"b289715c065546e1752ae91c4f0550b5886f8d07","original_commit_id":"b289715c065546e1752ae91c4f0550b5886f8d07","user":{"login":"boymanjor","id":1259462,"avatar_url":"https://avatars.githubusercontent.com/u/1259462?v=3","gravatar_id":"","url":"https://api.github.com/users/boymanjor","html_url":"https://github.com/boymanjor","followers_url":"https://api.github.com/users/boymanjor/followers","following_url":"https://api.github.com/users/boymanjor/following{/other_user}","gists_url":"https://api.github.com/users/boymanjor/gists{/gist_id}","starred_url":"https://api.github.com/users/boymanjor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boymanjor/subscriptions","organizations_url":"https://api.github.com/users/boymanjor/orgs","repos_url":"https://api.github.com/users/boymanjor/repos","events_url":"https://api.github.com/users/boymanjor/events{/privacy}","received_events_url":"https://api.github.com/users/boymanjor/received_events","type":"User","site_admin":false},"body":"Currently, I don't think this script will fail if `GOOS` and `GOARCH` are not set. You can assert them with the following statements:\r\n```\r\n: ${GOOS:?\"some error text\"}\r\n: ${GOARCH:?\"some error text\"}\r\n```\r\nI also don't think you need to re-export them since they are passed in as env vars.","created_at":"2016-11-22T19:42:19Z","updated_at":"2016-11-22T19:57:33Z","html_url":"https://github.com/chain/chain/pull/275#discussion_r89194864","pull_request_url":"https://api.github.com/repos/chain/chain/pulls/275","_links":{"self":{"href":"https://api.github.com/repos/chain/chain/pulls/comments/89194864"},"html":{"href":"https://github.com/chain/chain/pull/275#discussion_r89194864"},"pull_request":{"href":"https://api.github.com/repos/chain/chain/pulls/275"}}},"pull_request":{"url":"https://api.github.com/repos/chain/chain/pulls/275","id":94735937,"html_url":"https://github.com/chain/chain/pull/275","diff_url":"https://github.com/chain/chain/pull/275.diff","patch_url":"https://github.com/chain/chain/pull/275.patch","issue_url":"https://api.github.com/repos/chain/chain/issues/275","number":275,"state":"open","locked":false,"title":"cmd/build-cored-release: new command","user":{"login":"jeffomatic","id":464857,"avatar_url":"https://avatars.githubusercontent.com/u/464857?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffomatic","html_url":"https://github.com/jeffomatic","followers_url":"https://api.github.com/users/jeffomatic/followers","following_url":"https://api.github.com/users/jeffomatic/following{/other_user}","gists_url":"https://api.github.com/users/jeffomatic/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffomatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffomatic/subscriptions","organizations_url":"https://api.github.com/users/jeffomatic/orgs","repos_url":"https://api.github.com/users/jeffomatic/repos","events_url":"https://api.github.com/users/jeffomatic/events{/privacy}","received_events_url":"https://api.github.com/users/jeffomatic/received_events","type":"User","site_admin":false},"body":"build-cored-release compiles or cross-compiles cored and corectl\r\nat the specified ref. Its main use case is within automated build\r\nscripts that generate installer packages.\r\n\r\nUsage is as follows:\r\n\r\n```\r\nbuild-cored-release <releaseRef> <outputPath>\r\n```\r\n\r\n- releaseRef must be a valid git ref in the locally-cloned repo.\r\n- outputPath must be a valid absolute or relative directory.\r\n\r\nIf releaseRef follows the conventional pattern for official\r\nreleases (`cmd.cored-x.y.z`), then cored will be built with a\r\nbuildTag value of `x.y.z`. Otherwise, the buildTag value will be\r\nequal to the releaseRef.\r\n\r\nOptional parameters are specified via environment variables:\r\n\r\n- GOOS\r\n- GOARCH\r\n- DATE: a value for the buildTag tag. By default, the current time\r\n  is used.","created_at":"2016-11-22T02:16:01Z","updated_at":"2016-11-22T19:57:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d2ae9c10e4af2a7cd4f0759de0efe504538a579","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chain/chain/pulls/275/commits","review_comments_url":"https://api.github.com/repos/chain/chain/pulls/275/comments","review_comment_url":"https://api.github.com/repos/chain/chain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chain/chain/issues/275/comments","statuses_url":"https://api.github.com/repos/chain/chain/statuses/b289715c065546e1752ae91c4f0550b5886f8d07","head":{"label":"chain:build-cored-release","ref":"build-cored-release","sha":"b289715c065546e1752ae91c4f0550b5886f8d07","user":{"login":"chain","id":412728,"avatar_url":"https://avatars.githubusercontent.com/u/412728?v=3","gravatar_id":"","url":"https://api.github.com/users/chain","html_url":"https://github.com/chain","followers_url":"https://api.github.com/users/chain/followers","following_url":"https://api.github.com/users/chain/following{/other_user}","gists_url":"https://api.github.com/users/chain/gists{/gist_id}","starred_url":"https://api.github.com/users/chain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chain/subscriptions","organizations_url":"https://api.github.com/users/chain/orgs","repos_url":"https://api.github.com/users/chain/repos","events_url":"https://api.github.com/users/chain/events{/privacy}","received_events_url":"https://api.github.com/users/chain/received_events","type":"Organization","site_admin":false},"repo":{"id":71740230,"name":"chain","full_name":"chain/chain","owner":{"login":"chain","id":412728,"avatar_url":"https://avatars.githubusercontent.com/u/412728?v=3","gravatar_id":"","url":"https://api.github.com/users/chain","html_url":"https://github.com/chain","followers_url":"https://api.github.com/users/chain/followers","following_url":"https://api.github.com/users/chain/following{/other_user}","gists_url":"https://api.github.com/users/chain/gists{/gist_id}","starred_url":"https://api.github.com/users/chain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chain/subscriptions","organizations_url":"https://api.github.com/users/chain/orgs","repos_url":"https://api.github.com/users/chain/repos","events_url":"https://api.github.com/users/chain/events{/privacy}","received_events_url":"https://api.github.com/users/chain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chain/chain","description":"Chain Core Developer Edition","fork":false,"url":"https://api.github.com/repos/chain/chain","forks_url":"https://api.github.com/repos/chain/chain/forks","keys_url":"https://api.github.com/repos/chain/chain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chain/chain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chain/chain/teams","hooks_url":"https://api.github.com/repos/chain/chain/hooks","issue_events_url":"https://api.github.com/repos/chain/chain/issues/events{/number}","events_url":"https://api.github.com/repos/chain/chain/events","assignees_url":"https://api.github.com/repos/chain/chain/assignees{/user}","branches_url":"https://api.github.com/repos/chain/chain/branches{/branch}","tags_url":"https://api.github.com/repos/chain/chain/tags","blobs_url":"https://api.github.com/repos/chain/chain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chain/chain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chain/chain/git/refs{/sha}","trees_url":"https://api.github.com/repos/chain/chain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chain/chain/statuses/{sha}","languages_url":"https://api.github.com/repos/chain/chain/languages","stargazers_url":"https://api.github.com/repos/chain/chain/stargazers","contributors_url":"https://api.github.com/repos/chain/chain/contributors","subscribers_url":"https://api.github.com/repos/chain/chain/subscribers","subscription_url":"https://api.github.com/repos/chain/chain/subscription","commits_url":"https://api.github.com/repos/chain/chain/commits{/sha}","git_commits_url":"https://api.github.com/repos/chain/chain/git/commits{/sha}","comments_url":"https://api.github.com/repos/chain/chain/comments{/number}","issue_comment_url":"https://api.github.com/repos/chain/chain/issues/comments{/number}","contents_url":"https://api.github.com/repos/chain/chain/contents/{+path}","compare_url":"https://api.github.com/repos/chain/chain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chain/chain/merges","archive_url":"https://api.github.com/repos/chain/chain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chain/chain/downloads","issues_url":"https://api.github.com/repos/chain/chain/issues{/number}","pulls_url":"https://api.github.com/repos/chain/chain/pulls{/number}","milestones_url":"https://api.github.com/repos/chain/chain/milestones{/number}","notifications_url":"https://api.github.com/repos/chain/chain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chain/chain/labels{/name}","releases_url":"https://api.github.com/repos/chain/chain/releases{/id}","deployments_url":"https://api.github.com/repos/chain/chain/deployments","created_at":"2016-10-24T01:12:26Z","updated_at":"2016-11-22T11:17:12Z","pushed_at":"2016-11-22T19:46:58Z","git_url":"git://github.com/chain/chain.git","ssh_url":"git@github.com:chain/chain.git","clone_url":"https://github.com/chain/chain.git","svn_url":"https://github.com/chain/chain","homepage":"https://chain.com","size":101531,"stargazers_count":625,"watchers_count":625,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":17,"forks":76,"open_issues":17,"watchers":625,"default_branch":"main"}},"base":{"label":"chain:main","ref":"main","sha":"0eb8a553cca8c78643313b163086ef17343d5088","user":{"login":"chain","id":412728,"avatar_url":"https://avatars.githubusercontent.com/u/412728?v=3","gravatar_id":"","url":"https://api.github.com/users/chain","html_url":"https://github.com/chain","followers_url":"https://api.github.com/users/chain/followers","following_url":"https://api.github.com/users/chain/following{/other_user}","gists_url":"https://api.github.com/users/chain/gists{/gist_id}","starred_url":"https://api.github.com/users/chain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chain/subscriptions","organizations_url":"https://api.github.com/users/chain/orgs","repos_url":"https://api.github.com/users/chain/repos","events_url":"https://api.github.com/users/chain/events{/privacy}","received_events_url":"https://api.github.com/users/chain/received_events","type":"Organization","site_admin":false},"repo":{"id":71740230,"name":"chain","full_name":"chain/chain","owner":{"login":"chain","id":412728,"avatar_url":"https://avatars.githubusercontent.com/u/412728?v=3","gravatar_id":"","url":"https://api.github.com/users/chain","html_url":"https://github.com/chain","followers_url":"https://api.github.com/users/chain/followers","following_url":"https://api.github.com/users/chain/following{/other_user}","gists_url":"https://api.github.com/users/chain/gists{/gist_id}","starred_url":"https://api.github.com/users/chain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chain/subscriptions","organizations_url":"https://api.github.com/users/chain/orgs","repos_url":"https://api.github.com/users/chain/repos","events_url":"https://api.github.com/users/chain/events{/privacy}","received_events_url":"https://api.github.com/users/chain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chain/chain","description":"Chain Core Developer Edition","fork":false,"url":"https://api.github.com/repos/chain/chain","forks_url":"https://api.github.com/repos/chain/chain/forks","keys_url":"https://api.github.com/repos/chain/chain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chain/chain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chain/chain/teams","hooks_url":"https://api.github.com/repos/chain/chain/hooks","issue_events_url":"https://api.github.com/repos/chain/chain/issues/events{/number}","events_url":"https://api.github.com/repos/chain/chain/events","assignees_url":"https://api.github.com/repos/chain/chain/assignees{/user}","branches_url":"https://api.github.com/repos/chain/chain/branches{/branch}","tags_url":"https://api.github.com/repos/chain/chain/tags","blobs_url":"https://api.github.com/repos/chain/chain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chain/chain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chain/chain/git/refs{/sha}","trees_url":"https://api.github.com/repos/chain/chain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chain/chain/statuses/{sha}","languages_url":"https://api.github.com/repos/chain/chain/languages","stargazers_url":"https://api.github.com/repos/chain/chain/stargazers","contributors_url":"https://api.github.com/repos/chain/chain/contributors","subscribers_url":"https://api.github.com/repos/chain/chain/subscribers","subscription_url":"https://api.github.com/repos/chain/chain/subscription","commits_url":"https://api.github.com/repos/chain/chain/commits{/sha}","git_commits_url":"https://api.github.com/repos/chain/chain/git/commits{/sha}","comments_url":"https://api.github.com/repos/chain/chain/comments{/number}","issue_comment_url":"https://api.github.com/repos/chain/chain/issues/comments{/number}","contents_url":"https://api.github.com/repos/chain/chain/contents/{+path}","compare_url":"https://api.github.com/repos/chain/chain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chain/chain/merges","archive_url":"https://api.github.com/repos/chain/chain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chain/chain/downloads","issues_url":"https://api.github.com/repos/chain/chain/issues{/number}","pulls_url":"https://api.github.com/repos/chain/chain/pulls{/number}","milestones_url":"https://api.github.com/repos/chain/chain/milestones{/number}","notifications_url":"https://api.github.com/repos/chain/chain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chain/chain/labels{/name}","releases_url":"https://api.github.com/repos/chain/chain/releases{/id}","deployments_url":"https://api.github.com/repos/chain/chain/deployments","created_at":"2016-10-24T01:12:26Z","updated_at":"2016-11-22T11:17:12Z","pushed_at":"2016-11-22T19:46:58Z","git_url":"git://github.com/chain/chain.git","ssh_url":"git@github.com:chain/chain.git","clone_url":"https://github.com/chain/chain.git","svn_url":"https://github.com/chain/chain","homepage":"https://chain.com","size":101531,"stargazers_count":625,"watchers_count":625,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":17,"forks":76,"open_issues":17,"watchers":625,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/chain/chain/pulls/275"},"html":{"href":"https://github.com/chain/chain/pull/275"},"issue":{"href":"https://api.github.com/repos/chain/chain/issues/275"},"comments":{"href":"https://api.github.com/repos/chain/chain/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/chain/chain/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/chain/chain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chain/chain/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/chain/chain/statuses/b289715c065546e1752ae91c4f0550b5886f8d07"}}}}
{"actor":{"display_login":"boymanjor"}}