-
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
add default params for MSDEPLOY #6527
Merged
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
caea0c0
add default params for MSDEPLOY
vincent1173 3d122a1
fix L0 failure
vincent1173 165465f
Update L0MSDeployUtility.ts
vincent1173 424bee7
changed let to var (node 5)
vincent1173 02a10f6
fixed tests
vincent1173 8ae34b1
resolve merge conflicts
vincent1173 bf949dc
bump-up patch version
vincent1173 1f01471
added check for setparam file
vincent1173 89fab04
addressed review comments
vincent1173 a7a1ac3
formatting fix
vincent1173 46423a2
Update L0.ts
vincent1173 4fba5fe
resolved merge conflicts
vincent1173 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
Tasks/Common/webdeployment-common/Tests/L0MSDeployUtility.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
var msdeployUtility = require('webdeployment-common/msdeployutility.js'); | ||
|
||
function checkParametersIfPresent(argumentString: string, argumentCheckArray: Array<string>) { | ||
for(var argument of argumentCheckArray) { | ||
if(argumentString.indexOf(argument) == -1) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
var defaultMSBuildPackageArgument: string = msdeployUtility.getMSDeployCmdArgs('package.zip', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, true, false, true, null, null, null, true, false, true); | ||
|
||
console.log(` * MSBUILD DEFAULT PARAMS: ${defaultMSBuildPackageArgument}`); | ||
if(checkParametersIfPresent(defaultMSBuildPackageArgument, ["-source:package=\"'package.zip'\"", | ||
" -dest:auto,ComputerName=\"'https://http://webapp_name.scm.azurewebsites.net:443/msdeploy.axd?site=webapp_name'\",UserName=\"'$webapp_name'\",Password=\"'webapp_password'\",AuthType=\"'Basic'\"", | ||
" -setParam:name=\"'IIS Web Application Name'\",value=\"'webapp_name'\"", '-enableRule:AppOffline'])) { | ||
console.log("MSBUILD DEFAULT PARAMS PASSED"); | ||
} | ||
else { | ||
throw new Error('MSBUILD PACKAGE DEFAULT PARAMS FAILED'); | ||
} | ||
|
||
|
||
if(checkParametersIfPresent(defaultMSBuildPackageArgument, ['-retryAttempts:6', '-retryInterval:10000'])) { | ||
console.log('MSDEPLOY ARGUMENT RETRY FLAG PASSED'); | ||
} | ||
else { | ||
throw new Error('MSBUILD DEFAULT PARAMS FAILED: RETRY FLAG MISMATCH'); | ||
} | ||
|
||
|
||
var packageWithSetParamArgument: string = msdeployUtility.getMSDeployCmdArgs('package.zip', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, false, false, true, null, 'temp_param.xml', null, false, false, true); | ||
|
||
|
||
console.log(` * PACKAGE WITh SET PARAMS: ${packageWithSetParamArgument}`); | ||
|
||
|
||
if(checkParametersIfPresent(packageWithSetParamArgument, ['-setParamFile=temp_param.xml', "-dest:contentPath=\"'webapp_name'\"" , '-enableRule:DoNotDelete'])) { | ||
console.log('ARGUMENTS WITH SET PARAMS PASSED'); | ||
} | ||
else { | ||
throw Error('ARGUMENTS WITH SET PARAMS FAILED'); | ||
} | ||
|
||
var folderPackageArgument: string = msdeployUtility.getMSDeployCmdArgs('c:/package/folder', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, true, false, true, null, null, null, true, true, true); | ||
|
||
console.log(` * ARGUMENT WITh FOLDER AS PACKAGE: ${folderPackageArgument}`); | ||
if(checkParametersIfPresent(folderPackageArgument, [ | ||
"-source:IisApp=\"'c:/package/folder'\"", | ||
" -dest:iisApp=\"'webapp_name'\"" | ||
])) { | ||
console.log('ARGUMENT WITH FOLDER PACKAGE PASSED'); | ||
} | ||
else { | ||
throw Error('ARGUMENT WITH FOLDER PACKAGE FAILED'); | ||
} | ||
|
||
|
||
var packageWithExcludeAppDataArgument: string = msdeployUtility.getMSDeployCmdArgs('package.zip', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, false, true, true, null, null, null, false, false, true); | ||
|
||
console.log(` * ARGUMENT WITh FOLDER AS PACKAGE: ${packageWithExcludeAppDataArgument}`); | ||
|
||
if(checkParametersIfPresent(packageWithExcludeAppDataArgument, ['-skip:Directory=App_Data'])) { | ||
console.log('ARGUMENT WITH EXCLUDE APP DATA PASSED'); | ||
} | ||
else { | ||
throw new Error('ARGUMENT WITH EXCLUDE APP DATA FAILED'); | ||
} | ||
|
||
|
||
var warDeploymentArgument: string = msdeployUtility.getMSDeployCmdArgs('package.war', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, false, true, true, null, null, null, false, false, true); | ||
|
||
console.log(` * ARGUMENT WITh WAR FILE AS PACKAGE: ${warDeploymentArgument}`); | ||
if(checkParametersIfPresent(warDeploymentArgument, [ | ||
" -source:contentPath=\"'package.war'\"", | ||
" -dest:contentPath=\"'/site/webapps/package.war'\"" | ||
])) { | ||
console.log('ARGUMENT WITH WAR PACKAGE PASSED'); | ||
} | ||
else { | ||
throw new Error('ARGUMENT WITH WAR PACKAGE FAILED'); | ||
} | ||
|
||
var overrideRetryArgument: string = msdeployUtility.getMSDeployCmdArgs('package.zip', 'webapp_name', { | ||
publishUrl: 'http://webapp_name.scm.azurewebsites.net:443', userName: '$webapp_name', userPWD: 'webapp_password' | ||
}, false, true, true, null, null, '-retryAttempts:11 -retryInterval:5000', false, false, true); | ||
|
||
console.log(` * ARGUMENTS WITH WAR FILE: ${overrideRetryArgument}`); | ||
|
||
if(checkParametersIfPresent(overrideRetryArgument, ['-retryAttempts:11', '-retryInterval:5000'])) { | ||
console.log('ARGUMENT WITH OVERRIDE RETRY FLAG PASSED'); | ||
} | ||
else { | ||
throw new Error('ARGUMENT WITH OVERRIDE RETRY FLAG FAILED'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Instead of all these, why can't we just add the default values in the task.json for "additionalArguments" input? The task code will handle them as just another additional arguments input. This will be transparent as user know the values with which msdeploy is being run. User has flexibility to update the default values if required.
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.
Updated the value based on the discussion.