{"action":"created","comment":{"url":"https://api.github.com/repos/apache/bahir/pulls/comments/69343322","id":69343322,"diff_hunk":"@@ -0,0 +1,268 @@\n+#!/usr/bin/env bash\n+\n+#\n+# Licensed to the Apache Software Foundation (ASF) under one or more\n+# contributor license agreements.  See the NOTICE file distributed with\n+# this work for additional information regarding copyright ownership.\n+# The ASF licenses this file to You under the Apache License, Version 2.0\n+# (the \"License\"); you may not use this file except in compliance with\n+# the License.  You may obtain a copy of the License at\n+#\n+#    http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+function exit_with_usage {\n+  cat << EOF\n+usage: release-build.sh <release-prepare|release-publish|release-snapshot>\n+Creates build distributions from a git commit hash.\n+\n+Top level targets are\n+  --release-prepare: Create binary packages and add them to https://dist.apache.org/repos/dist/dev/bahir\n+  --release-publish: Publish a release to Apache release repo\n+  --release-snapshot: Publish snapshot release to Apache snapshots\n+\n+  --gitCommitHash - Release tag or commit to build from, default master HEAD\n+  --releaseVersion - Release identifier used when publishing\n+  --releaseRc - Release RC identifier used when publishing\n+  --developmentVersion - Release identifier in top level package directory\n+  --tag - Release Tag identifier used when taging git\n+\n+All other inputs are environment variables\n+\n+GPG_PASSPHRASE - Passphrase for GPG key\n+\n+Note: Ensure you have set up standard Apache committer settings in ~/.m2/settings.xml as per\n+\n+   http://maven.apache.org/developers/committer-settings.html\n+\n+EOF\n+  exit 1\n+}\n+\n+set -e\n+\n+if [ $# -eq 0 ]; then\n+  exit_with_usage\n+fi\n+\n+\n+# Process each provided argument configuration\n+while [ \"${1+defined}\" ]; do\n+  IFS=\"=\" read -ra PARTS <<< \"$1\"\n+  case \"${PARTS[0]}\" in\n+    --release-prepare)\n+      RELEASE_PREPARE=true\n+      shift\n+      ;;\n+    --release-publish)\n+      RELEASE_PUBLISH=true\n+      shift\n+      ;;\n+    --release-snapshot)\n+      RELEASE_SNAPSHOT=true\n+      shift\n+      ;;\n+    --gitCommitHash)\n+      GIT_REF=\"${PARTS[1]}\"\n+      shift\n+      ;;\n+    --releaseVersion)\n+      RELEASE_VERSION=\"${PARTS[1]}\"\n+      shift\n+      ;;\n+    --developmentVersion)\n+      DEVELOPMENT_VERSION=\"${PARTS[1]}\"\n+      shift\n+      ;;\n+    --releaseRc)\n+      RELEASE_RC=\"${PARTS[1]}\"\n+      shift\n+      ;;\n+    --tag)\n+      RELEASE_TAG=\"${PARTS[1]}\"\n+      shift\n+      ;;\n+    *help* | -h)\n+      exit_with_usage\n+     exit 0\n+     ;;\n+    -*)\n+     echo \"Error: Unknown option: $1\" >&2\n+     exit 1\n+     ;;\n+    *)  # No more options\n+     break\n+     ;;\n+  esac\n+done\n+\n+\n+for env in GPG_PASSPHRASE; do\n+  if [ -z \"${!env}\" ]; then\n+    echo \"ERROR: $env must be set to run this script\"\n+    exit_with_usage\n+  fi\n+done\n+\n+if [[ \"$RELEASE_PREPARE\" == \"true\" && -z \"$RELEASE_VERSION\" ]]; then\n+    echo \"ERROR: --releaseVersion must be passed as an argument to run this script\"\n+    exit_with_usage\n+fi\n+\n+if [[ \"$RELEASE_PREPARE\" == \"true\" && -z \"$DEVELOPMENT_VERSION\" ]]; then\n+    echo \"ERROR: --developmentVersion must be passed as an argument to run this script\"\n+    exit_with_usage\n+fi\n+\n+# Explicitly set locale in order to make `sort` output consistent across machines.\n+# See https://stackoverflow.com/questions/28881 for more details.\n+export LC_ALL=C\n+\n+# Commit ref to checkout when building\n+GIT_REF=${GIT_REF:-master}\n+\n+GPG=\"gpg --no-tty --batch\"\n+\n+BASE_DIR=$(pwd)\n+\n+MVN=\"mvn\"\n+PUBLISH_PROFILES=\"-Pdistribution\"\n+\n+if [ -z \"$RELEASE_RC\" ]; then\n+  RELEASE_RC=\"rc1\"\n+fi\n+\n+if [ -z \"$RELEASE_TAG\" ]; then\n+  RELEASE_TAG=\"$RELEASE_VERSION-$RELEASE_RC\"\n+fi\n+\n+DEST_DIR_NAME=\"bahir-$DEVELOPMENT_VERSION\"\n+\n+RELEASE_STAGING_LOCATION=\"https://dist.apache.org/repos/dist/dev/bahir/\"\n+\n+\n+echo \"  \"\n+echo \"-------------------------------------------------------------\"\n+echo \"------- Release preparation with the following parameters ---\"\n+echo \"-------------------------------------------------------------\"\n+echo \"Goal                ==> $GOAL\"\n+echo \"Git reference       ==> $GIT_REF\"\n+echo \"release version     ==> $RELEASE_VERSION\"\n+echo \"development version ==> $DEVELOPMENT_VERSION\"\n+echo \"rc                  ==> $RELEASE_RC\"\n+echo \"tag                 ==> $RELEASE_TAG\"\n+echo \"  \"\n+echo \"Deploying to :\"\n+echo $RELEASE_STAGING_LOCATION\n+echo \"  \"\n+\n+function checkout_code {\n+    # Checkout code\n+    rm -rf target\n+    mkdir target\n+    cd target\n+    rm -rf bahir\n+    git clone https://git-wip-us.apache.org/repos/asf/bahir.git\n+    cd bahir\n+    git checkout $GIT_REF\n+    git_hash=`git rev-parse --short HEAD`","path":"dev/release-build.sh","position":174,"original_position":174,"commit_id":"a65cf38d9662574c365c6ecfb95051b3543c5865","original_commit_id":"a65cf38d9662574c365c6ecfb95051b3543c5865","user":{"login":"jodersky","id":1007012,"avatar_url":"https://avatars.githubusercontent.com/u/1007012?v=3","gravatar_id":"","url":"https://api.github.com/users/jodersky","html_url":"https://github.com/jodersky","followers_url":"https://api.github.com/users/jodersky/followers","following_url":"https://api.github.com/users/jodersky/following{/other_user}","gists_url":"https://api.github.com/users/jodersky/gists{/gist_id}","starred_url":"https://api.github.com/users/jodersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodersky/subscriptions","organizations_url":"https://api.github.com/users/jodersky/orgs","repos_url":"https://api.github.com/users/jodersky/repos","events_url":"https://api.github.com/users/jodersky/events{/privacy}","received_events_url":"https://api.github.com/users/jodersky/received_events","type":"User","site_admin":false},"body":"sorry, I didn't see it's also used outside of the function. Should this be declared on the global level then? Just to make it explicit","created_at":"2016-07-01T19:05:16Z","updated_at":"2016-07-01T19:05:16Z","html_url":"https://github.com/apache/bahir/pull/6#discussion_r69343322","pull_request_url":"https://api.github.com/repos/apache/bahir/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/apache/bahir/pulls/comments/69343322"},"html":{"href":"https://github.com/apache/bahir/pull/6#discussion_r69343322"},"pull_request":{"href":"https://api.github.com/repos/apache/bahir/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/apache/bahir/pulls/6","id":75741091,"html_url":"https://github.com/apache/bahir/pull/6","diff_url":"https://github.com/apache/bahir/pull/6.diff","patch_url":"https://github.com/apache/bahir/pull/6.patch","issue_url":"https://api.github.com/repos/apache/bahir/issues/6","number":6,"state":"open","locked":false,"title":"[BAHIR-20] Create release helper scripts","user":{"login":"lresende","id":382917,"avatar_url":"https://avatars.githubusercontent.com/u/382917?v=3","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"body":"Release script to automate :\r\n- Preparing release artifacts\r\n- Publishing maven artifacts in Scala 2.10 and 2.11\r\n- Publishing snapshots","created_at":"2016-06-29T23:56:24Z","updated_at":"2016-07-01T19:05:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb45231ecb3b72305697650db8776a409c38976c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/bahir/pulls/6/commits","review_comments_url":"https://api.github.com/repos/apache/bahir/pulls/6/comments","review_comment_url":"https://api.github.com/repos/apache/bahir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/bahir/issues/6/comments","statuses_url":"https://api.github.com/repos/apache/bahir/statuses/a65cf38d9662574c365c6ecfb95051b3543c5865","head":{"label":"lresende:release","ref":"release","sha":"a65cf38d9662574c365c6ecfb95051b3543c5865","user":{"login":"lresende","id":382917,"avatar_url":"https://avatars.githubusercontent.com/u/382917?v=3","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"repo":{"id":61249907,"name":"bahir","full_name":"lresende/bahir","owner":{"login":"lresende","id":382917,"avatar_url":"https://avatars.githubusercontent.com/u/382917?v=3","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lresende/bahir","description":"Mirror of Apache Bahir","fork":true,"url":"https://api.github.com/repos/lresende/bahir","forks_url":"https://api.github.com/repos/lresende/bahir/forks","keys_url":"https://api.github.com/repos/lresende/bahir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lresende/bahir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lresende/bahir/teams","hooks_url":"https://api.github.com/repos/lresende/bahir/hooks","issue_events_url":"https://api.github.com/repos/lresende/bahir/issues/events{/number}","events_url":"https://api.github.com/repos/lresende/bahir/events","assignees_url":"https://api.github.com/repos/lresende/bahir/assignees{/user}","branches_url":"https://api.github.com/repos/lresende/bahir/branches{/branch}","tags_url":"https://api.github.com/repos/lresende/bahir/tags","blobs_url":"https://api.github.com/repos/lresende/bahir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lresende/bahir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lresende/bahir/git/refs{/sha}","trees_url":"https://api.github.com/repos/lresende/bahir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lresende/bahir/statuses/{sha}","languages_url":"https://api.github.com/repos/lresende/bahir/languages","stargazers_url":"https://api.github.com/repos/lresende/bahir/stargazers","contributors_url":"https://api.github.com/repos/lresende/bahir/contributors","subscribers_url":"https://api.github.com/repos/lresende/bahir/subscribers","subscription_url":"https://api.github.com/repos/lresende/bahir/subscription","commits_url":"https://api.github.com/repos/lresende/bahir/commits{/sha}","git_commits_url":"https://api.github.com/repos/lresende/bahir/git/commits{/sha}","comments_url":"https://api.github.com/repos/lresende/bahir/comments{/number}","issue_comment_url":"https://api.github.com/repos/lresende/bahir/issues/comments{/number}","contents_url":"https://api.github.com/repos/lresende/bahir/contents/{+path}","compare_url":"https://api.github.com/repos/lresende/bahir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lresende/bahir/merges","archive_url":"https://api.github.com/repos/lresende/bahir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lresende/bahir/downloads","issues_url":"https://api.github.com/repos/lresende/bahir/issues{/number}","pulls_url":"https://api.github.com/repos/lresende/bahir/pulls{/number}","milestones_url":"https://api.github.com/repos/lresende/bahir/milestones{/number}","notifications_url":"https://api.github.com/repos/lresende/bahir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lresende/bahir/labels{/name}","releases_url":"https://api.github.com/repos/lresende/bahir/releases{/id}","deployments_url":"https://api.github.com/repos/lresende/bahir/deployments","created_at":"2016-06-16T00:27:34Z","updated_at":"2016-06-16T00:27:35Z","pushed_at":"2016-06-29T23:55:46Z","git_url":"git://github.com/lresende/bahir.git","ssh_url":"git@github.com:lresende/bahir.git","clone_url":"https://github.com/lresende/bahir.git","svn_url":"https://github.com/lresende/bahir","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"apache:master","ref":"master","sha":"853b95060f4bb516e1798b86a04e7ef3bf2f75cd","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":59930659,"name":"bahir","full_name":"apache/bahir","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/bahir","description":"Mirror of Apache Bahir","fork":false,"url":"https://api.github.com/repos/apache/bahir","forks_url":"https://api.github.com/repos/apache/bahir/forks","keys_url":"https://api.github.com/repos/apache/bahir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/bahir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/bahir/teams","hooks_url":"https://api.github.com/repos/apache/bahir/hooks","issue_events_url":"https://api.github.com/repos/apache/bahir/issues/events{/number}","events_url":"https://api.github.com/repos/apache/bahir/events","assignees_url":"https://api.github.com/repos/apache/bahir/assignees{/user}","branches_url":"https://api.github.com/repos/apache/bahir/branches{/branch}","tags_url":"https://api.github.com/repos/apache/bahir/tags","blobs_url":"https://api.github.com/repos/apache/bahir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/bahir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/bahir/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/bahir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/bahir/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/bahir/languages","stargazers_url":"https://api.github.com/repos/apache/bahir/stargazers","contributors_url":"https://api.github.com/repos/apache/bahir/contributors","subscribers_url":"https://api.github.com/repos/apache/bahir/subscribers","subscription_url":"https://api.github.com/repos/apache/bahir/subscription","commits_url":"https://api.github.com/repos/apache/bahir/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/bahir/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/bahir/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/bahir/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/bahir/contents/{+path}","compare_url":"https://api.github.com/repos/apache/bahir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/bahir/merges","archive_url":"https://api.github.com/repos/apache/bahir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/bahir/downloads","issues_url":"https://api.github.com/repos/apache/bahir/issues{/number}","pulls_url":"https://api.github.com/repos/apache/bahir/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/bahir/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/bahir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/bahir/labels{/name}","releases_url":"https://api.github.com/repos/apache/bahir/releases{/id}","deployments_url":"https://api.github.com/repos/apache/bahir/deployments","created_at":"2016-05-29T07:00:06Z","updated_at":"2016-07-01T00:54:51Z","pushed_at":"2016-06-30T22:47:58Z","git_url":"git://github.com/apache/bahir.git","ssh_url":"git@github.com:apache/bahir.git","clone_url":"https://github.com/apache/bahir.git","svn_url":"https://github.com/apache/bahir","homepage":null,"size":488,"stargazers_count":11,"watchers_count":11,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":"git://git.apache.org/bahir.git","open_issues_count":3,"forks":3,"open_issues":3,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/bahir/pulls/6"},"html":{"href":"https://github.com/apache/bahir/pull/6"},"issue":{"href":"https://api.github.com/repos/apache/bahir/issues/6"},"comments":{"href":"https://api.github.com/repos/apache/bahir/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/bahir/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/bahir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/bahir/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/apache/bahir/statuses/a65cf38d9662574c365c6ecfb95051b3543c5865"}}}}
{"actor":{"display_login":"jodersky"}}