{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/26610793","id":26610793,"diff_hunk":"@@ -833,3 +833,43 @@ function kube::release::gcs::publish_latest() {\n   echo \"+++ gsutil cat ${latest_file_dst}:\"\n   gsutil cat ${latest_file_dst}\n }\n+\n+# Publish a new latest.txt, but only if the release we're dealing with\n+# is newer than the contents in GCS.\n+function kube::release::gcs::publish_latest_official() {\n+  local new_version=${KUBE_GCS_LATEST_CONTENTS}\n+  local latest_file_dst=\"gs://${KUBE_GCS_RELEASE_BUCKET}/${KUBE_GCS_LATEST_FILE}\"\n+\n+  local version_regex=\"^v(0|[1-9][0-9]*)\\\\.(0|[1-9][0-9]*)\\\\.(0|[1-9][0-9]*)$\"\n+  [[ ${new_version} =~ ${version_regex} ]] || {\n+    echo \"!!! publish_latest_official passed bogus value: '${new_version}'\" >&2\n+    exit 1\n+  }\n+\n+  local version_major=\"${BASH_REMATCH[1]}\"\n+  local version_minor=\"${BASH_REMATCH[2]}\"\n+  local version_patch=\"${BASH_REMATCH[3]}\"\n+\n+  local gcs_version\n+  gcs_version=$(gsutil cat ${latest_file_dst})\n+\n+  [[ ${gcs_version} =~ $version_regex ]] || {\n+    echo \"!!! ${latest_file_dst} contains invalid release version, can't compare: '${gcs_version}'\" >&2\n+    exit 1\n+  }\n+\n+  local gcs_version_major=\"${BASH_REMATCH[1]}\"\n+  local gcs_version_minor=\"${BASH_REMATCH[2]}\"\n+  local gcs_version_patch=\"${BASH_REMATCH[3]}\"\n+\n+  if [[ \"${gcs_version_major}\" -gt \"${version_major}\" ]] ||\n+    [[ \"${gcs_version_minor}\" -gt \"${version_minor}\" ]] ||\n+    [[ \"${gcs_version_patch}\" -gt \"${version_patch}\" ]] ||\n+    [[ \"${gcs_version}\" == \"${new_version}\" ]]; then\n+    echo \"+++ ${gcs_version} (latest on GCS) >= ${new_version} (just uploaded), not updating ${latest_file_dst}\"\n+    return\n+  fi\n+\n+  echo \"+++ ${new_version} (just uploaded) > ${gcs_version} (latest on GCS), updating ${latest_file_dst}\"\n+  kube::release::gcs::publish_latest ${new_version}","path":"build/common.sh","position":42,"original_position":42,"commit_id":"368343369d77d26b17c9ee47e4223c8469458bbc","original_commit_id":"368343369d77d26b17c9ee47e4223c8469458bbc","user":{"login":"filbranden","id":106037,"avatar_url":"https://avatars.githubusercontent.com/u/106037?v=3","gravatar_id":"","url":"https://api.github.com/users/filbranden","html_url":"https://github.com/filbranden","followers_url":"https://api.github.com/users/filbranden/followers","following_url":"https://api.github.com/users/filbranden/following{/other_user}","gists_url":"https://api.github.com/users/filbranden/gists{/gist_id}","starred_url":"https://api.github.com/users/filbranden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filbranden/subscriptions","organizations_url":"https://api.github.com/users/filbranden/orgs","repos_url":"https://api.github.com/users/filbranden/repos","events_url":"https://api.github.com/users/filbranden/events{/privacy}","received_events_url":"https://api.github.com/users/filbranden/received_events","type":"User","site_admin":false},"body":"Double quotes around the variable in the argument.","created_at":"2015-03-17T20:08:53Z","updated_at":"2015-03-17T20:08:53Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563#discussion_r26610793","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/26610793"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563#discussion_r26610793"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563","id":31369984,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/5563","number":5563,"state":"open","locked":false,"title":"Publish a gs://kubernetes-release/release/latest.txt when we publish a build","user":{"login":"zmerlynn","id":4942464,"avatar_url":"https://avatars.githubusercontent.com/u/4942464?v=3","gravatar_id":"","url":"https://api.github.com/users/zmerlynn","html_url":"https://github.com/zmerlynn","followers_url":"https://api.github.com/users/zmerlynn/followers","following_url":"https://api.github.com/users/zmerlynn/following{/other_user}","gists_url":"https://api.github.com/users/zmerlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/zmerlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmerlynn/subscriptions","organizations_url":"https://api.github.com/users/zmerlynn/orgs","repos_url":"https://api.github.com/users/zmerlynn/repos","events_url":"https://api.github.com/users/zmerlynn/events{/privacy}","received_events_url":"https://api.github.com/users/zmerlynn/received_events","type":"User","site_admin":false},"body":"\r\n\r\nAdds a kube::release::gcs::publish_latest_official that checks the\r\ncurrent contents of this file in GCS, verifies that we're pushing a\r\nnewer build, and updates it if so. (i.e. it handles the case of\r\npushing a 0.13.1 and then later pushing a 0.12.3.) This follows the\r\npattern of the ci/ build, which Jenkins just updates unconditionally.\r\n\r\nI already updated the file for 0.13.1. After this we can update the\r\nget-k8s script, so we don't have to keep updating it.","created_at":"2015-03-17T19:36:03Z","updated_at":"2015-03-17T20:08:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"718da10b054f6dda7ddbb227304f2f297ba1099e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/5563/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/368343369d77d26b17c9ee47e4223c8469458bbc","head":{"label":"zmerlynn:publish_latest","ref":"publish_latest","sha":"368343369d77d26b17c9ee47e4223c8469458bbc","user":{"login":"zmerlynn","id":4942464,"avatar_url":"https://avatars.githubusercontent.com/u/4942464?v=3","gravatar_id":"","url":"https://api.github.com/users/zmerlynn","html_url":"https://github.com/zmerlynn","followers_url":"https://api.github.com/users/zmerlynn/followers","following_url":"https://api.github.com/users/zmerlynn/following{/other_user}","gists_url":"https://api.github.com/users/zmerlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/zmerlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmerlynn/subscriptions","organizations_url":"https://api.github.com/users/zmerlynn/orgs","repos_url":"https://api.github.com/users/zmerlynn/repos","events_url":"https://api.github.com/users/zmerlynn/events{/privacy}","received_events_url":"https://api.github.com/users/zmerlynn/received_events","type":"User","site_admin":false},"repo":{"id":27641977,"name":"kubernetes","full_name":"zmerlynn/kubernetes","owner":{"login":"zmerlynn","id":4942464,"avatar_url":"https://avatars.githubusercontent.com/u/4942464?v=3","gravatar_id":"","url":"https://api.github.com/users/zmerlynn","html_url":"https://github.com/zmerlynn","followers_url":"https://api.github.com/users/zmerlynn/followers","following_url":"https://api.github.com/users/zmerlynn/following{/other_user}","gists_url":"https://api.github.com/users/zmerlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/zmerlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmerlynn/subscriptions","organizations_url":"https://api.github.com/users/zmerlynn/orgs","repos_url":"https://api.github.com/users/zmerlynn/repos","events_url":"https://api.github.com/users/zmerlynn/events{/privacy}","received_events_url":"https://api.github.com/users/zmerlynn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zmerlynn/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/zmerlynn/kubernetes","forks_url":"https://api.github.com/repos/zmerlynn/kubernetes/forks","keys_url":"https://api.github.com/repos/zmerlynn/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zmerlynn/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zmerlynn/kubernetes/teams","hooks_url":"https://api.github.com/repos/zmerlynn/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/zmerlynn/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/zmerlynn/kubernetes/events","assignees_url":"https://api.github.com/repos/zmerlynn/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/zmerlynn/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/zmerlynn/kubernetes/tags","blobs_url":"https://api.github.com/repos/zmerlynn/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zmerlynn/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zmerlynn/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/zmerlynn/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zmerlynn/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/zmerlynn/kubernetes/languages","stargazers_url":"https://api.github.com/repos/zmerlynn/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/zmerlynn/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/zmerlynn/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/zmerlynn/kubernetes/subscription","commits_url":"https://api.github.com/repos/zmerlynn/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/zmerlynn/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/zmerlynn/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/zmerlynn/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/zmerlynn/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/zmerlynn/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zmerlynn/kubernetes/merges","archive_url":"https://api.github.com/repos/zmerlynn/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zmerlynn/kubernetes/downloads","issues_url":"https://api.github.com/repos/zmerlynn/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/zmerlynn/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/zmerlynn/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/zmerlynn/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zmerlynn/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/zmerlynn/kubernetes/releases{/id}","created_at":"2014-12-06T17:10:41Z","updated_at":"2014-12-06T19:12:25Z","pushed_at":"2015-03-17T19:35:49Z","git_url":"git://github.com/zmerlynn/kubernetes.git","ssh_url":"git@github.com:zmerlynn/kubernetes.git","clone_url":"https://github.com/zmerlynn/kubernetes.git","svn_url":"https://github.com/zmerlynn/kubernetes","homepage":null,"size":36460,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"572f8041397f82c0b9b22a0bcb2ce9154510a511","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-03-17T19:56:23Z","pushed_at":"2015-03-17T19:56:22Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":"http://kubernetes.io","size":105053,"stargazers_count":6621,"watchers_count":6621,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1225,"mirror_url":null,"open_issues_count":757,"forks":1225,"open_issues":757,"watchers":6621,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/5563"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/5563"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/5563/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/5563/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/368343369d77d26b17c9ee47e4223c8469458bbc"}}}}