Skip to content

Commit

Permalink
updating extension manifest. Add script for making vsix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuyu committed Feb 18, 2016
1 parent ad2c27f commit c85098e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 25 deletions.
14 changes: 11 additions & 3 deletions Tasks/code-push-vsts-task/CodePush.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ function ensureLoggedOut() {
// The main function to be executed.
function performDeployTask(accessKey, appName, packagePath, appStoreVersion, deploymentName, description, isMandatory) {
// If function arguments are provided (e.g. during test), use those, else, get user inputs provided by VSTS.
accessKey = accessKey || tl.getInput("accessKey", true);
var authType = tl.getInput("authType", false);
if (authType === "AccessKey") {
tl.getInput("accessKey", true);
} else if (authType === "ServiceEndpoint") {
var serviceAccount = tl.getEndpointAuthorization(tl.getInput("serviceEndpoint", true));
accessKey = serviceAccount.parameters.password;
}

accessKey = accessKey;
appName = appName || tl.getInput("appName", true);
packagePath = packagePath || tl.getPathInput("packagePath", true);
appStoreVersion = appStoreVersion || tl.getInput("appStoreVersion", true);
Expand All @@ -70,8 +78,8 @@ function performDeployTask(accessKey, appName, packagePath, appStoreVersion, dep
isMandatory = isMandatory || tl.getInput("isMandatory", false);

if (!accessKey) {
var serviceAccount = tl.getEndpointAuthorization(tl.getInput("serviceAccount", true));
accessKey = serviceAccount.password;
console.error("Access key required");
tl.setResult(1, "Access key required");
}

// Ensure all other users are logged out.
Expand Down
2 changes: 2 additions & 0 deletions Tasks/code-push-vsts-task/CodePush.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
param (
[string]$accessKey,
[string]$serviceEndpoint,
[string]$appName,
[string]$packagePath,
[string]$appStoreVersion,
Expand All @@ -9,6 +10,7 @@ param (
)

$env:INPUT_accessKey = $accessKey
$env:INPUT_serviceEndpoint = $serviceEndpoint
$env:INPUT_appName = $appName
$env:INPUT_packagePath = $packagePath
$env:INPUT_appStoreVersion = $appStoreVersion
Expand Down
14 changes: 7 additions & 7 deletions Tasks/code-push-vsts-task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
"name": "authType",
"type": "pickList",
"label": "Authentication Method",
"defaultValue": "ServiceAccount",
"defaultValue": "ServiceEndpoint",
"helpMarkDown": "",
"options": {
"ServiceAccount": "Service Account",
"ServiceEndpoint": "Service Endpoint",
"AccessKey": "Access Key"
}
},
{
"name": "serviceAccount",
"type": "connectedService:code-push",
"label": "Service Account",
"name": "serviceEndpoint",
"type": "connectedService:codepush-auth-key",
"label": "Service Endpoint",
"defaultValue": "",
"required": true,
"helpMarkDown": "The VSTS Service Account that specifies the idenity for Code Push.",
"visibleRule": "authType = ServiceAccount"
"helpMarkDown": "The VSTS Service Endpoint that specifies the identity for Code Push.",
"visibleRule": "authType = ServiceEndpoint"
},
{
"name": "accessKey",
Expand Down
6 changes: 3 additions & 3 deletions makevsix.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ node bin/tfxupload.js --installonly

if [ $1 == "create" ] ; then
echo "Creating VSIX..."
tfx extension create --manifest-globs vso-extension-android.json --override '{ "public": true }'
tfx extension create --manifest-globs vsts-extension-code-push.json --override '{ "public": true }'
fi

if [ $1 == "createtest" ] ; then
echo "Creating Test VSIX..."
tfx extension create --manifest-globs vso-extension-android.json --override '{ "public": "false", "name": "Google Play Store Deploy-Dev", "id": "vso-extension-android-dev", "publisher": "ms-mobiledevops-test"}' --share-with mobiledevops x04ty29er --token $PUBLISH_ACCESSTOKEN
tfx extension create --manifest-globs vsts-extension-code-push.json --override '{ "public": "false", "name": "CodePush-Dev", "id": "code-push-dev", "publisher": "ms-mobiledevops-test"}' --share-with mobiledevops x04ty29er --token $PUBLISH_ACCESSTOKEN
fi

if [ $1 == "publishtest" ] ; then
echo "Creating and publishing test VSIX..."
tfx extension publish --manifest-globs vso-extension-android.json --override '{ "public": "false", "name": "Google Play Store Deploy-Dev", "id": "vso-extension-android-dev", "publisher": "ms-mobiledevops-test"}' --share-with mobiledevops x04ty29er --token $PUBLISH_ACCESSTOKEN
tfx extension publish --manifest-globs vsts-extension-code-push.json --override '{ "public": "false", "name": "CodePush-Dev", "id": "code-push-dev", "publisher": "ms-mobiledevops-test"}' --share-with mobiledevops x04ty29er --token $PUBLISH_ACCESSTOKEN
fi
31 changes: 19 additions & 12 deletions vsts-extension-code-push.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
"name": "CodePush",
"version": "1.0.1",
"publisher": "ms-vsclient",
"public": true,
"description": "Provides a deploy task that enables performing continuous delivery to the CodePush service from an automated VSTS build definition",
"categories": [
"Build and release"
],
"scopes": [
"vso.build"
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"scope": [
"vso.build",
"vso.serviceendpoint"
],
"tags": [
"Cordova", "React Native", "CodePush", "Deploy", "Continuous Integration", "Continuous Delivery", "Android", "iOS"
Expand Down Expand Up @@ -39,12 +44,12 @@
"path": "docs/extension-overview.md"
},
"thirdpartynotice": {
"path": "thirdpartynotices.txt"
"path": "ThirdPartyNotices.txt"
}
},
"files": [
{
"path": "code-push-vsts-task"
"path": "Tasks/code-push-vsts-task"
},
{
"path": "images",
Expand All @@ -57,20 +62,20 @@
"type": "ms.vss-distributed-task.task",
"targets": [ "ms.vss-distributed-task.tasks" ],
"properties": {
"name": "code-push-vsts-task"
"name": "Tasks/code-push-vsts-task"
}
},
{
"id": "code-push-service-endpoint",
"id": "codepush-service-endpoint",
"description": "CodePushAuthenticationEndpoint",
"type": "ms.vss-endpoint.service-endpoint-type",
"targets": [
"ms.vss-endpoint.endpoint-types"
],
"properties": {
"name": "code-push",
"name": "codepush-auth-key",
"displayName": "Code Push",
"url": "https://microsoft.github.io/code-push",
"url": "https://accounts.google.com/o/oauth2/v2/auth",
"inputDescriptors": [],
"authenticationSchemes": [
{
Expand All @@ -79,21 +84,23 @@
{
"id": "username",
"name": "Username",
"description": "",
"description": "Username",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"isRequired": false,
"dataType": "string"
},
"values": {
"inputId": "usernameInput",
"defaultValue": "",
"isDisabled": true
}
},
{
"id": "password",
"name": "Access Key",
"description": "Access Key from Code Push CLI",
"description": "Access key from CodePush CLI.",
"inputMode": "textbox",
"isConfidential": true,
"validation": {
Expand Down

0 comments on commit c85098e

Please sign in to comment.