{"action":"created","comment":{"url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/comments/142256919","pull_request_review_id":66593289,"id":142256919,"diff_hunk":"@@ -168,6 +174,62 @@ func wrapMain() error {\n \t\t\"namespace\": vargs.Namespace,\n \t}\n \n+\tif !vargs.DryRun && vargs.EndpointsSchema != \"\" {\n+\t\t// get latest deployed version. Newest first\n+\t\terr = runner.Run(vargs.GCloudCmd, \"gcloud\", \"alpha\", \"endpoints\", \"config\", \"list\", \"--service=\", vargs.EndpointsService, \"--format\", \"'value(id)'\", \"--limit\", \"1\")\n+\t\tif err != nil {\n+\t\t\treturn fmt.Errorf(\"Error: %s\\n\", err)\n+\t\t}\n+\t\tserviceVersion := runner.Output()\n+\t\tswaggerVersion := []byte{}\n+\t\tvar version struct {\n+\t\t\tInfo struct {\n+\t\t\t\tVersion string `json:\"version\"`\n+\t\t\t} `json:\"info\"`\n+\t\t}\n+\n+\t\t// schema has been deployed previously\n+\t\tif len(serviceVersion) != 0 {\n+\t\t\t// get deployed version of swagger file\n+\t\t\terr = runner.Run(vargs.GCloudCmd, \"gcloud\", \"alpha\", \"endpoints\", \"config\", \"describe\", string(serviceVersion), \"--service=\", vargs.EndpointsService, \"--format\", \"'value(apis.version)'\")\n+\t\t\tif err != nil {\n+\t\t\t\treturn fmt.Errorf(\"Error: %s\\n\", err)\n+\t\t\t}\n+\t\t\tswaggerVersion = runner.Output()\n+\n+\t\t\t// read version from schema\n+\t\t\tf, err := os.Open(vargs.EndpointsSchema)\n+\t\t\tif err != nil {\n+\t\t\t\treturn fmt.Errorf(\"Error: %s\\n\", err)\n+\t\t\t}\n+\n+\t\t\tfi, err := f.Stat()\n+\t\t\tif err != nil {\n+\t\t\t\treturn fmt.Errorf(\"Error: %s\\n\", err)\n+\t\t\t}\n+\t\t\terr = yaml.NewYAMLOrJSONDecoder(f, int(fi.Size())).Decode(&version)\n+\t\t\tif err != nil {\n+\t\t\t\treturn fmt.Errorf(\"Error: %s\\n\", err)\n+\t\t\t}\n+\t\t\tf.Close()\n+\t\t}\n+\t\tdata[\"endpoints_service_name\"] = vargs.EndpointsService\n+\n+\t\tif len(serviceVersion) == 0 || string(swaggerVersion) != version.Info.Version {","path":"main.go","position":98,"original_position":98,"commit_id":"cb5b1b40d3dbca79663462bd231e4f86e95a8bef","original_commit_id":"cb5b1b40d3dbca79663462bd231e4f86e95a8bef","user":{"login":"gaplyk","id":4416772,"avatar_url":"https://avatars1.githubusercontent.com/u/4416772?v=4","gravatar_id":"","url":"https://api.github.com/users/gaplyk","html_url":"https://github.com/gaplyk","followers_url":"https://api.github.com/users/gaplyk/followers","following_url":"https://api.github.com/users/gaplyk/following{/other_user}","gists_url":"https://api.github.com/users/gaplyk/gists{/gist_id}","starred_url":"https://api.github.com/users/gaplyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaplyk/subscriptions","organizations_url":"https://api.github.com/users/gaplyk/orgs","repos_url":"https://api.github.com/users/gaplyk/repos","events_url":"https://api.github.com/users/gaplyk/events{/privacy}","received_events_url":"https://api.github.com/users/gaplyk/received_events","type":"User","site_admin":false},"body":"yes","created_at":"2017-10-02T21:11:08Z","updated_at":"2017-10-02T21:11:08Z","html_url":"https://github.com/NYTimes/drone-gke/pull/50#discussion_r142256919","pull_request_url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/comments/142256919"},"html":{"href":"https://github.com/NYTimes/drone-gke/pull/50#discussion_r142256919"},"pull_request":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50"}},"in_reply_to_id":142246275},"pull_request":{"url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50","id":143772302,"html_url":"https://github.com/NYTimes/drone-gke/pull/50","diff_url":"https://github.com/NYTimes/drone-gke/pull/50.diff","patch_url":"https://github.com/NYTimes/drone-gke/pull/50.patch","issue_url":"https://api.github.com/repos/NYTimes/drone-gke/issues/50","number":50,"state":"open","locked":false,"title":"Deployment of cloud endpoints","user":{"login":"gaplyk","id":4416772,"avatar_url":"https://avatars1.githubusercontent.com/u/4416772?v=4","gravatar_id":"","url":"https://api.github.com/users/gaplyk","html_url":"https://github.com/gaplyk","followers_url":"https://api.github.com/users/gaplyk/followers","following_url":"https://api.github.com/users/gaplyk/following{/other_user}","gists_url":"https://api.github.com/users/gaplyk/gists{/gist_id}","starred_url":"https://api.github.com/users/gaplyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaplyk/subscriptions","organizations_url":"https://api.github.com/users/gaplyk/orgs","repos_url":"https://api.github.com/users/gaplyk/repos","events_url":"https://api.github.com/users/gaplyk/events{/privacy}","received_events_url":"https://api.github.com/users/gaplyk/received_events","type":"User","site_admin":false},"body":"This process is not ready yet.\r\nRight now feedbacks are valuable.\r\n\r\nThe reason: hard to manage endpoints if you have 2 or more environments. And before release, this manual step requires one more commit to update version of endpoints.","created_at":"2017-09-28T22:40:26Z","updated_at":"2017-10-02T21:11:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f4afba0b39eb85c9458454f77ea4339154f2252","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50/commits","review_comments_url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50/comments","review_comment_url":"https://api.github.com/repos/NYTimes/drone-gke/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NYTimes/drone-gke/issues/50/comments","statuses_url":"https://api.github.com/repos/NYTimes/drone-gke/statuses/cb5b1b40d3dbca79663462bd231e4f86e95a8bef","head":{"label":"gaplyk:master","ref":"master","sha":"cb5b1b40d3dbca79663462bd231e4f86e95a8bef","user":{"login":"gaplyk","id":4416772,"avatar_url":"https://avatars1.githubusercontent.com/u/4416772?v=4","gravatar_id":"","url":"https://api.github.com/users/gaplyk","html_url":"https://github.com/gaplyk","followers_url":"https://api.github.com/users/gaplyk/followers","following_url":"https://api.github.com/users/gaplyk/following{/other_user}","gists_url":"https://api.github.com/users/gaplyk/gists{/gist_id}","starred_url":"https://api.github.com/users/gaplyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaplyk/subscriptions","organizations_url":"https://api.github.com/users/gaplyk/orgs","repos_url":"https://api.github.com/users/gaplyk/repos","events_url":"https://api.github.com/users/gaplyk/events{/privacy}","received_events_url":"https://api.github.com/users/gaplyk/received_events","type":"User","site_admin":false},"repo":{"id":104940114,"name":"drone-gke","full_name":"gaplyk/drone-gke","owner":{"login":"gaplyk","id":4416772,"avatar_url":"https://avatars1.githubusercontent.com/u/4416772?v=4","gravatar_id":"","url":"https://api.github.com/users/gaplyk","html_url":"https://github.com/gaplyk","followers_url":"https://api.github.com/users/gaplyk/followers","following_url":"https://api.github.com/users/gaplyk/following{/other_user}","gists_url":"https://api.github.com/users/gaplyk/gists{/gist_id}","starred_url":"https://api.github.com/users/gaplyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaplyk/subscriptions","organizations_url":"https://api.github.com/users/gaplyk/orgs","repos_url":"https://api.github.com/users/gaplyk/repos","events_url":"https://api.github.com/users/gaplyk/events{/privacy}","received_events_url":"https://api.github.com/users/gaplyk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaplyk/drone-gke","description":"Drone plugin to deploy containers to Google Container Engine","fork":true,"url":"https://api.github.com/repos/gaplyk/drone-gke","forks_url":"https://api.github.com/repos/gaplyk/drone-gke/forks","keys_url":"https://api.github.com/repos/gaplyk/drone-gke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaplyk/drone-gke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaplyk/drone-gke/teams","hooks_url":"https://api.github.com/repos/gaplyk/drone-gke/hooks","issue_events_url":"https://api.github.com/repos/gaplyk/drone-gke/issues/events{/number}","events_url":"https://api.github.com/repos/gaplyk/drone-gke/events","assignees_url":"https://api.github.com/repos/gaplyk/drone-gke/assignees{/user}","branches_url":"https://api.github.com/repos/gaplyk/drone-gke/branches{/branch}","tags_url":"https://api.github.com/repos/gaplyk/drone-gke/tags","blobs_url":"https://api.github.com/repos/gaplyk/drone-gke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaplyk/drone-gke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaplyk/drone-gke/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaplyk/drone-gke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaplyk/drone-gke/statuses/{sha}","languages_url":"https://api.github.com/repos/gaplyk/drone-gke/languages","stargazers_url":"https://api.github.com/repos/gaplyk/drone-gke/stargazers","contributors_url":"https://api.github.com/repos/gaplyk/drone-gke/contributors","subscribers_url":"https://api.github.com/repos/gaplyk/drone-gke/subscribers","subscription_url":"https://api.github.com/repos/gaplyk/drone-gke/subscription","commits_url":"https://api.github.com/repos/gaplyk/drone-gke/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaplyk/drone-gke/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaplyk/drone-gke/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaplyk/drone-gke/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaplyk/drone-gke/contents/{+path}","compare_url":"https://api.github.com/repos/gaplyk/drone-gke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaplyk/drone-gke/merges","archive_url":"https://api.github.com/repos/gaplyk/drone-gke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaplyk/drone-gke/downloads","issues_url":"https://api.github.com/repos/gaplyk/drone-gke/issues{/number}","pulls_url":"https://api.github.com/repos/gaplyk/drone-gke/pulls{/number}","milestones_url":"https://api.github.com/repos/gaplyk/drone-gke/milestones{/number}","notifications_url":"https://api.github.com/repos/gaplyk/drone-gke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaplyk/drone-gke/labels{/name}","releases_url":"https://api.github.com/repos/gaplyk/drone-gke/releases{/id}","deployments_url":"https://api.github.com/repos/gaplyk/drone-gke/deployments","created_at":"2017-09-26T21:35:36Z","updated_at":"2017-09-26T21:35:38Z","pushed_at":"2017-09-29T05:09:26Z","git_url":"git://github.com/gaplyk/drone-gke.git","ssh_url":"git@github.com:gaplyk/drone-gke.git","clone_url":"https://github.com/gaplyk/drone-gke.git","svn_url":"https://github.com/gaplyk/drone-gke","homepage":"https://open.blogs.nytimes.com/2017/01/12/continuous-deployment-to-google-cloud-platform-with-drone/","size":3001,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"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":"NYTimes:master","ref":"master","sha":"7ec003b4df98d5b4160964b2f5ad6a8e75aa553c","user":{"login":"NYTimes","id":221409,"avatar_url":"https://avatars0.githubusercontent.com/u/221409?v=4","gravatar_id":"","url":"https://api.github.com/users/NYTimes","html_url":"https://github.com/NYTimes","followers_url":"https://api.github.com/users/NYTimes/followers","following_url":"https://api.github.com/users/NYTimes/following{/other_user}","gists_url":"https://api.github.com/users/NYTimes/gists{/gist_id}","starred_url":"https://api.github.com/users/NYTimes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYTimes/subscriptions","organizations_url":"https://api.github.com/users/NYTimes/orgs","repos_url":"https://api.github.com/users/NYTimes/repos","events_url":"https://api.github.com/users/NYTimes/events{/privacy}","received_events_url":"https://api.github.com/users/NYTimes/received_events","type":"Organization","site_admin":false},"repo":{"id":66410587,"name":"drone-gke","full_name":"NYTimes/drone-gke","owner":{"login":"NYTimes","id":221409,"avatar_url":"https://avatars0.githubusercontent.com/u/221409?v=4","gravatar_id":"","url":"https://api.github.com/users/NYTimes","html_url":"https://github.com/NYTimes","followers_url":"https://api.github.com/users/NYTimes/followers","following_url":"https://api.github.com/users/NYTimes/following{/other_user}","gists_url":"https://api.github.com/users/NYTimes/gists{/gist_id}","starred_url":"https://api.github.com/users/NYTimes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYTimes/subscriptions","organizations_url":"https://api.github.com/users/NYTimes/orgs","repos_url":"https://api.github.com/users/NYTimes/repos","events_url":"https://api.github.com/users/NYTimes/events{/privacy}","received_events_url":"https://api.github.com/users/NYTimes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYTimes/drone-gke","description":"Drone plugin to deploy containers to Google Container Engine","fork":false,"url":"https://api.github.com/repos/NYTimes/drone-gke","forks_url":"https://api.github.com/repos/NYTimes/drone-gke/forks","keys_url":"https://api.github.com/repos/NYTimes/drone-gke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYTimes/drone-gke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYTimes/drone-gke/teams","hooks_url":"https://api.github.com/repos/NYTimes/drone-gke/hooks","issue_events_url":"https://api.github.com/repos/NYTimes/drone-gke/issues/events{/number}","events_url":"https://api.github.com/repos/NYTimes/drone-gke/events","assignees_url":"https://api.github.com/repos/NYTimes/drone-gke/assignees{/user}","branches_url":"https://api.github.com/repos/NYTimes/drone-gke/branches{/branch}","tags_url":"https://api.github.com/repos/NYTimes/drone-gke/tags","blobs_url":"https://api.github.com/repos/NYTimes/drone-gke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYTimes/drone-gke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYTimes/drone-gke/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYTimes/drone-gke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYTimes/drone-gke/statuses/{sha}","languages_url":"https://api.github.com/repos/NYTimes/drone-gke/languages","stargazers_url":"https://api.github.com/repos/NYTimes/drone-gke/stargazers","contributors_url":"https://api.github.com/repos/NYTimes/drone-gke/contributors","subscribers_url":"https://api.github.com/repos/NYTimes/drone-gke/subscribers","subscription_url":"https://api.github.com/repos/NYTimes/drone-gke/subscription","commits_url":"https://api.github.com/repos/NYTimes/drone-gke/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYTimes/drone-gke/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYTimes/drone-gke/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYTimes/drone-gke/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYTimes/drone-gke/contents/{+path}","compare_url":"https://api.github.com/repos/NYTimes/drone-gke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYTimes/drone-gke/merges","archive_url":"https://api.github.com/repos/NYTimes/drone-gke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYTimes/drone-gke/downloads","issues_url":"https://api.github.com/repos/NYTimes/drone-gke/issues{/number}","pulls_url":"https://api.github.com/repos/NYTimes/drone-gke/pulls{/number}","milestones_url":"https://api.github.com/repos/NYTimes/drone-gke/milestones{/number}","notifications_url":"https://api.github.com/repos/NYTimes/drone-gke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYTimes/drone-gke/labels{/name}","releases_url":"https://api.github.com/repos/NYTimes/drone-gke/releases{/id}","deployments_url":"https://api.github.com/repos/NYTimes/drone-gke/deployments","created_at":"2016-08-23T23:17:17Z","updated_at":"2017-09-15T05:22:35Z","pushed_at":"2017-09-29T05:09:28Z","git_url":"git://github.com/NYTimes/drone-gke.git","ssh_url":"git@github.com:NYTimes/drone-gke.git","clone_url":"https://github.com/NYTimes/drone-gke.git","svn_url":"https://github.com/NYTimes/drone-gke","homepage":"https://open.blogs.nytimes.com/2017/01/12/continuous-deployment-to-google-cloud-platform-with-drone/","size":1376,"stargazers_count":87,"watchers_count":87,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50"},"html":{"href":"https://github.com/NYTimes/drone-gke/pull/50"},"issue":{"href":"https://api.github.com/repos/NYTimes/drone-gke/issues/50"},"comments":{"href":"https://api.github.com/repos/NYTimes/drone-gke/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NYTimes/drone-gke/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/NYTimes/drone-gke/statuses/cb5b1b40d3dbca79663462bd231e4f86e95a8bef"}},"author_association":"NONE"}}
{"actor":{"display_login":"gaplyk"}}