-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure App service Manage & Deploy Task Spec changes #4125
Changes from 16 commits
0cf2859
3f4a15f
6a8d626
360cca0
8c5c02a
9e87356
943e6a8
a4479fa
9f35e22
6415853
1340920
1f1e813
0bbfb17
73df314
86c9bf5
3500570
4f16b46
9ab7ef1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ export async function getInstalledExtensions(publishingProfile) { | |
var extensionsList = JSON.parse(body); | ||
for(var extension of extensionsList) { | ||
tl.debug('* ' + extension['id']); | ||
installedExtensionsList[extension['id']] = extension['title']; | ||
installedExtensionsList[extension['id']] = extension; | ||
} | ||
defer.resolve(installedExtensionsList); | ||
} | ||
|
@@ -52,8 +52,9 @@ export async function installExtension(publishingProfile, extension: string) { | |
} | ||
else if(response.statusCode === 200) { | ||
tl.debug(body); | ||
console.log(tl.loc('ExtensionInstallSuccess', extension)); | ||
defer.resolve(JSON.parse(body)); | ||
var responseBody = JSON.parse(body); | ||
console.log(tl.loc('ExtensionInstallSuccess', responseBody['title'])); | ||
defer.resolve(responseBody); | ||
} | ||
else { | ||
console.log(body); | ||
|
@@ -64,19 +65,48 @@ export async function installExtension(publishingProfile, extension: string) { | |
return defer.promise; | ||
} | ||
|
||
export async function installExtensions(publishingProfile, extensions: Array<string>) { | ||
export async function installExtensions(publishingProfile, extensions: Array<string>, extensionOutputVariables: Array<string>) { | ||
|
||
var outputVariableCount = 0; | ||
var outputVariableSize = extensionOutputVariables.length; | ||
var InstalledExtensions = await getInstalledExtensions(publishingProfile); | ||
var extensionInfo = null; | ||
var anyExtensionInstalled = false; | ||
for(var extension of extensions) { | ||
extension = extension.trim(); | ||
if(InstalledExtensions[extension]) { | ||
console.log(tl.loc('ExtensionAlreadyAvaiable', InstalledExtensions[extension])); | ||
extensionInfo = InstalledExtensions[extension]; | ||
console.log(tl.loc('ExtensionAlreadyAvaiable', extensionInfo['title'])); | ||
} | ||
else { | ||
tl.debug("Extension '" + extension + "' not installed. Installing..."); | ||
await installExtension(publishingProfile, extension); | ||
extensionInfo = await installExtension(publishingProfile, extension); | ||
anyExtensionInstalled = true; | ||
} | ||
if(outputVariableCount < outputVariableSize) { | ||
var extensionLocalPath: string = getExtensionLocalPath(extensionInfo); | ||
tl.debug('Set Variable ' + extensionOutputVariables[outputVariableCount] + ' to value: ' + extensionLocalPath); | ||
tl.setVariable(extensionOutputVariables[outputVariableCount], extensionLocalPath); | ||
outputVariableCount += 1; | ||
} | ||
} | ||
return anyExtensionInstalled; | ||
} | ||
|
||
function getExtensionLocalPath(extensionInfo: JSON): string { | ||
var extensionId: string = extensionInfo['id']; | ||
var homeDir = "D:\\home\\"; | ||
|
||
if(extensionId.startsWith('python2')) { | ||
return homeDir + "Python27"; | ||
} | ||
else if(extensionId.startsWith('python351') || extensionId.startsWith('python352')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may not be required as we are not showing option to install 3.5 < python version < 3.5.3 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additional check, if we add them. |
||
return homeDir + "Python35"; | ||
} | ||
else if(extensionId.startsWith('python3')) { | ||
return homeDir + extensionId; | ||
} | ||
else { | ||
return extensionInfo['local_path']; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
"version": { | ||
"Major": 0, | ||
"Minor": 2, | ||
"Patch": 7 | ||
"Patch": 8 | ||
}, | ||
"minimumAgentVersion": "1.102.0", | ||
"instanceNameFormat": "$(Action): $(WebAppName)", | ||
|
@@ -155,6 +155,14 @@ | |
"required": "True", | ||
"visibleRule": "Action = Install Extensions", | ||
"helpMarkDown": "Site Extensions run on Microsoft Azure App Service. You can install set of tools as site extension and better manage your Azure App Service. The App Service will be restarted to make sure latest changes take effect." | ||
}, | ||
{ | ||
"name": "OutputVariable", | ||
"type": "string", | ||
"label": "Output variable", | ||
"defaultValue": "", | ||
"visibleRule": "Action = Install Extensions", | ||
"helpMarkDown": "Provide the variable name for the local installation path for the selected extension.<br />Note: In case of multiple extensions selected for installation, provide comma separated list of variables that saves the local path for each of the selected extension in the order it appears in the Install Extension field" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give an example. Should the name be just varName or $(varName)? |
||
} | ||
], | ||
"dataSourceBindings": [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we wait for Stop as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop actually stops the App Service to accept any request. We should be good here.