{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/comments/60784773","id":60784773,"diff_hunk":"@@ -0,0 +1,121 @@\n+var path = require(\"path\");\n+var tl = require(\"vsts-task-lib\");\n+require(\"shelljs/global\");\n+\n+// Global variables.\n+var codePushCommandPrefix = \"node \" + path.join(__dirname, \"node_modules\", \"code-push-cli\", \"script\", \"cli\");\n+\n+// Export for unit testing.\n+function log(message) {\n+    console.log(message);\n+}\n+\n+// Helper functions.\n+function buildCommand(cmd, positionArgs, optionFlags) {\n+    var command = codePushCommandPrefix + \" \" + cmd;\n+\n+    positionArgs && positionArgs.forEach(function (positionArg) {\n+        command = command + \" \\\"\" + positionArg + \"\\\"\";\n+    });\n+\n+    for (var flag in optionFlags) {\n+        // If the value is falsey, the option flag doesn't have to be specified.\n+        if (optionFlags[flag]) {\n+            var flagValue = \"\" + optionFlags[flag];\n+\n+            command = command + \" --\" + flag;\n+            // For boolean flags, the presence of the flag is enough to indicate its value.\n+            if (flagValue != \"true\" && flagValue != \"false\") {\n+                command = command + \" \\\"\" + flagValue + \"\\\"\";\n+            }\n+        }\n+    }\n+\n+    return command;\n+}\n+\n+function executeCommandAndHandleResult(cmd, positionArgs, optionFlags) {\n+    var command = buildCommand(cmd, positionArgs, optionFlags);\n+\n+    var result = exec(command, { silent: true });\n+\n+    if (result.code == 0) {\n+        module.exports.log(result.output);\n+    } else {\n+        tl.setResult(1, result.output);\n+        ensureLoggedOut();\n+        throw new Error(result.output);\n+    }\n+\n+    return result;\n+}\n+\n+function ensureLoggedOut() {\n+    exec(buildCommand(\"logout\"), { silent: true });\n+}\n+\n+// The main function to be executed.\n+function performDeployTask(accessKey, appName, appStoreVersion, platform, deploymentName, description, rollout, isMandatory, isDisabled, shouldBuild) {\n+    // If function arguments are provided (e.g. during test), use those, else, get user inputs provided by VSTS.\n+    var authType = tl.getInput(\"authType\", false);\n+    if (authType === \"AccessKey\") {\n+        accessKey = tl.getInput(\"accessKey\", true);\n+    } else if (authType === \"ServiceEndpointCodePush\" || authType === \"ServiceEndpointHockeyApp\") {\n+        var serviceAccount = tl.getEndpointAuthorization(tl.getInput(authType, true));\n+        accessKey = serviceAccount.parameters.password;\n+    }\n+\n+    appName = appName || tl.getInput(\"appName\", true);\n+    deploymentName = deploymentName || tl.getInput(\"deploymentName\", false);\n+    platform = platform || tl.getInput(\"platform\", true);\n+    shouldBuild = shouldBuild || tl.getBoolInput(\"shouldBuild\", false);\n+\n+    appStoreVersion = appStoreVersion || tl.getInput(\"appStoreVersion\", false);","path":"Tasks/codepush-release-cordova/codepush-release-cordova.js","position":73,"original_position":73,"commit_id":"fbf36316ae2c79dc047e9a8fde58d9b27df21ef0","original_commit_id":"fbf36316ae2c79dc047e9a8fde58d9b27df21ef0","user":{"login":"lostintangent","id":116461,"avatar_url":"https://avatars.githubusercontent.com/u/116461?v=3","gravatar_id":"","url":"https://api.github.com/users/lostintangent","html_url":"https://github.com/lostintangent","followers_url":"https://api.github.com/users/lostintangent/followers","following_url":"https://api.github.com/users/lostintangent/following{/other_user}","gists_url":"https://api.github.com/users/lostintangent/gists{/gist_id}","starred_url":"https://api.github.com/users/lostintangent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lostintangent/subscriptions","organizations_url":"https://api.github.com/users/lostintangent/orgs","repos_url":"https://api.github.com/users/lostintangent/repos","events_url":"https://api.github.com/users/lostintangent/events{/privacy}","received_events_url":"https://api.github.com/users/lostintangent/received_events","type":"User","site_admin":false},"body":"This would need to check for the use of \"autodetect\" right? Or could we make the value of the \"Auto-Detect\" picklist option `\"\"`?","created_at":"2016-04-22T18:42:35Z","updated_at":"2016-04-22T18:42:35Z","html_url":"https://github.com/Microsoft/code-push-vsts-extension/pull/21#discussion_r60784773","pull_request_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/comments/60784773"},"html":{"href":"https://github.com/Microsoft/code-push-vsts-extension/pull/21#discussion_r60784773"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21","id":67441705,"html_url":"https://github.com/Microsoft/code-push-vsts-extension/pull/21","diff_url":"https://github.com/Microsoft/code-push-vsts-extension/pull/21.diff","patch_url":"https://github.com/Microsoft/code-push-vsts-extension/pull/21.patch","issue_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/21","number":21,"state":"open","locked":false,"title":"Add release cordova task","user":{"login":"ryuyu","id":11051729,"avatar_url":"https://avatars.githubusercontent.com/u/11051729?v=3","gravatar_id":"","url":"https://api.github.com/users/ryuyu","html_url":"https://github.com/ryuyu","followers_url":"https://api.github.com/users/ryuyu/followers","following_url":"https://api.github.com/users/ryuyu/following{/other_user}","gists_url":"https://api.github.com/users/ryuyu/gists{/gist_id}","starred_url":"https://api.github.com/users/ryuyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryuyu/subscriptions","organizations_url":"https://api.github.com/users/ryuyu/orgs","repos_url":"https://api.github.com/users/ryuyu/repos","events_url":"https://api.github.com/users/ryuyu/events{/privacy}","received_events_url":"https://api.github.com/users/ryuyu/received_events","type":"User","site_admin":false},"body":"Adding a task to call release-cordova from vsts.\r\n\r\n@lostintangent @shishirx34 ","created_at":"2016-04-22T00:11:15Z","updated_at":"2016-04-22T18:42:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c35c18123070b0ce85662b59d182c10f6fbcff16","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21/commits","review_comments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21/comments","review_comment_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/21/comments","statuses_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/statuses/fbf36316ae2c79dc047e9a8fde58d9b27df21ef0","head":{"label":"Microsoft:add-release-cordova-task","ref":"add-release-cordova-task","sha":"fbf36316ae2c79dc047e9a8fde58d9b27df21ef0","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":44837140,"name":"code-push-vsts-extension","full_name":"Microsoft/code-push-vsts-extension","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/code-push-vsts-extension","description":"Visual Studio Team Services (VSTS) extension for performing continuous delivery to the CodePush service from your automated CI builds","fork":false,"url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension","forks_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/forks","keys_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/teams","hooks_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/events","assignees_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/tags","blobs_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/languages","stargazers_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/subscription","commits_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/merges","archive_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/downloads","issues_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/deployments","created_at":"2015-10-23T20:35:15Z","updated_at":"2016-04-19T20:55:43Z","pushed_at":"2016-04-22T18:28:57Z","git_url":"git://github.com/Microsoft/code-push-vsts-extension.git","ssh_url":"git@github.com:Microsoft/code-push-vsts-extension.git","clone_url":"https://github.com/Microsoft/code-push-vsts-extension.git","svn_url":"https://github.com/Microsoft/code-push-vsts-extension","homepage":"https://marketplace.visualstudio.com/items/ms-vsclient.code-push","size":1099,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":9,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"7a1d48be859d4dc3ae26e10771ad0cd11ed1cbfa","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":44837140,"name":"code-push-vsts-extension","full_name":"Microsoft/code-push-vsts-extension","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/code-push-vsts-extension","description":"Visual Studio Team Services (VSTS) extension for performing continuous delivery to the CodePush service from your automated CI builds","fork":false,"url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension","forks_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/forks","keys_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/teams","hooks_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/events","assignees_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/tags","blobs_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/languages","stargazers_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/subscription","commits_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/merges","archive_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/downloads","issues_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/deployments","created_at":"2015-10-23T20:35:15Z","updated_at":"2016-04-19T20:55:43Z","pushed_at":"2016-04-22T18:28:57Z","git_url":"git://github.com/Microsoft/code-push-vsts-extension.git","ssh_url":"git@github.com:Microsoft/code-push-vsts-extension.git","clone_url":"https://github.com/Microsoft/code-push-vsts-extension.git","svn_url":"https://github.com/Microsoft/code-push-vsts-extension","homepage":"https://marketplace.visualstudio.com/items/ms-vsclient.code-push","size":1099,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21"},"html":{"href":"https://github.com/Microsoft/code-push-vsts-extension/pull/21"},"issue":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/21"},"comments":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/code-push-vsts-extension/statuses/fbf36316ae2c79dc047e9a8fde58d9b27df21ef0"}}}}