├── .CodeQL.yml ├── .config ├── 1espt │ └── PipelineAutobaseliningConfig.yml └── guardian │ └── .gdnbaselines ├── .gdn └── .gdnbaselines ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── 1.regression.yml │ ├── 2.bug.yml │ ├── 3.question.yml │ └── config.yml ├── pull_request_template.md └── workflows │ ├── release-ansible.yml │ └── release-iiswebapp.yml ├── .gitignore ├── .npmrc ├── .pipelines └── 1es-migration │ └── azure-pipelines.yml ├── .taskkey ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── DEPRECATION.md ├── Extensions ├── Ansible │ ├── Src │ │ ├── Assets │ │ │ └── MITLicense.txt │ │ ├── Images │ │ │ ├── ansible_endpoint.PNG │ │ │ ├── ansible_screen_1.PNG │ │ │ ├── ansible_screen_2.PNG │ │ │ ├── icon_default.png │ │ │ └── icon_wide.png │ │ ├── Tasks │ │ │ └── Ansible │ │ │ │ ├── .npmrc │ │ │ │ ├── ansibleCommandLineInterface.ts │ │ │ │ ├── ansibleInterface.ts │ │ │ │ ├── ansibleRemoteMachineInterface.ts │ │ │ │ ├── ansibleTaskParameters.ts │ │ │ │ ├── ansibleTowerInterface.ts │ │ │ │ ├── ansibleUtils.ts │ │ │ │ ├── icon.png │ │ │ │ ├── main.ts │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── task.json │ │ ├── readme.md │ │ └── vss-extension.json │ └── Tests │ │ └── Tasks │ │ └── Ansible │ │ ├── _suite.ts │ │ ├── mockAnsibleUtils.ts │ │ ├── testInventoryToBeHostListForAgentMachine.ts │ │ ├── testInventoryToBeHostListForRemoteMachine.ts │ │ ├── testInventoryToBeInlineForAgentMachine.ts │ │ ├── testInventoryToBeInlineForRemoteMachine.ts │ │ ├── testPlaybookAndInventoryOnAgentMachineForAgentMachine.ts │ │ ├── testPlaybookAndInventoryOnAgentMachineForRemoteMachine.ts │ │ ├── testPlaybookAndInventoryOnAnsibleMachineForRemoteMachine.ts │ │ ├── testSudoUserAndAdditionalParamsProvidedForRemoteMachine.ts │ │ └── testTower.ts ├── ArtifactEngine │ ├── .gitignore │ ├── .npmrc │ ├── .vscode │ │ ├── launch.json │ │ ├── settings.json │ │ └── tasks.json │ ├── E2ETests │ │ ├── failure.e2e.ts │ │ ├── fileshare.e2e.ts │ │ ├── jenkins.e2e.ts │ │ └── vsts.e2e.ts │ ├── Engine │ │ ├── artifactEngine.ts │ │ ├── artifactEngineOptions.ts │ │ ├── cilogger.ts │ │ ├── index.ts │ │ ├── logger.ts │ │ └── worker.ts │ ├── EngineTests │ │ └── artifactEngineTests.ts │ ├── IntegrationTests │ │ ├── jenkinsTests.ts │ │ └── proxyTests.ts │ ├── Models │ │ ├── artifactDownloadTicket.ts │ │ ├── artifactItem.ts │ │ ├── artifactprovider.ts │ │ ├── constants.ts │ │ ├── index.ts │ │ ├── itemType.ts │ │ └── ticketState.ts │ ├── PerfTests │ │ ├── fileshare.perf.ts │ │ ├── jenkins.perf.ts │ │ └── vsts.perf.ts │ ├── Providers │ │ ├── filesystemProvider.ts │ │ ├── index.ts │ │ ├── jenkins.handlebars │ │ ├── jenkins.handlebars.json │ │ ├── stubProvider.ts │ │ ├── teamcity.handlebars │ │ ├── teamcity.handlebars.json │ │ ├── typed-rest-client │ │ │ ├── Handlers.ts │ │ │ ├── HttpClient.ts │ │ │ ├── Index.ts │ │ │ ├── Interfaces.ts │ │ │ ├── RestClient.ts │ │ │ ├── Util.ts │ │ │ ├── handlers │ │ │ │ ├── basiccreds.ts │ │ │ │ ├── bearertoken.ts │ │ │ │ ├── ntlm.ts │ │ │ │ └── personalaccesstoken.ts │ │ │ └── opensource │ │ │ │ └── node-http-ntlm │ │ │ │ ├── ntlm.js │ │ │ │ └── readme.txt │ │ ├── vsts.handlebars │ │ ├── webClient.ts │ │ ├── webClientFactory.ts │ │ ├── webProvider.ts │ │ └── zipProvider.ts │ ├── ProvidersTests │ │ ├── filesystemProviderTests.ts │ │ └── webProviderTests.ts │ ├── README.md │ ├── Store │ │ ├── artifactItemStore.ts │ │ └── index.ts │ ├── StoreTests │ │ └── artifactItemStoreTests.ts │ ├── Strings │ │ └── resources.resjson │ │ │ ├── de-DE │ │ │ └── resources.resjson │ │ │ ├── en-US │ │ │ └── resources.resjson │ │ │ ├── es-ES │ │ │ └── resources.resjson │ │ │ ├── fr-FR │ │ │ └── resources.resjson │ │ │ ├── it-IT │ │ │ └── resources.resjson │ │ │ ├── ja-JP │ │ │ └── resources.resjson │ │ │ ├── ko-KR │ │ │ └── resources.resjson │ │ │ ├── ru-RU │ │ │ └── resources.resjson │ │ │ ├── zh-CN │ │ │ └── resources.resjson │ │ │ └── zh-TW │ │ │ └── resources.resjson │ ├── TODO.md │ ├── TestData │ │ └── Jenkins │ │ │ ├── file1.pdb │ │ │ └── folder1 │ │ │ └── file2.txt │ ├── ThirdPartyNotices.txt │ ├── lib.json │ ├── package-lock.json │ ├── package.json │ ├── sequence.svg │ ├── test.config.json.example │ ├── tsconfig.json │ ├── usage.png │ └── xliff │ │ ├── de-DE.xlf │ │ ├── es-ES.xlf │ │ ├── fr-FR.xlf │ │ ├── it-IT.xlf │ │ ├── ja-JP.xlf │ │ ├── ko-KR.xlf │ │ ├── ru-RU.xlf │ │ ├── zh-CN.xlf │ │ └── zh-TW.xlf ├── BitBucket │ └── Src │ │ ├── Tasks │ │ └── DownloadArtifactsBitbucket │ │ │ ├── .npmrc │ │ │ ├── Bitbucket.njsproj │ │ │ ├── ThirdPartyNotices.txt │ │ │ ├── downloadBitbucket.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── sourcecontrolwrapper.js │ │ │ └── task.json │ │ ├── images │ │ ├── screen1.png │ │ ├── screen2.png │ │ └── vss_default.png │ │ ├── mp_terms.md │ │ ├── readme.md │ │ └── vss-extension.json ├── CircleCI │ └── Src │ │ ├── Tasks │ │ └── DownloadCircleCIArtifacts │ │ │ ├── .npmrc │ │ │ ├── Strings │ │ │ └── resources.resjson │ │ │ │ └── en-US │ │ │ │ └── resources.resjson │ │ │ ├── circleCI.handlebars.txt │ │ │ ├── commitsdownloader.ts │ │ │ ├── download.ts │ │ │ ├── icon.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── task.json │ │ │ └── tsconfig.json │ │ ├── images │ │ ├── Add_CircleCI_Artifact.png │ │ ├── Add_CircleCI_Connection.png │ │ └── icon-circleci-logo.png │ │ ├── mp_terms.md │ │ ├── readme.md │ │ └── vss-extension.json ├── Common │ ├── DeploymentSDK │ │ ├── Src │ │ │ ├── InvokeRemoteDeployment.ps1 │ │ │ ├── Microsoft.VisualStudio.Services.DevTestLabs.Definition.dll │ │ │ ├── Microsoft.VisualStudio.Services.DevTestLabs.Deployment.dll │ │ │ ├── Newtonsoft.Json.dll │ │ │ ├── Utility.ps1 │ │ │ ├── VisualStudioRemoteDeployer.exe │ │ │ └── VisualStudioRemoteDeployer.exe.config │ │ └── Tests │ │ │ ├── InvokeRemoteDeployment.Tests.ps1 │ │ │ └── Utility.Tests.ps1 │ ├── TelemetryHelper │ │ └── Src │ │ │ └── TelemetryHelper.ps1 │ └── lib │ │ ├── Initialize-Test.ps1 │ │ ├── Start-TestRunner.ps1 │ │ ├── TestHelpersModule │ │ ├── PrivateFunctions.ps1 │ │ ├── PublicFunctions.ps1 │ │ ├── README.md │ │ └── TestHelpersModule.psm1 │ │ ├── mockHelper.ts │ │ ├── psRunner.ts │ │ ├── taskRunner.ts │ │ └── vsts-task-lib │ │ ├── .npmrc │ │ ├── mock.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── readme.txt │ │ ├── sampleresponses.json │ │ ├── task.js │ │ ├── taskcommand.js │ │ └── toolRunner.js ├── ExternalTfs │ └── Src │ │ ├── Tasks │ │ ├── DownloadArtifactsTfsGit │ │ │ ├── .npmrc │ │ │ ├── ThirdPartyNotices.txt │ │ │ ├── auth.js │ │ │ ├── downloadTfGit.js │ │ │ ├── gitwrapper.js │ │ │ ├── icon.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── task.json │ │ ├── DownloadArtifactsTfsVersionControl │ │ │ ├── .npmrc │ │ │ ├── ThirdPartyNotices.txt │ │ │ ├── downloadTfsVersionControl.js │ │ │ ├── icon.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── task.json │ │ │ └── tfvcwrapper.js │ │ └── DownloadExternalBuildArtifacts │ │ │ ├── .npmrc │ │ │ ├── Strings │ │ │ └── resources.resjson │ │ │ │ └── en-US │ │ │ │ └── resources.resjson │ │ │ ├── ThirdPartyNotices.txt │ │ │ ├── auth.ts │ │ │ ├── download.ts │ │ │ ├── icon.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── task.json │ │ │ ├── task.loc.json │ │ │ ├── tsconfig.json │ │ │ └── vsts.handlebars │ │ ├── images │ │ ├── screen1.png │ │ ├── screen2.png │ │ ├── screen3.png │ │ ├── screen4.png │ │ └── screen5.png │ │ ├── mp_terms.md │ │ ├── readme.md │ │ ├── vss-extension.json │ │ ├── vss_default.png │ │ └── vss_wide.png ├── IISWebAppDeploy │ ├── Src │ │ ├── Assets │ │ │ └── MITLicense.txt │ │ ├── CHANGELOG.md │ │ ├── Images │ │ │ ├── IISWebDeployment.png │ │ │ ├── IISWebDeploymentTasks.png │ │ │ ├── IISWebManagement.png │ │ │ ├── IIS_Web_App.png │ │ │ ├── IIS_Web_App_Large.png │ │ │ └── SQLServerDacpac.png │ │ ├── README.md │ │ ├── Tasks │ │ │ ├── IISWebAppDeploy │ │ │ │ ├── IISWebAppDeployV1 │ │ │ │ │ ├── DeployIISWebApp.ps1 │ │ │ │ │ ├── MITLicense.txt │ │ │ │ │ ├── Main.ps1 │ │ │ │ │ ├── MsDeployOnTargetMachines.ps1 │ │ │ │ │ ├── README_IISAppDeploy.md │ │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ │ ├── externals.json │ │ │ │ │ ├── icon.png │ │ │ │ │ └── task.json │ │ │ │ └── IISWebAppDeployV2 │ │ │ │ │ ├── DeployIISWebApp.ps1 │ │ │ │ │ ├── MITLicense.txt │ │ │ │ │ ├── Main.ps1 │ │ │ │ │ ├── MsDeployOnTargetMachines.ps1 │ │ │ │ │ ├── README_IISAppDeploy.md │ │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ │ ├── externals.json │ │ │ │ │ ├── icon.png │ │ │ │ │ └── task.json │ │ │ ├── IISWebAppMgmt │ │ │ │ ├── IISWebAppMgmtV1 │ │ │ │ │ ├── AppCmdOnTargetMachines.ps1 │ │ │ │ │ ├── MITLicense.txt │ │ │ │ │ ├── Main.ps1 │ │ │ │ │ ├── ManageIISWebApp.ps1 │ │ │ │ │ ├── README_IISAppMgmt.md │ │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ │ ├── externals.json │ │ │ │ │ ├── icon.png │ │ │ │ │ └── task.json │ │ │ │ ├── IISWebAppMgmtV2 │ │ │ │ │ ├── AppCmdOnTargetMachines.ps1 │ │ │ │ │ ├── MITLicense.txt │ │ │ │ │ ├── Main.ps1 │ │ │ │ │ ├── README_IISAppMgmt.md │ │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ │ ├── Utility.ps1 │ │ │ │ │ ├── externals.json │ │ │ │ │ ├── icon.png │ │ │ │ │ └── task.json │ │ │ │ └── IISWebAppMgmtV3 │ │ │ │ │ ├── AppCmdOnTargetMachines.ps1 │ │ │ │ │ ├── MITLicense.txt │ │ │ │ │ ├── Main.ps1 │ │ │ │ │ ├── README_IISAppMgmt.md │ │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ │ ├── Utility.ps1 │ │ │ │ │ ├── externals.json │ │ │ │ │ ├── icon.png │ │ │ │ │ └── task.json │ │ │ └── SqlDacpacDeploy │ │ │ │ ├── SqlDacpacDeployV1 │ │ │ │ ├── DeployToSqlServer.ps1 │ │ │ │ ├── MITLicense.txt │ │ │ │ ├── Main.ps1 │ │ │ │ ├── README.md │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ ├── externals.json │ │ │ │ ├── icon.png │ │ │ │ ├── icon.svg │ │ │ │ └── task.json │ │ │ │ └── SqlDacpacDeployV2 │ │ │ │ ├── DeployToSqlServer.ps1 │ │ │ │ ├── MITLicense.txt │ │ │ │ ├── Main.ps1 │ │ │ │ ├── README.md │ │ │ │ ├── ThirdPartyNotices.txt │ │ │ │ ├── externals.json │ │ │ │ ├── icon.png │ │ │ │ ├── icon.svg │ │ │ │ └── task.json │ │ └── vss-extension.json │ └── Tests │ │ └── Tasks │ │ ├── IISWebAppDeploy │ │ ├── IISWebAppDeployV1 │ │ │ ├── L0ComputeMsDeploySetParamsFunction.ps1 │ │ │ ├── L0ContainsParamFileXmlFunction.ps1 │ │ │ ├── L0DeployWebSiteFunction.ps1 │ │ │ ├── L0EscapeSpecialCharactersFunction.ps1 │ │ │ ├── L0ExecuteMainFunction.ps1 │ │ │ ├── L0GetMsDeployCmdArgsFunction.ps1 │ │ │ ├── L0GetMsDeployLocationFunction.ps1 │ │ │ ├── L0GetScriptToRunFunction.ps1 │ │ │ ├── L0IsDirectoryFunction.ps1 │ │ │ ├── L0MainFunction.ps1 │ │ │ ├── L0RunCommandFunction.ps1 │ │ │ ├── L0RunRemoteDeploymentFunction.ps1 │ │ │ ├── L0TrimInputsFunction.ps1 │ │ │ └── _suite.ts │ │ └── IISWebAppDeployV2 │ │ │ ├── L0ComputeMsDeploySetParamsFunction.ps1 │ │ │ ├── L0ContainsParamFileXmlFunction.ps1 │ │ │ ├── L0DeployWebSiteFunction.ps1 │ │ │ ├── L0EscapeSpecialCharactersFunction.ps1 │ │ │ ├── L0ExecuteMainFunction.ps1 │ │ │ ├── L0GetMsDeployCmdArgsFunction.ps1 │ │ │ ├── L0GetMsDeployLocationFunction.ps1 │ │ │ ├── L0GetScriptToRunFunction.ps1 │ │ │ ├── L0IsDirectoryFunction.ps1 │ │ │ ├── L0MainFunction.ps1 │ │ │ ├── L0RunCommandFunction.ps1 │ │ │ ├── L0RunRemoteDeploymentFunction.ps1 │ │ │ ├── L0TrimInputsFunction.ps1 │ │ │ └── _suite.ts │ │ ├── IISWebAppMgmt │ │ ├── IISWebAppMgmtV1 │ │ │ ├── L0AddSslCertFunction.ps1 │ │ │ ├── L0CreateAndUpdateAppPoolFunction.ps1 │ │ │ ├── L0CreateAndUpdateWebSiteFunction.ps1 │ │ │ ├── L0CreateAppPoolFunction.ps1 │ │ │ ├── L0CreateWebsiteFunction.ps1 │ │ │ ├── L0DoesAppPoolExistsFunction.ps1 │ │ │ ├── L0DoesBindingExistsFunction.ps1 │ │ │ ├── L0DoesWebsiteExistsFunction.ps1 │ │ │ ├── L0EnableSniFunction.ps1 │ │ │ ├── L0EscapeSpecialCharsFunction.ps1 │ │ │ ├── L0ExecuteMainFunction.ps1 │ │ │ ├── L0GetAppCmdLocationFunction.ps1 │ │ │ ├── L0GetHostNameFunction.ps1 │ │ │ ├── L0GetScriptToRunFunction.ps1 │ │ │ ├── L0MainFunction.ps1 │ │ │ ├── L0RunAdditionalCommandsFunction.ps1 │ │ │ ├── L0RunCommandFunction.ps1 │ │ │ ├── L0RunRemoteDeploymentFunction.ps1 │ │ │ ├── L0TrimInputsFunction.ps1 │ │ │ ├── L0UpdateAppPoolFunction.ps1 │ │ │ ├── L0UpdateWebSiteFunction.ps1 │ │ │ ├── L0ValidateInputsFunction.ps1 │ │ │ └── _suite.ts │ │ ├── IISWebAppMgmtV2 │ │ │ ├── L0AppcmdAddUpdateAppPool.ps1 │ │ │ ├── L0AppcmdAddUpdateApplication.ps1 │ │ │ ├── L0AppcmdAddUpdateVDir.ps1 │ │ │ ├── L0AppcmdAddUpdateWebsite.ps1 │ │ │ ├── L0AppcmdAdditionalActions.ps1 │ │ │ ├── L0AppcmdInvokeMain.ps1 │ │ │ ├── L0AppcmdTestAddWebsiteBindings.ps1 │ │ │ ├── L0AppcmdTestApplicationExists.ps1 │ │ │ ├── L0AppcmdTestApplicationPoolExists.ps1 │ │ │ ├── L0AppcmdTestBinding.ps1 │ │ │ ├── L0AppcmdTestSSLandSNI.ps1 │ │ │ ├── L0AppcmdTestVirtualDirExists.ps1 │ │ │ ├── L0AppcmdTestWebsiteExists.ps1 │ │ │ ├── L0EscapeSpecialCharsFunction.ps1 │ │ │ ├── L0GetHostNameFunction.ps1 │ │ │ ├── L0RepairInputsFunction.ps1 │ │ │ ├── L0UtilityManageApp.ps1 │ │ │ ├── L0UtilityManageAppPool.ps1 │ │ │ ├── L0UtilityManageVDir.ps1 │ │ │ ├── L0UtilityManageWebsite.ps1 │ │ │ ├── L0UtilityRunRemoteDeploymentFunction.ps1 │ │ │ ├── MockHelpers.ps1 │ │ │ └── _suite.ts │ │ └── IISWebAppMgmtV3 │ │ │ ├── L0AppcmdAddUpdateAppPool.ps1 │ │ │ ├── L0AppcmdAddUpdateApplication.ps1 │ │ │ ├── L0AppcmdAddUpdateVDir.ps1 │ │ │ ├── L0AppcmdAddUpdateWebsite.ps1 │ │ │ ├── L0AppcmdAdditionalActions.ps1 │ │ │ ├── L0AppcmdInvokeMain.ps1 │ │ │ ├── L0AppcmdTestAddWebsiteBindings.ps1 │ │ │ ├── L0AppcmdTestApplicationExists.ps1 │ │ │ ├── L0AppcmdTestApplicationPoolExists.ps1 │ │ │ ├── L0AppcmdTestBinding.ps1 │ │ │ ├── L0AppcmdTestSSLandSNI.ps1 │ │ │ ├── L0AppcmdTestVirtualDirExists.ps1 │ │ │ ├── L0AppcmdTestWebsiteExists.ps1 │ │ │ ├── L0EscapeSpecialCharsFunction.ps1 │ │ │ ├── L0GetHostNameFunction.ps1 │ │ │ ├── L0RepairInputsFunction.ps1 │ │ │ ├── L0UtilityManageApp.ps1 │ │ │ ├── L0UtilityManageAppPool.ps1 │ │ │ ├── L0UtilityManageVDir.ps1 │ │ │ ├── L0UtilityManageWebsite.ps1 │ │ │ ├── L0UtilityRunRemoteDeploymentFunction.ps1 │ │ │ ├── MockHelpers.ps1 │ │ │ └── _suite.ts │ │ └── SqlDacpacDeploy │ │ ├── SqlDacpacDeployV1 │ │ ├── L0EscapeSpecialCharsFunction.ps1 │ │ ├── L0GetScriptToRunFunction.ps1 │ │ ├── L0GetSqlPackageCmdArgsFunction.ps1 │ │ ├── L0GetSqlPackageForSqlVersionFunction.ps1 │ │ ├── L0GetSqlPackageOnTargetMachineFunction.ps1 │ │ ├── L0ImportSqlPs.ps1 │ │ ├── L0InvokeDacpacDeploymentFunction.ps1 │ │ ├── L0InvokeSqlQueryDeploymentFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageInVSFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageWithDacMsiFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageWithSqlFunction.ps1 │ │ ├── L0LocateSqlPackageInVSFunction.ps1 │ │ ├── L0MainFunction.ps1 │ │ ├── L0RunCommandFunction.ps1 │ │ ├── L0RunRemoteDeploymentFunction.ps1 │ │ ├── L0TrimInputsFunction.ps1 │ │ ├── SqlDacpacDeployTestL0Initialize.ps1 │ │ └── _suite.ts │ │ └── SqlDacpacDeployV2 │ │ ├── L0EscapeSpecialCharsFunction.ps1 │ │ ├── L0GetScriptToRunFunction.ps1 │ │ ├── L0GetSqlPackageCmdArgsFunction.ps1 │ │ ├── L0GetSqlPackageForSqlVersionFunction.ps1 │ │ ├── L0GetSqlPackageOnTargetMachineFunction.ps1 │ │ ├── L0ImportSqlPs.ps1 │ │ ├── L0InvokeDacpacDeploymentFunction.ps1 │ │ ├── L0InvokeSqlQueryDeploymentFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageInVSFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageWithDacMsiFunction.ps1 │ │ ├── L0LocateHighestVersionSqlPackageWithSqlFunction.ps1 │ │ ├── L0LocateSqlPackageInVSFunction.ps1 │ │ ├── L0MainFunction.ps1 │ │ ├── L0RunCommandFunction.ps1 │ │ ├── L0RunRemoteDeploymentFunction.ps1 │ │ ├── L0TrimInputsFunction.ps1 │ │ ├── SqlDacpacDeployTestL0Initialize.ps1 │ │ └── _suite.ts ├── ServiceNow │ └── Src │ │ ├── Tasks │ │ ├── CreateAndQueryChangeRequest │ │ │ ├── CreateAndQueryChangeRequestV0 │ │ │ │ ├── icon.png │ │ │ │ └── task.json │ │ │ ├── CreateAndQueryChangeRequestV1 │ │ │ │ ├── icon.png │ │ │ │ └── task.json │ │ │ └── CreateAndQueryChangeRequestV2 │ │ │ │ ├── icon.png │ │ │ │ └── task.json │ │ └── UpdateChangeRequest │ │ │ ├── UpdateChangeRequestV0 │ │ │ ├── icon.png │ │ │ └── task.json │ │ │ ├── UpdateChangeRequestV1 │ │ │ ├── icon.png │ │ │ └── task.json │ │ │ └── UpdateChangeRequestV2 │ │ │ ├── icon.png │ │ │ └── task.json │ │ ├── images │ │ ├── 1_edit-import-set-table.png │ │ ├── 2_select-transform-map.png │ │ ├── 3_add-field-map.png │ │ ├── 4_update-transform-map.png │ │ ├── 5_field-map-added.png │ │ ├── add-oauth-configuration-organization.png │ │ ├── add-oauth-configuration.png │ │ ├── agentless_task.png │ │ ├── change_request_screenshot.png │ │ ├── check_create.png │ │ ├── gate_screenshot.png │ │ ├── oauth_servicenow_connection.png │ │ ├── release_definition.png │ │ ├── release_gate.png │ │ ├── resulting_pipeline.png │ │ ├── servicenow.png │ │ ├── servicenow_connection.png │ │ └── yaml_pipeline.png │ │ ├── readme.md │ │ └── vss-extension.json ├── TeamCity │ └── Src │ │ ├── Tasks │ │ └── DownloadTeamCityArtifacts │ │ │ ├── .npmrc │ │ │ ├── Strings │ │ │ └── resources.resjson │ │ │ │ └── en-US │ │ │ │ └── resources.resjson │ │ │ ├── ThirdPartyNotices.txt │ │ │ ├── download.ts │ │ │ ├── icon.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── task.json │ │ │ ├── task.loc.json │ │ │ ├── teamcity.handlebars │ │ │ └── tsconfig.json │ │ ├── images │ │ ├── screen1.png │ │ ├── screen2.png │ │ ├── tc-icon128px.png │ │ └── vss_default.png │ │ ├── mp_terms.md │ │ ├── readme.md │ │ ├── vss-extension.json │ │ ├── vss_default.png │ │ └── vss_wide.png └── Terraform │ └── README.md ├── LICENSE ├── MIT License.txt ├── README.md ├── SECURITY.md ├── ServerTaskHelper ├── AzureFunctionAdvancedHandler │ ├── .gitignore │ ├── AzureFunctionAdvancedHandler.csproj │ ├── MyAdvancedFunction.cs │ ├── Pictures │ │ ├── AdvancedCheckAsyncConfig.png │ │ ├── AzureFunctionConfiguration.png │ │ ├── ServiceBusQueue.png │ │ └── ServiceBusSharedAccessPolicies.png │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── WorkItemStatusHandler.cs │ └── host.json ├── AzureFunctionAdvancedServiceBusTrigger │ ├── .gitignore │ ├── AzureFunctionAdvancedServiceBusTrigger.cs │ ├── AzureFunctionAdvancedServiceBusTrigger.csproj │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── WorkItemStatusHandler.cs │ └── host.json ├── AzureFunctionBasicHandler │ ├── .gitignore │ ├── AzureFunctionBasicHandler.csproj │ ├── CmdLineTaskHandler.cs │ ├── MyBasicFunction.cs │ ├── Pictures │ │ └── BasicCheckAsyncConfiguration.png │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ └── host.json ├── AzureFunctionSample │ ├── .gitignore │ ├── AzureFunctionSample.csproj │ ├── MyApp.cs │ ├── MyAppParameters.cs │ ├── MyAzureFunction.cs │ ├── MyTaskExecutionHandler.cs │ ├── host.json │ └── readme.md ├── DistributedTask.ServerTask.Remote.Common │ ├── Build │ │ └── BuildClient.cs │ ├── DistributedTask.ServerTask.Remote.Common.csproj │ ├── Exceptions │ │ └── AzureFunctionEvaluationException.cs │ ├── ExecutionHandler.cs │ ├── ITaskExecutionHandler.cs │ ├── Request │ │ ├── RequestType.cs │ │ ├── TaskMessage.cs │ │ └── TaskProperties.cs │ ├── ServiceBus │ │ ├── ServiceBusClient.cs │ │ └── ServiceBusSettings.cs │ ├── TaskProgress │ │ ├── TaskClient.cs │ │ └── TaskLogger.cs │ ├── WorkItemProgress │ │ ├── Exceptions │ │ │ └── WorkItemNotCompletedException.cs │ │ └── WorkItemClient.cs │ └── readme.md ├── HttpRequestHandler │ ├── Http │ │ ├── Program.cs │ │ └── Startup.cs │ ├── HttpRequestHandler.csproj │ ├── MyTaskController.cs │ ├── MyTaskExecutionHandler.cs │ ├── Properties │ │ └── launchSettings.json │ └── readme.md ├── HttpRequestSampleWithoutHandler │ ├── Http │ │ ├── Program.cs │ │ └── Startup.cs │ ├── HttpRequestSampleWithoutHandler.csproj │ ├── MyApp.cs │ ├── MyTaskController.cs │ └── Properties │ │ └── launchSettings.json ├── ServerTaskHelper.sln ├── ServiceBusMessageHandler │ ├── MyTaskExecutionHandler.cs │ ├── Program.cs │ ├── ServiceBus │ │ ├── ServiceBusMessage.cs │ │ ├── ServiceBusMessageListener.cs │ │ └── ServiceBusSettings.cs │ ├── ServiceBusMessageHandler.csproj │ ├── appsettings.json │ └── readme.md └── VstsServerTaskHelper.SampleClient │ └── SampleServiceBusMessageBody.txt ├── TODO.md ├── TaskModules └── powershell │ ├── Azure │ ├── AzPSMdules.ps1 │ ├── AzSpnCreation.ps1 │ ├── AzurePSModules.ps1 │ ├── AzureRmPSModules.ps1 │ ├── LayoutAzurePSModules.ps1 │ └── SPNCreation.ps1 │ ├── Publish-PSModule.ps1 │ ├── RemoteDeployer │ ├── JobHelper.ps1 │ ├── RemoteDeployer.Utility.ps1 │ ├── RemoteDeployer.psm1 │ ├── RunPowerShellScriptJob.ps1 │ ├── SessionHelper.ps1 │ ├── Strings │ │ └── resources.resjson │ │ │ └── en-US │ │ │ └── resources.resjson │ ├── module.json │ └── tsconfig.json │ ├── Sanitizer │ ├── ArgumentsSanitizer.ps1 │ ├── Sanitizer.psm1 │ ├── Strings │ │ └── resources.resjson │ │ │ ├── de-DE │ │ │ └── resources.resjson │ │ │ ├── en-US │ │ │ └── resources.resjson │ │ │ ├── es-ES │ │ │ └── resources.resjson │ │ │ ├── fr-FR │ │ │ └── resources.resjson │ │ │ ├── it-IT │ │ │ └── resources.resjson │ │ │ ├── ja-JP │ │ │ └── resources.resjson │ │ │ ├── ko-KR │ │ │ └── resources.resjson │ │ │ ├── ru-RU │ │ │ └── resources.resjson │ │ │ ├── zh-CN │ │ │ └── resources.resjson │ │ │ └── zh-TW │ │ │ └── resources.resjson │ ├── Tests │ │ ├── L0.ts │ │ ├── L0Get-SanitizedArgumentsArray.DoesNotBreakExistingBashFormats.ps1 │ │ ├── L0Get-SanitizedArgumentsArray.DoesNotBreakExistingCmdFormats.ps1 │ │ ├── L0Get-SanitizedArgumentsArray.DoesNotBreakExistingPowerShellFormats.ps1 │ │ ├── L0Get-SanitizedArgumentsArray.ReplacesForbiddenCharacters.ps1 │ │ ├── L0Protect-ScriptArguments.Passes.ps1 │ │ ├── L0Protect-ScriptArguments.Throws.ps1 │ │ └── L0Split-Arguments.ps1 │ └── module.json │ ├── TaskModuleIISManageUtility │ ├── AppCmdOnTargetMachines.ps1 │ ├── TaskModuleIISManageUtility.psd1 │ └── TaskModuleIISManageUtility.psm1 │ ├── TaskModuleSqlUtility │ ├── SqlPackageOnTargetMachines.ps1 │ ├── SqlQueryOnTargetMachines.ps1 │ ├── TaskModuleSqlUtility.psd1 │ └── TaskModuleSqlUtility.psm1 │ ├── Tests │ ├── TaskModuleIISManageUtility │ │ ├── L0.ts │ │ ├── L0AppcmdAddUpdateAppPool.ps1 │ │ ├── L0AppcmdAddUpdateApplication.ps1 │ │ ├── L0AppcmdAddUpdateVDir.ps1 │ │ ├── L0AppcmdAddUpdateWebsite.ps1 │ │ ├── L0AppcmdAdditionalActions.ps1 │ │ ├── L0AppcmdInvokeMain.ps1 │ │ ├── L0AppcmdTestAddWebsiteBindings.ps1 │ │ ├── L0AppcmdTestApplicationExists.ps1 │ │ ├── L0AppcmdTestApplicationPoolExists.ps1 │ │ ├── L0AppcmdTestBinding.ps1 │ │ ├── L0AppcmdTestSSLandSNI.ps1 │ │ ├── L0AppcmdTestVirtualDirExists.ps1 │ │ ├── L0AppcmdTestWebsiteExists.ps1 │ │ └── MockHelpers.ps1 │ └── tsconfig.json │ └── WinRM │ ├── WinRM-Http-Https-With-Makecert │ └── ConfigureWinRM.ps1 │ └── WinRM-Http-Https │ └── ConfigureWinRM.ps1 ├── ThirdPartyNotices.txt ├── base.tsconfig.json ├── ci └── azure-pipelines-extensions.yml ├── common.json ├── definitions ├── Q.d.ts ├── glob.d.ts ├── ios-signing-common.d.ts ├── minimatch.d.ts ├── mocha.d.ts ├── node.d.ts ├── shelljs.d.ts ├── ssh-common.d.ts ├── vsts-task-lib.d.ts └── xml2js.d.ts ├── docs ├── authoring │ ├── PartialArtifactsDownload.md │ ├── artifactextension.md │ ├── endpoints │ │ ├── authenticationSchemes.md │ │ ├── dataSources.md │ │ ├── pagination.md │ │ ├── serviceEndpoints.md │ │ ├── tfs-vsts-endpoints.md │ │ └── workspace-locations │ └── images │ │ ├── artifactItems.PNG │ │ ├── artifacts.png │ │ ├── artifacturls.png │ │ ├── browseartifact.png │ │ ├── commits.png │ │ ├── createrelease.png │ │ ├── defaultversion.png │ │ ├── downloadtask.png │ │ ├── linkartifact.png │ │ ├── releaselogs.png │ │ └── workitems.png └── design │ └── incrementaldownload.md ├── externals.json ├── getUpdatedPaths.js ├── gulpfile.js ├── package-lock.json ├── package-utils.js ├── package.js ├── package.json ├── scripts ├── DetermineCiTestPipelineName.ps1 └── TriggerAdoPipelineAndWaitResult.ps1 ├── tsconfig.json └── webpack.config.js /.CodeQL.yml: -------------------------------------------------------------------------------- 1 | path_classifiers: 2 | test: 3 | # Note: use only forward slash / as a path separator. 4 | # * Matches any sequence of characters except a forward slash. 5 | # ** Matches any sequence of characters, including a forward slash. 6 | # This wildcard must either be surrounded by forward slash symbols, or used as the first segment of a path. 7 | # It matches zero or more whole directory segments. There is no need to use a wildcard at the end of a directory path because all sub-directories are automatically matched. 8 | # That is, /anything/ matches the anything directory and all its subdirectories. 9 | # Always enclose the expression in double quotes if it includes *. 10 | # Exclude the sample folders 11 | - ServerTaskHelper/AzureFunctionSample 12 | - ServerTaskHelper/HttpRequestSampleWithoutHandler 13 | - ServerTaskHelper/VstsServerTaskHelper.SampleClient 14 | -------------------------------------------------------------------------------- /.config/1espt/PipelineAutobaseliningConfig.yml: -------------------------------------------------------------------------------- 1 | ## DO NOT MODIFY THIS FILE MANUALLY. This is part of auto-baselining from 1ES Pipeline Templates. Go to [https://aka.ms/1espt-autobaselining] for more details. 2 | 3 | pipelines: 4 | 21050: 5 | retail: 6 | source: 7 | credscan: 8 | lastModifiedDate: 2025-07-11 9 | eslint: 10 | lastModifiedDate: 2025-07-11 11 | psscriptanalyzer: 12 | lastModifiedDate: 2025-07-11 13 | armory: 14 | lastModifiedDate: 2025-07-11 15 | accessibilityinsights: 16 | lastModifiedDate: 2025-07-11 17 | binary: 18 | credscan: 19 | lastModifiedDate: 2025-07-11 20 | binskim: 21 | lastModifiedDate: 2025-07-11 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Developer Community 4 | url: https://developercommunity.visualstudio.com/AzureDevOps 5 | about: For other Azure DevOps issues 6 | - name: Agent issue 7 | url: https://github.com/microsoft/azure-pipelines-agent/issues/new 8 | about: If you have issues with pipelines agent, please place your issues here. 9 | - name: Task issue 10 | url: https://github.com/microsoft/azure-pipelines-tasks/issues/new 11 | about: If you have issues with ADO task, please place your issues here. 12 | - name: Security issue 13 | url: https://github.com/microsoft/azure-pipelines-tasks/security/policy 14 | about: For security issues, please check our policy 15 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | **Description**: 2 | 3 | **Documentation changes required:** (Y/N) 4 | 5 | **Added unit tests:** (Y/N) 6 | 7 | **Attached related issue:** (Y/N) 8 | 9 | **Checklist**: 10 | - [ ] Version was bumped - please check that version of the extension, task or library has been bumped. 11 | - [ ] Checked that applied changes work as expected. 12 | -------------------------------------------------------------------------------- /.github/workflows/release-ansible.yml: -------------------------------------------------------------------------------- 1 | name: Publish Ansible 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | env: 7 | node-version: 10 8 | extension-name: ms-vscs-rm.vss-services-ansible-0.258.3.vsix 9 | 10 | jobs: 11 | 12 | publish: 13 | name: Publish 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - name: Use Node.js ${{ env.node-version }} 20 | uses: actions/setup-node@v3 21 | with: 22 | node-version: ${{ env.node-version }} 23 | 24 | - name: Install TFX CLI 25 | run: npm install -g tfx-cli 26 | 27 | - name: Publish Extension 28 | run: | 29 | tfx extension publish --vsix ${{ env.extension-name }} \ 30 | --service-url https://marketplace.visualstudio.com \ 31 | --no-prompt \ 32 | --auth-type pat \ 33 | --token ${{ secrets.AZURE_DEVOPS_MARKETPLACE_PAT }} 34 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /.taskkey: -------------------------------------------------------------------------------- 1 | 6444eac2-371e-4677-af01-05716aef5ddc -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch", 6 | "type": "node", 7 | "request": "launch", 8 | "program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js", 9 | "stopOnEntry": false, 10 | "args": ["package"], 11 | "cwd": "${workspaceRoot}", 12 | "preLaunchTask": null, 13 | "runtimeExecutable": null, 14 | "runtimeArgs": [ 15 | "--nolazy" 16 | ], 17 | "env": { 18 | "NODE_ENV": "development" 19 | }, 20 | "externalConsole": false, 21 | "sourceMaps": false, 22 | "outDir": null 23 | }, 24 | { 25 | "name": "Attach", 26 | "type": "node", 27 | "request": "attach", 28 | "port": 5858, 29 | "address": "localhost", 30 | "restart": false, 31 | "sourceMaps": false, 32 | "outDir": null, 33 | "localRoot": "${workspaceRoot}", 34 | "remoteRoot": null 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.autoSave": "afterDelay", 4 | "azure-pipelines.1ESPipelineTemplatesSchemaFile": true 5 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "typescript", 8 | "identifier": "build", 9 | "tsconfig": "src\\tsconfig.json", 10 | "group": { 11 | "kind": "build", 12 | "isDefault": true 13 | } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Assets/MITLicense.txt: -------------------------------------------------------------------------------- 1 | Ansible 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Images/ansible_endpoint.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Images/ansible_endpoint.PNG -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Images/ansible_screen_1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Images/ansible_screen_1.PNG -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Images/ansible_screen_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Images/ansible_screen_2.PNG -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Images/icon_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Images/icon_default.png -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Images/icon_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Images/icon_wide.png -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Tasks/Ansible/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Tasks/Ansible/ansibleInterface.ts: -------------------------------------------------------------------------------- 1 | 2 | export class ansibleInterface { 3 | constructor() { 4 | } 5 | public async execute() { 6 | throw "selected interface not supported"; 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Tasks/Ansible/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Ansible/Src/Tasks/Ansible/icon.png -------------------------------------------------------------------------------- /Extensions/Ansible/Src/Tasks/Ansible/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ansible", 3 | "version": "0.0.1", 4 | "description": "Ansible task for playbook execution", 5 | "main": "main.js", 6 | "author": "Microsoft", 7 | "license": "ISC", 8 | "dependencies": { 9 | "@types/ssh2-sftp-client": "5.2.0", 10 | "azure-pipelines-task-lib": "^4.17.3", 11 | "shell-quote": "^1.8.2", 12 | "shelljs": "^0.8.5", 13 | "ssh2": "1.4.0", 14 | "ssh2-sftp-client": "^8.1.0", 15 | "uuid": "^3.3.2", 16 | "vso-node-api": "6.0.1-preview" 17 | }, 18 | "scripts": { 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Extensions/Ansible/Tests/Tasks/Ansible/testTower.ts: -------------------------------------------------------------------------------- 1 | import mockanswer = require('vsts-task-lib/mock-answer'); 2 | import mockrun = require('vsts-task-lib/mock-run'); 3 | import path = require('path'); 4 | 5 | 6 | let taskPath = path.join(__dirname, '../../../Src/Tasks/Ansible/main.js'); 7 | let runner = new mockrun.TaskMockRunner(taskPath); 8 | runner.setInput('ansibleInterface', 'ansibleTower'); 9 | runner.setInput('connectionAnsibleTower', '8b04f8a5-9a17-474d-836c-60c24edcfa50'); 10 | runner.setInput('jobTemplateName', 'Demo Job Template 3'); 11 | 12 | process.env["AZURE_HTTP_USER_AGENT"] = "TFS_useragent"; 13 | process.env["ENDPOINT_AUTH_PARAMETER_8b04f8a5-9a17-474d-836c-60c24edcfa50_USERNAME"] = "DummyUser"; 14 | process.env["ENDPOINT_AUTH_PARAMETER_8b04f8a5-9a17-474d-836c-60c24edcfa50_PASSWORD"] = "DummyPassword"; 15 | process.env["ENDPOINT_URL_8b04f8a5-9a17-474d-836c-60c24edcfa50"] = "true dummy host"; 16 | 17 | var tl = require('vsts-task-lib/mock-task'); 18 | runner.registerMock('vsts-task-lib/toolrunner', require('vsts-task-lib/mock-toolrunner')); 19 | runner.registerMock('vsts-task-lib/task', "vsts-task-lib/mock-task"); 20 | 21 | runner.registerMock('./ansibleUtils', require('./mockAnsibleUtils')); 22 | 23 | runner.run(); 24 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.js.map 3 | node_modules 4 | **/config.json 5 | **/test.config.json 6 | *.d.ts 7 | !definitions/*.d.ts 8 | .nyc_output/** 9 | .taskkey 10 | !Providers/typed-rest-client/opensource/node-http-ntlm/ntlm.js 11 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "mocha.files.glob": "**/*Tests/*.js", 4 | "files.exclude": { 5 | "**/*.js": {"when": "$(basename).ts"}, 6 | "**/*.map": {"when": "$(basename).map"}, 7 | "**/node_modules/**": true 8 | }, 9 | "nodeTdd.buildOnActivation" : true, 10 | "nodeTdd.showCoverage": true, 11 | "nodeTdd.reporter": "tap", 12 | "nodeTdd.glob":"**/*Tests.js", 13 | "nodeTdd.verbose": true 14 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "typescript", 8 | "identifier": "build", 9 | "tsconfig": "tsconfig.json", 10 | "group": { 11 | "kind": "build", 12 | "isDefault": true 13 | } 14 | }, 15 | { 16 | "taskName": "Run mocha tests", 17 | "identifier": "test", 18 | "type": "shell", 19 | "command": "${workspaceRoot}/node_modules/mocha/bin/_mocha", 20 | "args": ["--reporter", "mocha-tap-reporter", "**/*Tests.js"], 21 | "group": { 22 | "kind": "test", 23 | "isDefault": true 24 | }, 25 | "presentation": { 26 | "echo": true, 27 | "reveal": "always", 28 | "focus": false, 29 | "panel": "shared" 30 | } 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Engine/artifactEngineOptions.ts: -------------------------------------------------------------------------------- 1 | export class ArtifactEngineOptions { 2 | retryLimit: number = 5; 3 | retryIntervalInSeconds: number = 5; 4 | fileProcessingTimeoutInMinutes: number = 5; 5 | parallelProcessingLimit: number = 4; 6 | itemPattern: string = '**'; 7 | verbose: boolean = false; 8 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Engine/index.ts: -------------------------------------------------------------------------------- 1 | export { ArtifactEngineOptions } from "./artifactEngineOptions"; 2 | export { ArtifactEngine } from "./artifactEngine"; -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/artifactDownloadTicket.ts: -------------------------------------------------------------------------------- 1 | import { ArtifactItem } from "./artifactItem"; 2 | import { TicketState } from "./ticketState"; 3 | 4 | export class ArtifactDownloadTicket { 5 | artifactItem: ArtifactItem; 6 | startTime: Date 7 | finishTime: Date 8 | state: TicketState 9 | retryCount: number 10 | downloadSizeInBytes: number 11 | fileSizeInBytes: number 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/artifactItem.ts: -------------------------------------------------------------------------------- 1 | import { ItemType } from "./itemType" 2 | 3 | export class ArtifactItem { 4 | itemType: ItemType; 5 | path: string; 6 | fileLength: number; 7 | lastModified: Date; 8 | contentType: string; 9 | metadata: { [key: string]: string } 10 | 11 | constructor() { 12 | this.metadata = {}; 13 | } 14 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/artifactprovider.ts: -------------------------------------------------------------------------------- 1 | import {ArtifactItem} from "./artifactItem"; 2 | import { ArtifactItemStore } from '../Store/artifactItemStore'; 3 | 4 | export interface IArtifactProvider { 5 | artifactItemStore: ArtifactItemStore; 6 | getRootItems(): Promise; 7 | getArtifactItems(artifactItem: ArtifactItem): Promise; 8 | getArtifactItem(artifactItem: ArtifactItem): Promise; 9 | putArtifactItem(artifactItem: ArtifactItem, stream: NodeJS.ReadableStream): Promise; 10 | dispose(): void; 11 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/constants.ts: -------------------------------------------------------------------------------- 1 | export class Constants { 2 | static DestinationUrlKey = "destinationUrl"; 3 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/index.ts: -------------------------------------------------------------------------------- 1 | export { ArtifactDownloadTicket } from './artifactDownloadTicket'; 2 | export { ArtifactItem } from "./artifactItem"; 3 | export { IArtifactProvider } from "./artifactprovider"; 4 | export { ItemType } from './itemType'; 5 | export { TicketState } from './ticketState'; 6 | export { Constants } from './constants'; -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/itemType.ts: -------------------------------------------------------------------------------- 1 | export enum ItemType { 2 | Any = "any", 3 | Folder = "folder", 4 | File = "file" 5 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Models/ticketState.ts: -------------------------------------------------------------------------------- 1 | export enum TicketState { 2 | InQueue = "inqueue", 3 | Processing = "processing", 4 | Processed = "processed", 5 | Skipped = "skipped", 6 | Failed = "failed" 7 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/index.ts: -------------------------------------------------------------------------------- 1 | export { WebProvider } from "./webProvider"; 2 | export { FilesystemProvider } from "./filesystemProvider"; 3 | export { ZipProvider } from "./zipProvider" 4 | export { StubProvider } from "./stubProvider"; -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/jenkins.handlebars: -------------------------------------------------------------------------------- 1 | [ 2 | {{#artifacts}} 3 | { 4 | "path" : "{{this.relativePath}}", 5 | "itemType": "file", 6 | "metadata" : { 7 | "downloadUrl": "{{../endpoint.url}}/job/{{../definition}}/{{../version}}/artifact/{{this.relativePath}}" 8 | } 9 | }{{#unless @last}},{{/unless}} 10 | {{/artifacts}} 11 | ] -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/jenkins.handlebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts": [ 3 | { 4 | "displayPath": "ConsoleApplication1.pdb", 5 | "fileName": "ConsoleApplication1.pdb", 6 | "relativePath": "ConsoleApplication1.pdb" 7 | }, 8 | { 9 | "displayPath": "FolderName/ConsoleApplication1.pdb", 10 | "fileName": "ConsoleApplication1.pdb", 11 | "relativePath": "FolderName/ConsoleApplication1.pdb" 12 | } 13 | ], 14 | "endpoint" : { 15 | "url": "http://redvstt-lab43:8080" 16 | }, 17 | "definition" : "ArtifactJob", 18 | "version" : "5" 19 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/teamcity.handlebars: -------------------------------------------------------------------------------- 1 | [ 2 | {{#file}} 3 | { 4 | "path": "{{this.name}}", 5 | "lastModified": "{{this.modificationTime}}", 6 | {{#if size}} 7 | "fileLength" : "{{this.size}}", 8 | {{/if}} 9 | {{#if children}} 10 | "itemType": "folder", 11 | {{/if}} 12 | {{#if content}} 13 | "itemType": "file", 14 | {{/if}} 15 | "metadata": { 16 | {{#if content}} 17 | "downloadUrl" : "{{../endpoint.url}}{{content.href}}" 18 | {{/if}} 19 | {{#if children}} 20 | "downloadUrl": "{{../endpoint.url}}{{children.href}}" 21 | {{/if}} 22 | } 23 | }{{#unless @last}},{{/unless}} 24 | {{/file}} 25 | ] -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/teamcity.handlebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "count": 2, 3 | "file": [ 4 | { 5 | "name": "Mvc4Bootstrap", 6 | "modificationTime": "20160901T120014+0000", 7 | "href": "/httpAuth/app/rest/builds/id:223/artifacts/metadata/Mvc4Bootstrap", 8 | "children": { 9 | "href": "/httpAuth/app/rest/builds/id:223/artifacts/children/Mvc4Bootstrap" 10 | } 11 | }, 12 | { 13 | "name": "Output.Ps1", 14 | "size": 359, 15 | "modificationTime": "20160901T120014+0000", 16 | "href": "/httpAuth/app/rest/builds/id:223/artifacts/metadata/Output.Ps1", 17 | "content": { 18 | "href": "/httpAuth/app/rest/builds/id:223/artifacts/content/Output.Ps1" 19 | } 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/Handlers.ts: -------------------------------------------------------------------------------- 1 | export { BasicCredentialHandler } from "./handlers/basiccreds"; 2 | export { BearerCredentialHandler } from "./handlers/bearertoken"; 3 | export { NtlmCredentialHandler } from "./handlers/ntlm"; 4 | export { PersonalAccessTokenCredentialHandler } from "./handlers/personalaccesstoken"; 5 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/Index.ts: -------------------------------------------------------------------------------- 1 | import * as httpm from './HttpClient'; 2 | import * as restm from './RestClient'; 3 | import * as handlerm from './Handlers'; -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/Interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface IHeaders { [key: string]: any }; 2 | 3 | export interface IBasicCredentials { 4 | username: string; 5 | password: string; 6 | } 7 | 8 | export interface IRequestHandler { 9 | prepareRequest(options: any): void; 10 | canHandleAuthentication(res: IHttpResponse): boolean; 11 | handleAuthentication(httpClient, protocol, options, objs, finalCallback): void; 12 | } 13 | 14 | export interface IHttpResponse { 15 | statusCode?: number; 16 | headers: any; 17 | } 18 | 19 | export interface IRequestOptions { 20 | socketTimeout?: number, 21 | ignoreSslError?: boolean, 22 | proxy?: IProxyConfiguration, 23 | cert?: ICertConfiguration, 24 | allowRedirects?: boolean, 25 | maxRedirects?: number, 26 | maxSockets?: number, 27 | keepAlive?: boolean, 28 | requestCompressionForDownloads?: boolean 29 | } 30 | 31 | export interface IProxyConfiguration { 32 | proxyUrl: string; 33 | proxyUsername?: string; 34 | proxyPassword?: string; 35 | proxyBypassHosts?: string[]; 36 | } 37 | 38 | export interface ICertConfiguration { 39 | caFile?: string; 40 | certFile?: string; 41 | keyFile?: string; 42 | passphrase?: string; 43 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/Util.ts: -------------------------------------------------------------------------------- 1 | import * as url from 'url'; 2 | 3 | /** 4 | * creates an url from a request url and optional base url (http://server:8080) 5 | * @param {string} requestUrl - a fully qualified url or relative url 6 | * @param {string} baseUrl - an optional baseUrl (http://server:8080) 7 | * @return {string} - resultant url 8 | */ 9 | export function getUrl(requestUrl: string, baseUrl?: string): string { 10 | if (!baseUrl) { 11 | return requestUrl; 12 | } 13 | 14 | let base: url.Url = url.parse(baseUrl); 15 | 16 | // requestUrl (specific per request) always wins 17 | let combined: url.Url = url.parse(requestUrl); 18 | combined.protocol = combined.protocol || base.protocol; 19 | combined.auth = combined.auth || base.auth; 20 | combined.host = combined.host || base.host; 21 | // path from requestUrl always wins 22 | 23 | let res: string = url.format(combined); 24 | return res; 25 | } 26 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/handlers/basiccreds.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | import ifm = require('../Interfaces'); 5 | 6 | export class BasicCredentialHandler implements ifm.IRequestHandler { 7 | username: string; 8 | password: string; 9 | 10 | constructor(username: string, password: string) { 11 | this.username = username; 12 | this.password = password; 13 | } 14 | 15 | // currently implements pre-authorization 16 | // TODO: support preAuth = false where it hooks on 401 17 | prepareRequest(options:any): void { 18 | options.headers['Authorization'] = 'Basic ' + new Buffer(this.username + ':' + this.password).toString('base64'); 19 | options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; 20 | } 21 | 22 | // This handler cannot handle 401 23 | canHandleAuthentication(res: ifm.IHttpResponse): boolean { 24 | return false; 25 | } 26 | 27 | handleAuthentication(httpClient, protocol, options, objs, finalCallback): void { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/handlers/bearertoken.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | import ifm = require('../Interfaces'); 5 | 6 | export class BearerCredentialHandler implements ifm.IRequestHandler { 7 | token: string; 8 | 9 | constructor(token: string) { 10 | this.token = token; 11 | } 12 | 13 | // currently implements pre-authorization 14 | // TODO: support preAuth = false where it hooks on 401 15 | prepareRequest(options:any): void { 16 | options.headers['Authorization'] = 'Bearer ' + this.token; 17 | options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; 18 | } 19 | 20 | // This handler cannot handle 401 21 | canHandleAuthentication(res: ifm.IHttpResponse): boolean { 22 | return false; 23 | } 24 | 25 | handleAuthentication(httpClient, protocol, options, objs, finalCallback): void { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/handlers/personalaccesstoken.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | import ifm = require('../Interfaces'); 5 | 6 | export class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler { 7 | token: string; 8 | 9 | constructor(token: string) { 10 | this.token = token; 11 | } 12 | 13 | // currently implements pre-authorization 14 | // TODO: support preAuth = false where it hooks on 401 15 | prepareRequest(options:any): void { 16 | options.headers['Authorization'] = 'Basic ' + new Buffer('PAT:' + this.token).toString('base64'); 17 | options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; 18 | } 19 | 20 | // This handler cannot handle 401 21 | canHandleAuthentication(res: ifm.IHttpResponse): boolean { 22 | return false; 23 | } 24 | 25 | handleAuthentication(httpClient, protocol, options, objs, finalCallback): void { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/typed-rest-client/opensource/node-http-ntlm/readme.txt: -------------------------------------------------------------------------------- 1 | // This software (ntlm.js) was copied from a file of the same name at https://github.com/SamDecrock/node-http-ntlm/blob/master/ntlm.js. 2 | // 3 | // As of this writing, it is a part of the node-http-ntlm module produced by SamDecrock. 4 | // 5 | // It is used as a part of the NTLM support provided by the vso-node-api library. 6 | // 7 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Providers/vsts.handlebars: -------------------------------------------------------------------------------- 1 | [ 2 | {{#value}} 3 | { 4 | "path": "{{this.path}}", 5 | "lastModified": "{{this.dateLastModified}}", 6 | {{#if fileLength}} 7 | "fileLength" : "{{this.fileLength}}", 8 | {{/if}} 9 | "itemType": "{{this.itemType}}", 10 | "metadata": 11 | { 12 | "downloadUrl" : "{{{this.contentLocation}}}&isShallow=true" 13 | } 14 | }{{#unless @last}},{{/unless}} 15 | {{/value}} 16 | ] -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Store/index.ts: -------------------------------------------------------------------------------- 1 | export { ArtifactItemStore } from './artifactItemStore'; -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/de-DE/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "Dateien gesamt: %s, verarbeitet: %s, übersprungen: %s, fehlerhaft: %s, Downloadzeit: %s Sek., Downloadgröße: %s", 3 | "loc.messages.FailedToParseResponse": "Fehler beim Analysieren des Antworttexts: %s. Erhaltener Fehler: %s", 4 | "loc.messages.DownloadingTo": "Download von \"%s\" nach \"%s\" wird durchgeführt.", 5 | "loc.messages.DownloadedTo": "Download von \"%s\" nach \"%s\" wurde durchgeführt.", 6 | "loc.messages.UnableToReadDirectory": "Das Verzeichnis \"%s\" kann nicht gelesen werden. Fehler: %s", 7 | "loc.messages.RetryingDownload": "Download von \"%s\" wird erneut versucht, Wiederholungsanzahl: %s", 8 | "loc.messages.SkippingItem": "Die Verarbeitung des Elements \"%s\" wird übersprungen.", 9 | "loc.messages.UnhandledRejection": "artifact-engine: nicht verarbeitete Zurückweisung %s", 10 | "loc.messages.UnhandledException": "artifact-engine: Ausnahmefehler %s", 11 | "loc.messages.FailedRequest": "Fehlerhafte Anforderung: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/en-US/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "Total Files: %s, Processed: %s, Skipped: %s, Failed: %s, Download time: %s secs, Download size: %s", 3 | "loc.messages.FailedToParseResponse": "Failed to parse response body: %s, got error : %s", 4 | "loc.messages.DownloadingTo": "Downloading %s to %s", 5 | "loc.messages.DownloadedTo": "Downloaded %s to %s", 6 | "loc.messages.UnableToReadDirectory": "Unable to read directory %s. Error: %s", 7 | "loc.messages.RetryingDownload": "Retrying download of %s, retry count: %s", 8 | "loc.messages.SkippingItem": "Skipped processing item %s", 9 | "loc.messages.UnhandledRejection": "artifact-engine: unhandled rejection %s", 10 | "loc.messages.UnhandledException": "artifact-engine: unhandled exception %s", 11 | "loc.messages.FailedRequest": "Failed request: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/es-ES/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "Total de archivos: %s, procesados: %s, omitidos: %s, con errores: %s, tiempo de descarga: %s segundos, tamaño de descarga: %s", 3 | "loc.messages.FailedToParseResponse": "No se pudo analizar el cuerpo de la respuesta: %s. Error: %s", 4 | "loc.messages.DownloadingTo": "Descargando %s en %s", 5 | "loc.messages.DownloadedTo": "%s descargado en %s", 6 | "loc.messages.UnableToReadDirectory": "No se puede leer el directorio %s. Error: %s", 7 | "loc.messages.RetryingDownload": "Reintentando la descarga de %s, número de reintentos: %s", 8 | "loc.messages.SkippingItem": "Procesamiento de %s omitido", 9 | "loc.messages.UnhandledRejection": "artifact-engine: rechazo no controlado: %s", 10 | "loc.messages.UnhandledException": "artifact-engine: excepción no controlada: %s", 11 | "loc.messages.FailedRequest": "Error en la solicitud: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/fr-FR/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "Fichiers totaux : %s, Traités : %s, Ignorés : %s, En échec : %s, Durée du téléchargement : %s s, Taille du téléchargement : %s", 3 | "loc.messages.FailedToParseResponse": "Échec d’analyse du corps de la réponse : %s, erreur : %s", 4 | "loc.messages.DownloadingTo": "Téléchargement de %s à %s", 5 | "loc.messages.DownloadedTo": "Téléchargé de %s à %s", 6 | "loc.messages.UnableToReadDirectory": "Impossible de lire le répertoire %s. Erreur : %s", 7 | "loc.messages.RetryingDownload": "Nouvelle tentative de téléchargement de %s, nombre de tentatives : %s", 8 | "loc.messages.SkippingItem": "Traitement de l’élément ignoré %s", 9 | "loc.messages.UnhandledRejection": "artifact-engine : rejet non géré %s", 10 | "loc.messages.UnhandledException": "artifact-engine : exception non gérée %s", 11 | "loc.messages.FailedRequest": "Échec de la demande : (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/it-IT/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "File totali: %s. Elaborati: %s. Ignorati: %s. Con errori: %s. Tempo di download: %s sec. Dimensioni download: %s", 3 | "loc.messages.FailedToParseResponse": "Non è stato possibile analizzare il corpo della risposta: %s. Errore restituito: %s", 4 | "loc.messages.DownloadingTo": "Download di %s in %s", 5 | "loc.messages.DownloadedTo": "%s scaricato in %s", 6 | "loc.messages.UnableToReadDirectory": "Non è possibile leggere la directory %s. Errore: %s", 7 | "loc.messages.RetryingDownload": "Nuovo tentativo di download di %s. Conteggio dei tentativi: %s", 8 | "loc.messages.SkippingItem": "Elaborazione dell'elemento %s ignorata", 9 | "loc.messages.UnhandledRejection": "artifact-engine: rifiuto non gestito %s", 10 | "loc.messages.UnhandledException": "artifact-engine: eccezione non gestita %s", 11 | "loc.messages.FailedRequest": "Richiesta non riuscita: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/ja-JP/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "合計ファイル数: %s、処理済み: %s、スキップ: %s、失敗: %s、ダウンロード時間: %s 秒、ダウンロード サイズ: %s", 3 | "loc.messages.FailedToParseResponse": "応答本文を解析できませんでした: %s、エラー発生: %s", 4 | "loc.messages.DownloadingTo": "%s を %s へダウンロード中", 5 | "loc.messages.DownloadedTo": "%s を %s へダウンロード済み", 6 | "loc.messages.UnableToReadDirectory": "ディレクトリ %s を読み取ることができません。エラー: %s", 7 | "loc.messages.RetryingDownload": "%s のダウンロードを再試行しています。再試行回数: %s", 8 | "loc.messages.SkippingItem": "項目 %s の処理をスキップしました", 9 | "loc.messages.UnhandledRejection": "artifact-engine: ハンドルされない拒否 %s", 10 | "loc.messages.UnhandledException": "artifact-engine: ハンドルされない例外 %s", 11 | "loc.messages.FailedRequest": "失敗した要求: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/ko-KR/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "총 파일: %s, 처리됨: %s, 건너뜀: %s, 실패함: %s, 다운로드 시간: %s초, 다운로드 크기: %s", 3 | "loc.messages.FailedToParseResponse": "응답 본문 %s을(를) 구문 분석하지 못했습니다. 오류: %s", 4 | "loc.messages.DownloadingTo": "%s을(를) %s에 다운로드하는 중", 5 | "loc.messages.DownloadedTo": "%s을(를) %s에 다운로드함", 6 | "loc.messages.UnableToReadDirectory": "디렉터리 %s을(를) 읽을 수 없습니다. 오류: %s", 7 | "loc.messages.RetryingDownload": "%s 다운로드를 다시 시도하는 중, 다시 시도 횟수: %s회", 8 | "loc.messages.SkippingItem": "항목 %s의 처리를 건너뜀", 9 | "loc.messages.UnhandledRejection": "artifact-engine: 처리되지 않은 거부 %s", 10 | "loc.messages.UnhandledException": "artifact-engine: 처리되지 않은 예외 %s", 11 | "loc.messages.FailedRequest": "실패한 요청: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/ru-RU/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "Всего файлов: %s. Обработано: %s. Пропущено: %s. Сбоев: %s. Время скачивания: %s с. Скачиваемый объем: %s", 3 | "loc.messages.FailedToParseResponse": "Не удалось проанализировать текст ответа: %s. Ошибка: %s", 4 | "loc.messages.DownloadingTo": "Идет скачивание %s в %s", 5 | "loc.messages.DownloadedTo": "Скачано %s в %s", 6 | "loc.messages.UnableToReadDirectory": "Не удается считать каталог %s. Ошибка: %s", 7 | "loc.messages.RetryingDownload": "Повторная попытка скачать %s, всего попыток: %s", 8 | "loc.messages.SkippingItem": "Пропущена обработка элемента %s", 9 | "loc.messages.UnhandledRejection": "artifact-engine: необработанное отклонение %s", 10 | "loc.messages.UnhandledException": "artifact-engine: необработанное исключение %s", 11 | "loc.messages.FailedRequest": "Сбой запроса: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/zh-CN/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "总文件数: %s,已处理: %s,已跳过: %s,已失败: %s,下载时间: %s 秒,下载大小: %s", 3 | "loc.messages.FailedToParseResponse": "未能分析响应正文: %s,显示错误: %s", 4 | "loc.messages.DownloadingTo": "正在将 %s 下载至 %s", 5 | "loc.messages.DownloadedTo": "已将 %s 下载至 %s", 6 | "loc.messages.UnableToReadDirectory": "未能读取目录 %s。错误: %s", 7 | "loc.messages.RetryingDownload": "重新尝试下载 %s,重试计数: %s", 8 | "loc.messages.SkippingItem": "已跳过处理项目 %s", 9 | "loc.messages.UnhandledRejection": "项目引擎: 未处理的拒绝 %s", 10 | "loc.messages.UnhandledException": "项目引擎: 未处理的异常 %s", 11 | "loc.messages.FailedRequest": "请求失败: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/Strings/resources.resjson/zh-TW/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.DownloadSummary": "檔案總數: %s,已處理: %s,已跳過: %s,失敗: %s,下載時間: %s 秒,下載大小: %s", 3 | "loc.messages.FailedToParseResponse": "無法剖析回應主體: %s,收到錯誤: %s", 4 | "loc.messages.DownloadingTo": "正在將 %s 下載到 %s", 5 | "loc.messages.DownloadedTo": "已將 %s 下載到 %s", 6 | "loc.messages.UnableToReadDirectory": "無法讀取目錄 %s。錯誤: %s", 7 | "loc.messages.RetryingDownload": "正在重試下載 %s,重試次數: %s", 8 | "loc.messages.SkippingItem": "已跳過處理項目 %s", 9 | "loc.messages.UnhandledRejection": "artifact-engine: 未處理的拒絕 %s", 10 | "loc.messages.UnhandledException": "artifact-engine: 未處理的例外狀況 %s", 11 | "loc.messages.FailedRequest": "失敗的要求: (statusCode)" 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/TODO.md: -------------------------------------------------------------------------------- 1 | ## TODO 2 | 1. Add the following capabilities to Fetch Engine 3 | - [x] parallization 4 | - [x] retry 5 | - [x] partial download 6 | - [x] level by level download 7 | - [x] logging 8 | - [ ] cancellation 9 | - [ ] incremental download 10 | 11 | 2. Implement the following providers 12 | - [x] web provider 13 | - [x] fileshare provider 14 | - [x] stub provider for testing 15 | 16 | 3. Add the webprovider templates for the following services 17 | - [x] Jenkins 18 | - [x] Teamcity 19 | - [x] External Build 20 | 21 | 4. Add tests 22 | - [x] Setup testing framework 23 | - [ ] Add fetch engine tests 24 | 25 | 5. Others 26 | - [ ] changing http timeout 27 | - [ ] Publish package to npm gallery 28 | - [x] Setup CI 29 | - [x] Support proxy 30 | - [ ] Enable localization 31 | -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/TestData/Jenkins/file1.pdb: -------------------------------------------------------------------------------- 1 | dummyFileContent -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/TestData/Jenkins/folder1/file2.txt: -------------------------------------------------------------------------------- 1 | dummyFolderContent -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/ThirdPartyNotices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ArtifactEngine/ThirdPartyNotices.txt -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "DownloadSummary": "Total Files: %s, Processed: %s, Skipped: %s, Failed: %s, Download time: %s secs, Download size: %s", 4 | "FailedToParseResponse": "Failed to parse response body: %s, got error : %s", 5 | "DownloadingTo": "Downloading %s to %s", 6 | "DownloadedTo": "Downloaded %s to %s", 7 | "UnableToReadDirectory": "Unable to read directory %s. Error: %s", 8 | "RetryingDownload": "Retrying download of %s, retry count: %s", 9 | "SkippingItem": "Skipped processing item %s", 10 | "UnhandledRejection": "artifact-engine: unhandled rejection %s", 11 | "UnhandledException": "artifact-engine: unhandled exception %s", 12 | "FailedRequest": "Failed request: (statusCode)" 13 | } 14 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/test.config.json.example: -------------------------------------------------------------------------------- 1 | // To run tests locally updated the file, remove this line and rename to test.config.json 2 | { 3 | "DROPLOCATION": "/Users/Omesh/Documents/drop", 4 | "JENKINS": { 5 | "USERNAME": "", 6 | "PASSWORD": "" 7 | }, 8 | "TEAMCITY": { 9 | "USERNAME": "", 10 | "PASSWORD": "" 11 | }, 12 | "VSTS": { 13 | "PAT": "" 14 | } 15 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "sourceMap": true, 6 | "moduleResolution": "node", 7 | "declaration": true, 8 | "rootDir": ".", 9 | "removeComments": true, 10 | "forceConsistentCasingInFileNames": true 11 | } 12 | } -------------------------------------------------------------------------------- /Extensions/ArtifactEngine/usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ArtifactEngine/usage.png -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/Tasks/DownloadArtifactsBitbucket/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/Tasks/DownloadArtifactsBitbucket/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadArtifactsBitbucket", 3 | "main": "download.js", 4 | "dependencies": { 5 | "azure-pipelines-task-lib": "^4.17.3", 6 | "vso-node-api": "6.0.1-preview" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/images/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/BitBucket/Src/images/screen1.png -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/images/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/BitBucket/Src/images/screen2.png -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/images/vss_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/BitBucket/Src/images/vss_default.png -------------------------------------------------------------------------------- /Extensions/BitBucket/Src/readme.md: -------------------------------------------------------------------------------- 1 | # Bitbucket® artifacts for Release management 2 | 3 | This extension is an integration point for Bitbucket® with Release management in Azure DevOps. With this extension, you can deploy sources from Bitbucket® repositories using Release management. 4 | 5 | **Note:** This extension work only with Azure DevOps and TFS "18" RC onwards. 6 | 7 | ## Usage 8 | This extension provides a service endpoint to connect to Bitbucket® account. Once connected, you can link a repositories from the Bitbucket® and deploy the same using Release management orchestration service. 9 | 10 | ### Connecting to a Bitbucket® project 11 | Go to project settings -> Services tab and create a New Service Endpoint of type Bitbucket® 12 | ![Creating a Bitbucket® endpoint connection](images/screen1.png) 13 | 14 | 15 | ### Linking a Bitbucket® sources 16 | Once you have set up the service endpoint connection, you would be able to link an external Bitbucket® sources in your release definition 17 | ![Linking Bitbucket® artifact](images/screen2.png) 18 | 19 | [Learn more about artifacts in Release Management](https://msdn.microsoft.com/library/vs/alm/release/author-release-definition/understanding-artifacts). Also you can use [Azure Pipeline Extensions on Github](https://github.com/Microsoft/azure-pipelines-extensions/issues) to report any issues. 20 | 21 | **Note:** Bitbucket® is trademark owned by Atlassian. 22 | -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/circleCI.handlebars.txt: -------------------------------------------------------------------------------- 1 | [ 2 | {{#this}} 3 | { 4 | "path" : "{{this.path}}", 5 | "itemType": "file", 6 | "metadata" : { 7 | "downloadUrl": "{{this.url}}" 8 | } 9 | }{{#unless @last}},{{/unless}} 10 | {{/this}} 11 | ] -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/icon.png -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadCircleCIArtifacts", 3 | "main": "download.js", 4 | "license": "MIT", 5 | "dependencies": { 6 | "@types/node": "^6.14.13", 7 | "artifact-engine": "^1.263.0", 8 | "azure-pipelines-task-lib": "^4.17.3", 9 | "underscore": "1.13.4" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/Tasks/DownloadCircleCIArtifacts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "sourceMap": false, 7 | "allowJs": true, 8 | "checkJs": true, 9 | "noEmit": true, 10 | "noEmitOnError": false, 11 | "forceConsistentCasingInFileNames": true, 12 | "strict": true, 13 | "noImplicitAny": true, 14 | "strictNullChecks": true, 15 | "strictFunctionTypes": true, 16 | "strictBindCallApply": true, 17 | "strictPropertyInitialization": true, 18 | "noImplicitThis": true, 19 | "useUnknownInCatchVariables": true, 20 | "alwaysStrict": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "noImplicitReturns": true, 24 | "noFallthroughCasesInSwitch": true, 25 | "allowUnusedLabels": true, 26 | "allowUnreachableCode": true, 27 | "skipLibCheck": true 28 | }, 29 | "include": [ 30 | "./**.ts" 31 | ] 32 | } -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/images/Add_CircleCI_Artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/CircleCI/Src/images/Add_CircleCI_Artifact.png -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/images/Add_CircleCI_Connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/CircleCI/Src/images/Add_CircleCI_Connection.png -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/images/icon-circleci-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/CircleCI/Src/images/icon-circleci-logo.png -------------------------------------------------------------------------------- /Extensions/CircleCI/Src/readme.md: -------------------------------------------------------------------------------- 1 | # CircleCI™ artifacts for Release pipeline 2 | 3 | This extension is an integration point for CircleCI™ with Release pipeline in Azure DevOps Services. With this extension, you can deploy artifacts from CircleCI™ builds using Release pipeline. 4 | 5 | **Note:** This extension work only with Azure DevOps Services and Azure DevOps Server "18" RC onwards. 6 | 7 | ## Usage 8 | This extension provides a service endpoint to connect to CircleCI™ account. Once connected, you can link a build artifact from the CircleCI™ project and deploy the same using Release pipeline orchestration service. 9 | 10 | ### Connecting to a CircleCI™ project 11 | Go to project settings -> *Service connections* tab and create a New Service Connection of type CircleCI™ 12 | 13 | ![Creating a CircleCI™ service connection](images/Add_CircleCI_Connection.png) 14 | 15 | 16 | ### Linking a CircleCI™ build 17 | Once you have set up the service connection, you would be able to link a CircleCI build artifact in your release pipeline. 18 | 19 | ![Linking CircleCI™ artifact](images/Add_CircleCI_Artifact.png) 20 | 21 | [Learn more about artifacts in Release Pipeline](https://msdn.microsoft.com/library/vs/alm/release/author-release-definition/understanding-artifacts). Also you can use [Azure Pipeline Extensions on Github](https://github.com/Microsoft/azure-pipelines-extensions/issues) to report any issues. 22 | 23 | **Note:** CircleCI™ is trademark owned by **Circle Internet Services, Inc**. 24 | 25 | -------------------------------------------------------------------------------- /Extensions/Common/DeploymentSDK/Src/Microsoft.VisualStudio.Services.DevTestLabs.Definition.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Common/DeploymentSDK/Src/Microsoft.VisualStudio.Services.DevTestLabs.Definition.dll -------------------------------------------------------------------------------- /Extensions/Common/DeploymentSDK/Src/Microsoft.VisualStudio.Services.DevTestLabs.Deployment.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Common/DeploymentSDK/Src/Microsoft.VisualStudio.Services.DevTestLabs.Deployment.dll -------------------------------------------------------------------------------- /Extensions/Common/DeploymentSDK/Src/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Common/DeploymentSDK/Src/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Extensions/Common/DeploymentSDK/Src/VisualStudioRemoteDeployer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/Common/DeploymentSDK/Src/VisualStudioRemoteDeployer.exe -------------------------------------------------------------------------------- /Extensions/Common/DeploymentSDK/Src/VisualStudioRemoteDeployer.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Extensions/Common/TelemetryHelper/Src/TelemetryHelper.ps1: -------------------------------------------------------------------------------- 1 | # Telemetry Codes 2 | $telemetryCodes = 3 | @{ 4 | "Input_Validation" = "Input_Validation_Error"; 5 | "Task_InternalError" = "Task_Internal_Error"; 6 | "DTLSDK_Error" = "Dtl_Sdk_Error"; 7 | } 8 | 9 | # Telemetry Write Method 10 | function Write-Telemetry 11 | { 12 | [CmdletBinding()] 13 | param( 14 | [Parameter(Mandatory=$True,Position=1)] 15 | [string]$codeKey, 16 | 17 | [Parameter(Position=2)] 18 | [string]$errorMsg 19 | ) 20 | 21 | $erroCodeMsg = $telemetryCodes[$codeKey] 22 | 23 | ## If no error is passed mark it as not available 24 | if([string]::IsNullOrEmpty($errorMsg)) 25 | { 26 | $errorMsg = "No error details available" 27 | } 28 | $erroCode = ('"{0}":{1}' -f $erroCodeMsg, $errorMsg) 29 | ## Form errorcode as json string 30 | $erroCode = '{' + $erroCode + '}' 31 | 32 | $telemetryString = "##vso[task.logissue type=error;code=" + $erroCode + ";]" 33 | Write-Host $telemetryString 34 | } -------------------------------------------------------------------------------- /Extensions/Common/lib/TestHelpersModule/TestHelpersModule.psm1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | [hashtable]$script:mocks = @{ } 5 | . $PSScriptRoot/PrivateFunctions.ps1 6 | . $PSScriptRoot/PublicFunctions.ps1 7 | 8 | Export-ModuleMember -Verbose:$false -Function @( 9 | 'Assert-AreEqual' 10 | 'Assert-AreNotEqual' 11 | 'Assert-IsNotNullOrEmpty' 12 | 'Assert-IsNullOrEmpty' 13 | 'Assert-IsGreaterThan' 14 | 'Assert-Throws' 15 | 'Assert-WasCalled' 16 | 'Register-Mock' 17 | 'Unregister-Mock' 18 | ) 19 | -------------------------------------------------------------------------------- /Extensions/Common/lib/vsts-task-lib/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/Common/lib/vsts-task-lib/mock.js: -------------------------------------------------------------------------------- 1 | /// 2 | "use strict"; 3 | var answerFile = process.env['MOCK_RESPONSES']; 4 | if (!answerFile) { 5 | throw new Error('MOCK_RESPONSES envvar not set'); 6 | } 7 | var answers = require(answerFile); 8 | if (!answers) { 9 | throw new Error('Answer file not found: ' + answerFile); 10 | } 11 | function getResponse(cmd, key) { 12 | if (!answers[cmd]) { 13 | return null; 14 | } 15 | if (!answers[cmd][key] && key && process.env['MOCK_NORMALIZE_SLASHES'] === 'true') { 16 | // try normalizing the slashes 17 | var key2 = key.replace(/\\/g, "/"); 18 | if (answers[cmd][key2]) { 19 | return answers[cmd][key2]; 20 | } 21 | } 22 | return answers[cmd][key]; 23 | } 24 | exports.getResponse = getResponse; 25 | -------------------------------------------------------------------------------- /Extensions/Common/lib/vsts-task-lib/readme.txt: -------------------------------------------------------------------------------- 1 | This node_modules directory contains a mocked out vsts-task-lib and other libraries for running L0 tests. 2 | 3 | Tasks are other code that is run is copied into a temp directory under Tests which is cleared. Because this node_modules is up the chain, it will ensure the mock is called when the task runs. -------------------------------------------------------------------------------- /Extensions/Common/lib/vsts-task-lib/sampleresponses.json: -------------------------------------------------------------------------------- 1 | { 2 | "which": { 3 | "xcodebuild": "/usr/bin/xcodebuild", 4 | "xctool": "/usr/local/bin/xctool" 5 | }, 6 | "exec": { 7 | "/usr/local/bin/tool -arg1 \"some val\" -flag": { 8 | "code": 0, 9 | "stdout": "tool stdout", 10 | "stderr": "tool stderr" 11 | } 12 | }, 13 | "checkPath": { 14 | "some/path/foo": true, 15 | "some/path/bar": false 16 | }, 17 | "find": { 18 | "/some/path": [ 19 | "/some/path/one", 20 | "/some/path/two" 21 | ] 22 | }, 23 | "match": { 24 | "some*pattern": [ 25 | "/some/path/one", 26 | "/some/path/two" 27 | ] 28 | }, 29 | "filter": { 30 | "some*pattern": [ 31 | "/some/path/one", 32 | "/some/path/two" 33 | ] 34 | }, 35 | "getVariable": { 36 | "someVar1": "value1", 37 | "someVar2": "value2" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/icon.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadArtifactsTfsGit", 3 | "main": "download.js", 4 | "dependencies": { 5 | "@azure/msal-node": "^2.7.0", 6 | "azure-devops-node-api": "14.1.0", 7 | "azure-pipelines-task-lib": "^4.13.0", 8 | "azure-pipelines-tasks-azure-arm-rest": "^3.263.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsVersionControl/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsVersionControl/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsVersionControl/icon.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsVersionControl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadArtifactsTfsVersionControl", 3 | "main": "download.js", 4 | "dependencies": { 5 | "@types/shelljs": "^0.8.17", 6 | "azure-devops-node-api": "11.2.0", 7 | "azure-pipelines-task-lib": "^4.17.3", 8 | "shelljs": "^0.10.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/icon.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadExternalBuildArtifacts", 3 | "main": "download.js", 4 | "dependencies": { 5 | "@azure/msal-node": "^3.7.3", 6 | "artifact-engine": "^1.263.0", 7 | "azure-devops-node-api": "14.1.0", 8 | "azure-pipelines-task-lib": "^4.13.0", 9 | "azure-pipelines-tasks-azure-arm-rest": "^3.263.0" 10 | }, 11 | "devDependencies": { 12 | "typescript": "5.1.6" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "moduleResolution": "nodenext", 6 | "esModuleInterop": true, 7 | }, 8 | "exclude": [ 9 | "node_modules" 10 | ] 11 | } -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/Tasks/DownloadExternalBuildArtifacts/vsts.handlebars: -------------------------------------------------------------------------------- 1 | [ 2 | {{#value}} 3 | { 4 | "path": "{{this.path}}", 5 | "lastModified": "{{this.dateLastModified}}", 6 | {{#if fileLength}} 7 | "fileLength" : "{{this.fileLength}}", 8 | {{/if}} 9 | "itemType": "{{this.itemType}}", 10 | "metadata": 11 | { 12 | "downloadUrl" : "{{{this.contentLocation}}}&isShallow=true" 13 | } 14 | }{{#unless @last}},{{/unless}} 15 | {{/value}} 16 | ] -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/images/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/images/screen1.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/images/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/images/screen2.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/images/screen3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/images/screen3.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/images/screen4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/images/screen4.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/images/screen5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/images/screen5.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/vss_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/vss_default.png -------------------------------------------------------------------------------- /Extensions/ExternalTfs/Src/vss_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ExternalTfs/Src/vss_wide.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Assets/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/IISWebDeployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/IISWebDeployment.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/IISWebDeploymentTasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/IISWebDeploymentTasks.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/IISWebManagement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/IISWebManagement.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/IIS_Web_App.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/IIS_Web_App.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/IIS_Web_App_Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/IIS_Web_App_Large.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Images/SQLServerDacpac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Images/SQLServerDacpac.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/Main.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [string]$machinesList, 3 | [string]$adminUserName, 4 | [string]$adminPassword, 5 | [string]$winrmProtocol, 6 | [string]$testCertificate, 7 | [string]$webDeployPackage, 8 | [string]$webDeployParamFile, 9 | [string]$overRideParams, 10 | [string]$websiteName, 11 | [string]$removeAdditionalFiles, 12 | [string]$excludeFilesFromAppData, 13 | [string]$takeAppOffline, 14 | [string]$additionalArguments, 15 | [string]$deployInParallel 16 | ) 17 | 18 | if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) 19 | { 20 | Write-Verbose "Resetting input encoding." 21 | [Console]::InputEncoding = New-Object Text.UTF8Encoding $false 22 | } 23 | 24 | $env:CURRENT_TASK_ROOTDIR = Split-Path -Parent $MyInvocation.MyCommand.Path 25 | 26 | . $env:CURRENT_TASK_ROOTDIR\TelemetryHelper\TelemetryHelper.ps1 27 | . $env:CURRENT_TASK_ROOTDIR\DeployIISWebApp.ps1 28 | 29 | (Main -machinesList $machinesList -adminUserName $adminUserName -adminPassword $adminPassword -winrmProtocol $winrmProtocol -testCertificate $testCertificate -webDeployPackage "$webDeployPackage" -webDeployParamFile "$webDeployParamFile" -overRideParams "$overRideParams" -websiteName "$websiteName" -removeAdditionalFiles $removeAdditionalFiles -excludeFilesFromAppData $excludeFilesFromAppData -takeAppOffline $takeAppOffline -additionalArguments $additionalArguments -deployInParallel $deployInParallel) -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/externals.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "taskModule": [{ 4 | "name": "Sanitizer", 5 | "type": "powershell", 6 | "dest": "ps_modules" 7 | }], 8 | "nugetv2": { 9 | "VstsTaskSdk": { 10 | "version": "0.7.1", 11 | "repository": "https://www.powershellgallery.com/api/v2/", 12 | "cp": [ 13 | { 14 | "source": [ 15 | "*.ps1", 16 | "*.psd1", 17 | "*.psm1", 18 | "lib.json", 19 | "Strings" 20 | ], 21 | "dest": "ps_modules/VstsTaskSdk/" 22 | } 23 | ] 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV2/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV2/externals.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "taskModule": [{ 4 | "name": "Sanitizer", 5 | "type": "powershell", 6 | "dest": "ps_modules" 7 | }], 8 | "nugetv2": { 9 | "VstsTaskSdk": { 10 | "version": "0.7.1", 11 | "repository": "https://www.powershellgallery.com/api/v2/", 12 | "cp": [ 13 | { 14 | "source": [ 15 | "*.ps1", 16 | "*.psd1", 17 | "*.psm1", 18 | "lib.json", 19 | "Strings" 20 | ], 21 | "dest": "ps_modules/VstsTaskSdk/" 22 | } 23 | ] 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV2/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskModule": [{ 3 | "name": "Sanitizer", 4 | "type": "powershell", 5 | "dest": "ps_modules" 6 | }], 7 | "nugetv2": { 8 | "VstsTaskSdk": { 9 | "version": "0.7.1", 10 | "repository": "https://www.powershellgallery.com/api/v2/", 11 | "cp": [ 12 | { 13 | "source": [ 14 | "*.ps1", 15 | "*.psd1", 16 | "*.psm1", 17 | "lib.json" 18 | ], 19 | "dest": "ps_modules/VstsTaskSdk/" 20 | } 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskModule": [{ 3 | "name": "Sanitizer", 4 | "type": "powershell", 5 | "dest": "ps_modules" 6 | }], 7 | "nugetv2": { 8 | "VstsTaskSdk": { 9 | "version": "0.7.1", 10 | "repository": "https://www.powershellgallery.com/api/v2/", 11 | "cp": [ 12 | { 13 | "source": [ 14 | "*.ps1", 15 | "*.psd1", 16 | "*.psm1", 17 | "lib.json" 18 | ], 19 | "dest": "VstsTaskSdk/" 20 | } 21 | ] 22 | }, 23 | "RemoteDeployer": { 24 | "version": "0.1.0", 25 | "repository": "https://www.powershellgallery.com/api/v2/", 26 | "cp": [ 27 | { 28 | "source": [ 29 | "*.ps1", 30 | "*.psd1", 31 | "*.psm1", 32 | "module.json", 33 | "Strings" 34 | ], 35 | "dest": "RemoteDeployer/", 36 | "options": "-R" 37 | } 38 | ] 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskModule": [{ 3 | "name": "Sanitizer", 4 | "type": "powershell", 5 | "dest": "ps_modules" 6 | }], 7 | "nugetv2": { 8 | "VstsTaskSdk": { 9 | "version": "0.7.1", 10 | "repository": "https://www.powershellgallery.com/api/v2/", 11 | "cp": [ 12 | { 13 | "source": [ 14 | "*.ps1", 15 | "*.psd1", 16 | "*.psm1", 17 | "lib.json" 18 | ], 19 | "dest": "ps_modules/VstsTaskSdk/" 20 | } 21 | ] 22 | }, 23 | "RemoteDeployer": { 24 | "version": "0.1.0", 25 | "repository": "https://www.powershellgallery.com/api/v2/", 26 | "cp": [ 27 | { 28 | "source": [ 29 | "*.ps1", 30 | "*.psd1", 31 | "*.psm1", 32 | "module.json", 33 | "Strings" 34 | ], 35 | "dest": "RemoteDeployer/", 36 | "options": "-R" 37 | } 38 | ] 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskModule": [{ 3 | "name": "TaskModuleSqlUtility", 4 | "type": "powershell", 5 | "dest": "." 6 | }, 7 | { 8 | "name": "Sanitizer", 9 | "type": "powershell", 10 | "dest": "ps_modules" 11 | }], 12 | "nugetv2": { 13 | "VstsTaskSdk": { 14 | "version": "0.7.1", 15 | "repository": "https://www.powershellgallery.com/api/v2/", 16 | "cp": [ 17 | { 18 | "source": [ 19 | "*.ps1", 20 | "*.psd1", 21 | "*.psm1", 22 | "lib.json", 23 | "Strings" 24 | ], 25 | "dest": "ps_modules/VstsTaskSdk/" 26 | } 27 | ] 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/MITLicense.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskModule": [{ 3 | "name": "TaskModuleSqlUtility", 4 | "type": "powershell", 5 | "dest": "." 6 | }, 7 | { 8 | "name": "Sanitizer", 9 | "type": "powershell", 10 | "dest": "ps_modules" 11 | }], 12 | "nugetv2": { 13 | "VstsTaskSdk": { 14 | "version": "0.7.1", 15 | "repository": "https://www.powershellgallery.com/api/v2/", 16 | "cp": [ 17 | { 18 | "source": [ 19 | "*.ps1", 20 | "*.psd1", 21 | "*.psm1", 22 | "lib.json", 23 | "Strings" 24 | ], 25 | "dest": "ps_modules/VstsTaskSdk/" 26 | } 27 | ] 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/icon.png -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0ComputeMsDeploySetParamsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Shouldn't alter override params when override params for websitename is already present 12 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite2" -overRideParams 'name="IIS Web Application Name",value="dummyWebsite"' 13 | 14 | Assert-AreEqual $result 'name="IIS Web Application Name",value="dummyWebsite"' 15 | 16 | # Test 2: Should add setParam to deploy on website When no override params is given 17 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite" 18 | 19 | Assert-AreEqual ($result.Contains('name="IIS Web Application Name",value="dummyWebsite"')) $true 20 | 21 | # Test 3: Should add setParam to deploy on website When override params contain db connection string override 22 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite" -overRideParams 'name="ConnectionString",value="DummyConnectionString"' 23 | 24 | Assert-AreEqual ($result.Contains('name="IIS Web Application Name",value="dummyWebsite"')) $true 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0DeployWebSiteFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test: It should append msDeploy path and msDeploy args and run 12 | $msDeploy = "Msdeploy.exe" 13 | $msDeployArgs = " -verb:sync -source:package=Web.zip -setParamFile=SampleParam.xml" 14 | 15 | Register-Mock Run-Command { return } 16 | Register-Mock Get-MsDeployLocation { return $msDeploy } 17 | Register-Mock Get-MsDeployCmdArgs { return $msDeployArgs } 18 | 19 | $output = Deploy-WebSite -websiteName "SampleWebApp" -webDeployPkg "Web.zip" -webDeployParamFile "SampleParam.xml" 4>&1 | Out-String 20 | 21 | Assert-AreEqual ($output.Contains("$msDeploy")) $true 22 | Assert-AreEqual ($output.Contains("$msDeployArgs")) $true 23 | Assert-WasCalled Run-Command 24 | Assert-WasCalled Get-MsDeployLocation 25 | Assert-WasCalled Get-MsDeployCmdArgs -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0EscapeSpecialCharactersFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should add powershell escape character for double quotes 12 | Assert-AreEqual (EscapeSpecialChars -str 'StringWithDouble"Quotes') 'StringWithDouble`"Quotes' 13 | 14 | # Test 2: Should add powershell escape character for dollar symbol 15 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith$dollar') 'StringWith`$dollar' 16 | 17 | # Test 3: Should add powershell escape for ` and $ symbol character 18 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith`$dollar') 'StringWith```$dollar' 19 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0ExecuteMainFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test: Should deploy website When execute main is invoked with package input 12 | $webDeployPackage = "WebDeploy.Pkg" 13 | $webDeployParamFile = "Param.xml" 14 | $overrideParams = "Abc=xyz" 15 | 16 | Register-Mock Deploy-WebSite { return } -ParametersEvaluator { $webDeployPkg -eq $WebDeployPackage -and $webDeployParamFile -eq $webDeployParamFile -and $overRideParams -eq $overRideParams} 17 | Register-Mock Is-Directory { return $false } 18 | Register-Mock Contains-ParamFile { return $false } 19 | 20 | Execute-Main -WebDeployPackage $WebDeployPackage -webDeployParamFile $WebDeployParamFile -overRiderParams $OverRideParams 21 | 22 | Assert-WasCalled -Command Deploy-WebSite -Times 1 23 | Assert-WasCalled Is-Directory 24 | Assert-WasCalled Contains-ParamFile 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0GetMsDeployLocationFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should throw exception when MsDeploy is not installed on given registry path 12 | $regKeyWithNoInstallPath = "HKLM:\SOFTWARE\Microsoft" 13 | 14 | Assert-Throws { Get-MsDeployLocation -regKeyPath $regKeyWithNoInstallPath } 15 | 16 | # Test 2: Should throw when Get-ChildItem fails as MsDeploy not installed on the machine 17 | $msDeployNotFoundError = "Cannot find MsDeploy.exe location. Verify MsDeploy.exe is installed on $env:ComputerName and try operation again." 18 | $inValidInstallPathRegKey = "HKLM:\SOFTWARE\Microsoft\IIS Extensions\Invalid" 19 | 20 | Assert-Throws { Get-MsDeployLocation -regKeyPath $inValidInstallPathRegKey } $msDeployNotFoundError 21 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0GetScriptToRunFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\ps_modules\Sanitizer\ArgumentsSanitizer.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | Register-Mock Get-Content { return "Dummy Script" } 12 | 13 | # Test 14 | $script = Get-ScriptToRun -webDeployPackage "pkg.zip" -webDeployParamFile "" -overRideParams "" -websiteName "Sample Web" -removeAdditionalFiles "false" -excludeFilesFromAppData "true" -takeAppOffline "true" -additonalArguments "" 15 | 16 | Assert-AreEqual ($script.Contains('Dummy Script')) $true 17 | Assert-AreEqual ($script.Contains('Execute-Main -WebDeployPackage "pkg.zip" -WebDeployParamFile "" -OverRideParams "" -WebsiteName "Sample Web" -RemoveAdditionalFiles false -ExcludeFilesFromAppData true -TakeAppOffline true -AdditionalArguments ""')) $true 18 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0IsDirectoryFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: When path provided is a directory, Should return true as temp path is a directory 12 | $isDirectory = Is-Directory -Path $env:temp 13 | Assert-AreEqual $isDirectory $true 14 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0MainFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\ps_modules\Sanitizer\ArgumentsSanitizer.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | 12 | # Test 13 | Register-Mock Get-Content {return "dummyscript"} 14 | Register-Mock Invoke-RemoteDeployment { return "" } -ParametersEvaluator { $MachinesList -eq "dummyMachinesList" } 15 | 16 | Main -machinesList "dummyMachinesList" -adminUserName "dummyadminuser" -adminPassword "dummyadminpassword" -winrmProtocol "https" -testCertificate "true" -webDeployPackage "pkg.zip" -webDeployParamFile "param.xml" -overRideParams "dummyoverride" -websiteName "dummyweb" 17 | 18 | Assert-WasCalled Get-Content 19 | Assert-WasCalled Invoke-RemoteDeployment -ParametersEvaluator { $MachinesList -eq "dummyMachinesList" } 20 | 21 | Unregister-Mock Invoke-RemoteDeployment -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0RunCommandFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should throw exception when command execution fails 12 | $errMsg = "Command Execution Failed" 13 | Register-Mock cmd.exe { throw $errMsg} 14 | 15 | try 16 | { 17 | $result = Run-Command -command "NonExisingCommand" 18 | } 19 | catch 20 | { 21 | $result = $_ 22 | } 23 | 24 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 25 | 26 | Unregister-Mock cmd.exe 27 | 28 | # Test 2: Should execute without throwing any exceptions 29 | try 30 | { 31 | $result = Run-Command -command "echo %cd%" 32 | } 33 | catch 34 | { 35 | $result = $_ 36 | } 37 | 38 | Assert-IsNullOrEmpty $result.Exception 39 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV1/L0TrimInputsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV1\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | $pkgNoExtraQuotes = "webdeploy.zip" 12 | $paramfileNoExtraQuotes = "paramfile.xml" 13 | $siteNoExtraQuotes = "website" 14 | $adminUserNoSpaces = "adminuser" 15 | 16 | # Test 1: Should remove extra quotes for all inputs except usernames 17 | $pkg = "`"webdeploy.zip`"" 18 | $paramfile = "`"paramfile.xml`"" 19 | $site = "`"website`"" 20 | 21 | Trim-Inputs -package ([ref]$pkg) -paramFile ([ref]$paramfile) -siteName ([ref]$site) -adminUser ([ref]$adminUserNoSpaces) 22 | 23 | Assert-AreEqual $pkg $pkgNoExtraQuotes 24 | Assert-AreEqual $paramfile $paramfileNoExtraQuotes 25 | Assert-AreEqual $site $siteNoExtraQuotes 26 | 27 | # Test 2: Should remove extra spaces for adminUserName 28 | $adminUser = " adminuser " 29 | 30 | Trim-Inputs -package ([ref]$pkgNoExtraQuotes) -paramFile ([ref]$paramfileNoExtraQuotes) -siteName ([ref]$siteNoExtraQuotes) -adminUser ([ref]$adminUser) 31 | 32 | Assert-AreEqual $adminUser $adminUserNoSpaces -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0ComputeMsDeploySetParamsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Shouldn't alter override params when override params for websitename is already present 12 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite2" -overRideParams 'name="IIS Web Application Name",value="dummyWebsite"' 13 | 14 | Assert-AreEqual $result 'name="IIS Web Application Name",value="dummyWebsite"' 15 | 16 | # Test 2: Should add setParam to deploy on website When no override params is given 17 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite" 18 | 19 | Assert-AreEqual ($result.Contains('name="IIS Web Application Name",value="dummyWebsite"')) $true 20 | 21 | # Test 3: Should add setParam to deploy on website When override params contain db connection string override 22 | $result = Compute-MsDeploy-SetParams -websiteName "dummyWebsite" -overRideParams 'name="ConnectionString",value="DummyConnectionString"' 23 | 24 | Assert-AreEqual ($result.Contains('name="IIS Web Application Name",value="dummyWebsite"')) $true 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0DeployWebSiteFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test: It should append msDeploy path and msDeploy args and run 12 | $msDeploy = "Msdeploy.exe" 13 | $msDeployArgs = " -verb:sync -source:package=Web.zip -setParamFile=SampleParam.xml" 14 | 15 | Register-Mock Run-Command { return } 16 | Register-Mock Get-MsDeployLocation { return $msDeploy } 17 | Register-Mock Get-MsDeployCmdArgs { return $msDeployArgs } 18 | 19 | $output = Deploy-WebSite -websiteName "SampleWebApp" -webDeployPkg "Web.zip" -webDeployParamFile "SampleParam.xml" 4>&1 | Out-String 20 | 21 | Assert-AreEqual ($output.Contains("$msDeploy")) $true 22 | Assert-AreEqual ($output.Contains("$msDeployArgs")) $true 23 | Assert-WasCalled Run-Command 24 | Assert-WasCalled Get-MsDeployLocation 25 | Assert-WasCalled Get-MsDeployCmdArgs -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0EscapeSpecialCharactersFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should add powershell escape character for double quotes 12 | Assert-AreEqual (EscapeSpecialChars -str 'StringWithDouble"Quotes') 'StringWithDouble`"Quotes' 13 | 14 | # Test 2: Should add powershell escape character for dollar symbol 15 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith$dollar') 'StringWith`$dollar' 16 | 17 | # Test 3: Should add powershell escape for ` and $ symbol character 18 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith`$dollar') 'StringWith```$dollar' 19 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0ExecuteMainFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test: Should deploy website When execute main is invoked with package input 12 | $webDeployPackage = "WebDeploy.Pkg" 13 | $webDeployParamFile = "Param.xml" 14 | $overrideParams = "Abc=xyz" 15 | 16 | Register-Mock Deploy-WebSite { return } -ParametersEvaluator { $webDeployPkg -eq $WebDeployPackage -and $webDeployParamFile -eq $webDeployParamFile -and $overRideParams -eq $overRideParams} 17 | Register-Mock Is-Directory { return $false } 18 | Register-Mock Contains-ParamFile { return $false } 19 | 20 | Execute-Main -WebDeployPackage $WebDeployPackage -webDeployParamFile $WebDeployParamFile -overRiderParams $OverRideParams 21 | 22 | Assert-WasCalled -Command Deploy-WebSite -Times 1 23 | Assert-WasCalled Is-Directory 24 | Assert-WasCalled Contains-ParamFile 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0GetMsDeployLocationFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should throw exception when MsDeploy is not installed on given registry path 12 | $regKeyWithNoInstallPath = "HKLM:\SOFTWARE\Microsoft" 13 | 14 | Assert-Throws { Get-MsDeployLocation -regKeyPath $regKeyWithNoInstallPath } 15 | 16 | # Test 2: Should throw when Get-ChildItem fails as MsDeploy not installed on the machine 17 | $inValidInstallPathRegKey = "HKLM:\SOFTWARE\Microsoft\IIS Extensions\Invalid" 18 | 19 | Assert-Throws { Get-MsDeployLocation -regKeyPath $inValidInstallPathRegKey } $msDeployNotFoundError -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0GetScriptToRunFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\ps_modules\Sanitizer\ArgumentsSanitizer.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | Register-Mock Get-Content { return "Dummy Script" } 12 | 13 | # Test 14 | $script = Get-ScriptToRun -webDeployPackage "pkg.zip" -webDeployParamFile "" -overRideParams "" -websiteName "Sample Web" -removeAdditionalFiles "false" -excludeFilesFromAppData "true" -takeAppOffline "true" -additonalArguments "" 15 | 16 | Assert-AreEqual ($script.Contains('Dummy Script')) $true 17 | Assert-AreEqual ($script.Contains('Execute-Main -WebDeployPackage "pkg.zip" -WebDeployParamFile "" -OverRideParams "" -WebsiteName "Sample Web" -RemoveAdditionalFiles false -ExcludeFilesFromAppData true -TakeAppOffline true -AdditionalArguments ""')) $true -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0IsDirectoryFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: When path provided is a directory, Should return true as temp path is a directory 12 | $isDirectory = Is-Directory -Path $env:temp 13 | Assert-AreEqual $isDirectory $true 14 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0MainFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\ps_modules\Sanitizer\ArgumentsSanitizer.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | 12 | # Test 13 | Register-Mock Get-Content {return "dummyscript"} 14 | Register-Mock Invoke-RemoteDeployment { return "" } -ParametersEvaluator { $MachinesList -eq "dummyMachinesList" } 15 | 16 | Main -machinesList "dummyMachinesList" -adminUserName "dummyadminuser" -adminPassword "dummyadminpassword" -winrmProtocol "https" -testCertificate "true" -webDeployPackage "pkg.zip" -webDeployParamFile "param.xml" -overRideParams "dummyoverride" -websiteName "dummyweb" 17 | 18 | Assert-WasCalled Get-Content 19 | Assert-WasCalled Invoke-RemoteDeployment -ParametersEvaluator { $MachinesList -eq "dummyMachinesList" } 20 | 21 | Unregister-Mock Invoke-RemoteDeployment -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0RunCommandFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\MsDeployOnTargetMachines.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should throw exception when command execution fails 12 | $errMsg = "Command Execution Failed" 13 | Register-Mock cmd.exe { throw $errMsg} 14 | 15 | try 16 | { 17 | $result = Run-Command -command "NonExisingCommand" 18 | } 19 | catch 20 | { 21 | $result = $_ 22 | } 23 | 24 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 25 | 26 | Unregister-Mock cmd.exe 27 | 28 | # Test 2: Should execute without throwing any exceptions 29 | try 30 | { 31 | $result = Run-Command -command "echo %cd%" 32 | } 33 | catch 34 | { 35 | $result = $_ 36 | } 37 | 38 | Assert-IsNullOrEmpty $result.Exception 39 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppDeploy/IISWebAppDeployV2/L0TrimInputsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppDeploy\IISWebAppDeployV2\DeployIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | $pkgNoExtraQuotes = "webdeploy.zip" 12 | $paramfileNoExtraQuotes = "paramfile.xml" 13 | $siteNoExtraQuotes = "website" 14 | $adminUserNoSpaces = "adminuser" 15 | 16 | # Test 1: Should remove extra quotes for all inputs except usernames 17 | $pkg = "`"webdeploy.zip`"" 18 | $paramfile = "`"paramfile.xml`"" 19 | $site = "`"website`"" 20 | 21 | Trim-Inputs -package ([ref]$pkg) -paramFile ([ref]$paramfile) -siteName ([ref]$site) -adminUser ([ref]$adminUserNoSpaces) 22 | 23 | Assert-AreEqual $pkg $pkgNoExtraQuotes 24 | Assert-AreEqual $paramfile $paramfileNoExtraQuotes 25 | Assert-AreEqual $site $siteNoExtraQuotes 26 | 27 | # Test 2: Should remove extra spaces for adminUserName 28 | $adminUser = " adminuser " 29 | 30 | Trim-Inputs -package ([ref]$pkgNoExtraQuotes) -paramFile ([ref]$paramfileNoExtraQuotes) -siteName ([ref]$siteNoExtraQuotes) -adminUser ([ref]$adminUser) 31 | 32 | Assert-AreEqual $adminUser $adminUserNoSpaces -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0CreateAppPoolFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\AppCmdOnTargetMachines.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | # Test 1: Should contain appcmd add site, It should run appcmd add apppool command 11 | $appCmd = "appcmd.exe" 12 | $appCmdArgs = " add apppool /name:`"Sample App Pool`"" 13 | 14 | Register-Mock Run-Command { return } 15 | Register-Mock Get-AppCmdLocation { return $appCmd, 8 } 16 | 17 | $output = Create-AppPool -appPoolName "Sample App Pool" 4>&1 | Out-String 18 | Assert-AreEqual $true ($output.Contains("$appCmd")) 19 | Assert-AreEqual $true ($output.Contains("$appCmdArgs")) 20 | 21 | Assert-WasCalled Run-Command 22 | Assert-WasCalled Get-AppCmdLocation 23 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0CreateWebsiteFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\AppCmdOnTargetMachines.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | # Test 1: Should contain appcmd add site, It should run appcmd add site command 11 | $appCmd = "appcmd.exe" 12 | $appCmdArgs = " add site /name:`"Sample Web`" /physicalPath:`"C:\Temp Path`"" 13 | Register-Mock Run-Command { return } 14 | Register-Mock Get-AppCmdLocation { return $appCmd, 8 } 15 | 16 | $output = Create-WebSite -siteName "Sample Web" -physicalPath "C:\Temp Path" 4>&1 | Out-String 17 | Assert-AreEqual $true ($output.Contains("$appCmd")) 18 | Assert-AreEqual $true ($output.Contains("$appCmdArgs")) 19 | 20 | Assert-WasCalled Run-Command 21 | Assert-WasCalled Get-AppCmdLocation 22 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0DoesAppPoolExistsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\AppCmdOnTargetMachines.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | Register-Mock Get-AppCmdLocation {return "appcmd.exe", 8} 11 | 12 | # Test 1: function should return false, List Application Pools command returns null. 13 | Register-Mock Run-command { return $null } -ParametersEvaluator { $failOnErr -eq $false } 14 | $result = Does-AppPoolExists -appPoolName "SampleAppPool" 15 | Assert-AreEqual $false $result 16 | 17 | Unregister-Mock Run-command 18 | 19 | # Test 2: function should return true, List Application Pools command returns non-null 20 | Register-Mock Run-command { return "" } -ParametersEvaluator { $failOnErr -eq $false } 21 | $result = Does-AppPoolExists -appPoolName "SampleAppPool" 22 | Assert-AreEqual $true $result 23 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0DoesWebsiteExistsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\AppCmdOnTargetMachines.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | Register-Mock Get-AppCmdLocation {return "appcmd.exe", 8} 11 | 12 | # Test 1: function should return false, List WebSite command returns null. 13 | Register-Mock Run-command { return $null } -ParametersEvaluator { $failOnErr -eq $false } 14 | $result = Does-WebSiteExists -siteName "SampleWeb" 15 | Assert-AreEqual $false $result 16 | 17 | Unregister-Mock Run-command 18 | 19 | # Test 2: function should return true, List WebSite command returns non-null 20 | Register-Mock Run-command { return "" } -ParametersEvaluator { $failOnErr -eq $false } 21 | $result = Does-WebSiteExists -siteName "SampleWeb" 22 | Assert-AreEqual $true $result 23 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0EscapeSpecialCharsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\ManageIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | # Test 1: Should add powershell escape character for double quotes, When input string contains double quote character 12 | Assert-AreEqual 'StringWithDouble`"Quotes' (Escape-SpecialChars -str 'StringWithDouble"Quotes') 13 | 14 | # Test 2: Should add powershell escape character for dollar symbol, When input string contains dollar symbol character 15 | Assert-AreEqual 'StringWith`$dollar' (Escape-SpecialChars -str 'StringWith$dollar') 16 | 17 | # Test 3: Should add powershell escape ` and $ symbol character, When input string contains ` and $ symbol character 18 | Assert-AreEqual 'StringWith```$dollar' (Escape-SpecialChars -str 'StringWith`$dollar') 19 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0GetHostNameFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\ManageIISWebApp.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | 9 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 10 | 11 | $hostnamewithhttp = "hostnamewithhttp" 12 | $hostnamewithsni = "hostnamewithsni" 13 | $hostnamewithoutsni = "hostnamewithoutsni" 14 | 15 | # Test 1: should return hostnamewithhtpp, When protocol is http 16 | $hostname = Get-HostName -protocol "http" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 17 | Assert-AreEqual $hostnamewithhttp $hostname 18 | 19 | # Test 2: should return hostnamewithhtpp, When protocol is https and sni is true 20 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "true" 21 | Assert-AreEqual $hostnamewithsni $hostname 22 | 23 | # Test 3: should return hostnamewithhtpp, When protocol is https and sni is false 24 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 25 | Assert-AreEqual $hostnamewithoutsni $hostname 26 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/L0RunCommandFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV1\AppCmdOnTargetMachines.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | # Test 1: should throw exception, When command execution fails 11 | $errMsg = "Command Execution Failed" 12 | Register-Mock cmd.exe { throw $errMsg} 13 | 14 | try 15 | { 16 | $result = Run-Command -command "NonExisingCommand" 17 | } 18 | catch 19 | { 20 | $result = $_ 21 | } 22 | 23 | Assert-AreEqual $true ($result.Exception.ToString().Contains("$errMsg")) 24 | 25 | Unregister-Mock cmd.exe 26 | 27 | # Test 2: should not throw exception, When command execution successful 28 | try 29 | { 30 | $result = Run-Command -command "echo %cd%" 31 | } 32 | catch 33 | { 34 | $result = $_ 35 | } 36 | 37 | Assert-IsNullOrEmpty $result.Exception 38 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/L0EscapeSpecialCharsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV2\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | # Test 1: Should add powershell escape character for double quotes, When input string contains double quote character 11 | Assert-AreEqual 'StringWithDouble`"Quotes' (Escape-SpecialChars -str 'StringWithDouble"Quotes') 12 | 13 | # Test 2: Should add powershell escape character for dollar symbol, When input string contains dollar symbol character 14 | Assert-AreEqual 'StringWith`$dollar' (Escape-SpecialChars -str 'StringWith$dollar') 15 | 16 | # Test 3: Should add powershell escape ` and $ symbol character, When input string contains ` and $ symbol character 17 | Assert-AreEqual 'StringWith```$dollar' (Escape-SpecialChars -str 'StringWith`$dollar') 18 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/L0GetHostNameFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV2\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | $hostnamewithhttp = "hostnamewithhttp" 11 | $hostnamewithsni = "hostnamewithsni" 12 | $hostnamewithoutsni = "hostnamewithoutsni" 13 | 14 | # Test 1: should return hostnamewithhtpp, When protocol is http 15 | $hostname = Get-HostName -protocol "http" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 16 | Assert-AreEqual $hostnamewithhttp $hostname 17 | 18 | # Test 2: should return hostnamewithhtpp, When protocol is https and sni is true 19 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "true" 20 | Assert-AreEqual $hostnamewithsni $hostname 21 | 22 | # Test 3: should return hostnamewithhtpp, When protocol is https and sni is false 23 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 24 | Assert-AreEqual $hostnamewithoutsni $hostname 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/L0RepairInputsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV2\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | $siteExpected = "website" 11 | $pathExpected = "\\web app\path" 12 | $vPathExpected = "virtual web app\path" 13 | $appPoolNameExpected = "application pool name" 14 | $adminUserExpected = "`"adminuser" 15 | $appPoolUserExpected = "`"apppooluser" 16 | 17 | # Test: should convert to expected outputs 18 | $site = "`" website`"" 19 | $path = "`" \\web app\path\`"" 20 | $vPath = "`" \\virtual web app\path\`"" 21 | $appPoolName = "`" application pool name`"" 22 | $adminUser = " `"adminuser" 23 | $appPoolUser = " `"apppooluser" 24 | 25 | Repair-Inputs -siteName ([ref]$site) -physicalPath ([ref]$path) -poolName ([ref]$appPoolName) -virtualPath ([ref]$vPath) -physicalPathAuthuser ([ref]$adminUser) -appPoolUser ([ref]$appPoolUser) 26 | Assert-AreEqual $siteExpected $site 27 | Assert-AreEqual $pathExpected $path 28 | Assert-AreEqual $vPathExpected $vPath 29 | Assert-AreEqual $appPoolNameExpected $appPoolName 30 | Assert-AreEqual $adminUserExpected $adminUser 31 | Assert-AreEqual $appPoolUserExpected $appPoolUser 32 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/MockHelpers.ps1: -------------------------------------------------------------------------------- 1 | ## Helper for global mock functions 2 | 3 | Register-Mock Get-AppCmdLocation { 4 | return "appcmdPath", 8 5 | } 6 | 7 | function Get-MockCredentials { 8 | $username = "domain\name" 9 | $password = 'random!123`"$password' 10 | 11 | $securePass = New-Object System.Security.SecureString 12 | ForEach ($ch in $password.ToCharArray()) { $securePass.appendChar($ch) } 13 | $authCredentials = New-Object System.Management.Automation.PSCredential($username, $securePass) 14 | return $authCredentials 15 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/L0EscapeSpecialCharsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV3\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | # Test 1: Should add powershell escape character for double quotes, When input string contains double quote character 11 | Assert-AreEqual 'StringWithDouble`"Quotes' (Escape-SpecialChars -str 'StringWithDouble"Quotes') 12 | 13 | # Test 2: Should add powershell escape character for dollar symbol, When input string contains dollar symbol character 14 | Assert-AreEqual 'StringWith`$dollar' (Escape-SpecialChars -str 'StringWith$dollar') 15 | 16 | # Test 3: Should add powershell escape ` and $ symbol character, When input string contains ` and $ symbol character 17 | Assert-AreEqual 'StringWith```$dollar' (Escape-SpecialChars -str 'StringWith`$dollar') 18 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/L0GetHostNameFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV3\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | $hostnamewithhttp = "hostnamewithhttp" 11 | $hostnamewithsni = "hostnamewithsni" 12 | $hostnamewithoutsni = "hostnamewithoutsni" 13 | 14 | # Test 1: should return hostnamewithhtpp, When protocol is http 15 | $hostname = Get-HostName -protocol "http" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 16 | Assert-AreEqual $hostnamewithhttp $hostname 17 | 18 | # Test 2: should return hostnamewithhtpp, When protocol is https and sni is true 19 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "true" 20 | Assert-AreEqual $hostnamewithsni $hostname 21 | 22 | # Test 3: should return hostnamewithhtpp, When protocol is https and sni is false 23 | $hostname = Get-HostName -protocol "https" -hostNameWithHttp $hostnamewithhttp -hostNameWithSNI $hostnamewithsni -hostNameWithOutSNI $hostnamewithoutsni -sni "false" 24 | Assert-AreEqual $hostnamewithoutsni $hostname 25 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/L0RepairInputsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\IISWebAppMgmt\IISWebAppMgmtV3\Utility.ps1 7 | 8 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 9 | 10 | $siteExpected = "website" 11 | $pathExpected = "\\web app\path" 12 | $vPathExpected = "virtual web app\path" 13 | $appPoolNameExpected = "application pool name" 14 | $adminUserExpected = "`"adminuser" 15 | $appPoolUserExpected = "`"apppooluser" 16 | 17 | # Test: should convert to expected outputs 18 | $site = "`" website`"" 19 | $path = "`" \\web app\path\`"" 20 | $vPath = "`" \\virtual web app\path\`"" 21 | $appPoolName = "`" application pool name`"" 22 | $adminUser = " `"adminuser" 23 | $appPoolUser = " `"apppooluser" 24 | 25 | Repair-Inputs -siteName ([ref]$site) -physicalPath ([ref]$path) -poolName ([ref]$appPoolName) -virtualPath ([ref]$vPath) -physicalPathAuthuser ([ref]$adminUser) -appPoolUser ([ref]$appPoolUser) 26 | Assert-AreEqual $siteExpected $site 27 | Assert-AreEqual $pathExpected $path 28 | Assert-AreEqual $vPathExpected $vPath 29 | Assert-AreEqual $appPoolNameExpected $appPoolName 30 | Assert-AreEqual $adminUserExpected $adminUser 31 | Assert-AreEqual $appPoolUserExpected $appPoolUser 32 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/MockHelpers.ps1: -------------------------------------------------------------------------------- 1 | ## Helper for global mock functions 2 | 3 | Register-Mock Get-AppCmdLocation { 4 | return "appcmdPath", 8 5 | } 6 | 7 | function Get-MockCredentials { 8 | $username = "domain\name" 9 | $password = 'random!123`"$password' 10 | 11 | $securePass = New-Object System.Security.SecureString 12 | ForEach ($ch in $password.ToCharArray()) { $securePass.appendChar($ch) } 13 | $authCredentials = New-Object System.Management.Automation.PSCredential($username, $securePass) 14 | return $authCredentials 15 | } -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/L0EscapeSpecialCharsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\SqlDacpacDeploy\SqlDacpacDeployV1\DeployToSqlServer.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\Utility.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | 12 | # Test 1: Should add powershell escape character for double quotes When input string contains double quote character 13 | Assert-AreEqual (EscapeSpecialChars -str 'StringWithDouble"Quotes') 'StringWithDouble`"Quotes' 14 | 15 | # Test 2: Should add powershell escape character for dollar symbol When input string contains dollar symbol character 16 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith$dollar') 'StringWith`$dollar' 17 | 18 | # Test 3: Should add powershell escape ` and $ symbol character When input string contains ` and $ symbol character 19 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith`$dollar') 'StringWith```$dollar' -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/L0ImportSqlPs.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\..\..\..\Src\Tasks\SqlDacpacDeploy\SqlDacpacDeployV1\TaskModuleSqlUtility\SqlQueryOnTargetMachines.ps1 6 | 7 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 8 | 9 | # Test 1: should throw exception, When Import execution fails 10 | $errMsg = "Module Not Found" 11 | Register-Mock Import-SqlPs { throw $errMsg} 12 | 13 | try 14 | { 15 | Import-SqlPs 16 | } 17 | catch 18 | { 19 | $result = $_ 20 | } 21 | 22 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 23 | 24 | Unregister-Mock Import-SqlPs 25 | $result = $null 26 | 27 | # Test 2: should not throw exception, When command execution successful 28 | Register-Mock Import-SqlPs { return } 29 | 30 | try 31 | { 32 | Import-SqlPs 33 | } 34 | catch 35 | { 36 | $result = $_ 37 | } 38 | 39 | Assert-IsNullOrEmpty $result.Exception 40 | 41 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/L0InvokeDacpacDeploymentFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\SqlDacpacDeployTestL0Initialize.ps1 5 | 6 | # Test 1: Should deploy dacpac file, When execute DacpacDeployment is invoked with all inputs 7 | Register-Mock Get-SqlPackageOnTargetMachine { return "sqlpackage.exe" } 8 | Register-Mock Get-SqlPackageCmdArgs { return "args" } -ParametersEvaluator { $DacpacFile -eq "sample.dacpac" } 9 | Register-Mock ExecuteCommand { return } 10 | Invoke-DacpacDeployment -dacpacFile "sample.dacpac" -targetMethod "server" -serverName "localhost" 11 | 12 | Assert-WasCalled Get-SqlPackageCmdArgs 13 | Assert-WasCalled ExecuteCommand 14 | Assert-WasCalled -Command Get-SqlPackageOnTargetMachine -Times 1 15 | 16 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/L0RunCommandFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\SqlDacpacDeployTestL0Initialize.ps1 5 | 6 | # Test 1: should throw exception, When command execution fails 7 | $errMsg = "Command Execution Failed" 8 | Register-Mock cmd.exe { throw $errMsg} 9 | 10 | try 11 | { 12 | $result = RunCommand -command "NonExisingCommand" 13 | } 14 | catch 15 | { 16 | $result = $_ 17 | } 18 | 19 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 20 | 21 | Unregister-Mock cmd.exe 22 | 23 | # Test 2: should not throw exception, When command execution successful 24 | try 25 | { 26 | $result = RunCommand -command "echo %cd%" 27 | } 28 | catch 29 | { 30 | $result = $_ 31 | } 32 | 33 | Assert-isNullOrEmpty $result.Exception 34 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/L0EscapeSpecialCharsFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | 6 | . $PSScriptRoot\..\..\..\..\Src\Tasks\SqlDacpacDeploy\SqlDacpacDeployV2\DeployToSqlServer.ps1 7 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\InvokeRemoteDeployment.ps1 8 | . $PSScriptRoot\..\..\..\..\..\Common\DeploymentSDK\Src\Utility.ps1 9 | 10 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 11 | 12 | # Test 1: Should add powershell escape character for double quotes When input string contains double quote character 13 | Assert-AreEqual (EscapeSpecialChars -str 'StringWithDouble"Quotes') 'StringWithDouble`"Quotes' 14 | 15 | # Test 2: Should add powershell escape character for dollar symbol When input string contains dollar symbol character 16 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith$dollar') 'StringWith`$dollar' 17 | 18 | # Test 3: Should add powershell escape ` and $ symbol character When input string contains ` and $ symbol character 19 | Assert-AreEqual (EscapeSpecialChars -str 'StringWith`$dollar') 'StringWith```$dollar' -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/L0ImportSqlPs.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\..\Common\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\..\..\..\Src\Tasks\SqlDacpacDeploy\SqlDacpacDeployV2\TaskModuleSqlUtility\SqlQueryOnTargetMachines.ps1 6 | 7 | Register-Mock Import-Module { Write-Verbose "Dummy Import-Module" -Verbose } 8 | 9 | # Test 1: should throw exception, When Import execution fails 10 | $errMsg = "Module Not Found" 11 | Register-Mock Import-SqlPs { throw $errMsg} 12 | 13 | try 14 | { 15 | Import-SqlPs 16 | } 17 | catch 18 | { 19 | $result = $_ 20 | } 21 | 22 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 23 | 24 | Unregister-Mock Import-SqlPs 25 | $result = $null 26 | 27 | # Test 2: should not throw exception, When command execution successful 28 | Register-Mock Import-SqlPs { return } 29 | 30 | try 31 | { 32 | Import-SqlPs 33 | } 34 | catch 35 | { 36 | $result = $_ 37 | } 38 | 39 | Assert-IsNullOrEmpty $result.Exception 40 | 41 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/L0InvokeDacpacDeploymentFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\SqlDacpacDeployTestL0Initialize.ps1 5 | 6 | # Test 1: Should deploy dacpac file, When execute DacpacDeployment is invoked with all inputs 7 | Register-Mock Get-SqlPackageOnTargetMachine { return "sqlpackage.exe" } 8 | Register-Mock Get-SqlPackageCmdArgs { return "args" } -ParametersEvaluator { $DacpacFile -eq "sample.dacpac" } 9 | Register-Mock ExecuteCommand { return } 10 | Invoke-DacpacDeployment -dacpacFile "sample.dacpac" -targetMethod "server" -serverName "localhost" 11 | 12 | Assert-WasCalled Get-SqlPackageCmdArgs 13 | Assert-WasCalled ExecuteCommand 14 | Assert-WasCalled -Command Get-SqlPackageOnTargetMachine -Times 1 15 | 16 | -------------------------------------------------------------------------------- /Extensions/IISWebAppDeploy/Tests/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/L0RunCommandFunction.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\SqlDacpacDeployTestL0Initialize.ps1 5 | 6 | # Test 1: should throw exception, When command execution fails 7 | $errMsg = "Command Execution Failed" 8 | Register-Mock cmd.exe { throw $errMsg} 9 | 10 | try 11 | { 12 | $result = RunCommand -command "NonExisingCommand" 13 | } 14 | catch 15 | { 16 | $result = $_ 17 | } 18 | 19 | Assert-AreEqual ($result.Exception.ToString().Contains("$errMsg")) $true 20 | 21 | Unregister-Mock cmd.exe 22 | 23 | # Test 2: should not throw exception, When command execution successful 24 | try 25 | { 26 | $result = RunCommand -command "echo %cd%" 27 | } 28 | catch 29 | { 30 | $result = $_ 31 | } 32 | 33 | Assert-isNullOrEmpty $result.Exception 34 | -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV0/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV0/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV1/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/CreateAndQueryChangeRequest/CreateAndQueryChangeRequestV2/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV0/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV0/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV1/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/Tasks/UpdateChangeRequest/UpdateChangeRequestV2/icon.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/1_edit-import-set-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/1_edit-import-set-table.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/2_select-transform-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/2_select-transform-map.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/3_add-field-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/3_add-field-map.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/4_update-transform-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/4_update-transform-map.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/5_field-map-added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/5_field-map-added.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/add-oauth-configuration-organization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/add-oauth-configuration-organization.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/add-oauth-configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/add-oauth-configuration.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/agentless_task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/agentless_task.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/change_request_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/change_request_screenshot.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/check_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/check_create.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/gate_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/gate_screenshot.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/oauth_servicenow_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/oauth_servicenow_connection.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/release_definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/release_definition.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/release_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/release_gate.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/resulting_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/resulting_pipeline.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/servicenow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/servicenow.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/servicenow_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/servicenow_connection.png -------------------------------------------------------------------------------- /Extensions/ServiceNow/Src/images/yaml_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/ServiceNow/Src/images/yaml_pipeline.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ 2 | -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/Strings/resources.resjson/en-US/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.friendlyName": "Download Artifacts - TeamCity", 3 | "loc.helpMarkDown": "", 4 | "loc.description": "Download artifacts from teamcity build", 5 | "loc.instanceNameFormat": "Download Artifacts - TeamCity", 6 | "loc.input.label.connection": "TeamCity Connection", 7 | "loc.input.help.connection": "TeamCity connection", 8 | "loc.input.label.project": "Project", 9 | "loc.input.help.project": "Select the project", 10 | "loc.input.label.definition": "Build Configuration", 11 | "loc.input.help.definition": "Select the build configuration", 12 | "loc.input.label.version": "Build", 13 | "loc.input.help.version": "Build Id", 14 | "loc.input.label.itemPattern": "Download Filter", 15 | "loc.input.help.itemPattern": "Minimatch pattern to filter files to be downloaded. To download all files within artifact drop use drop/**", 16 | "loc.input.label.downloadPath": "Destination directory", 17 | "loc.input.help.downloadPath": "Path on the agent machine where the artifact will be downloaded", 18 | "loc.messages.DownloadArtifacts": "Downloading artifacts from : %s", 19 | "loc.messages.ArtifactsSuccessfullyDownloaded": "Successfully downloaded artifacts to %s" 20 | } -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/icon.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DownloadTeamCityArtifacts", 3 | "main": "download.js", 4 | "dependencies": { 5 | "artifact-engine": "^1.263.0", 6 | "azure-pipelines-task-lib": "^4.17.3", 7 | "underscore": "^1.13.4" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/teamcity.handlebars: -------------------------------------------------------------------------------- 1 | [ 2 | {{#file}} 3 | { 4 | "path": "{{this.name}}", 5 | "lastModified": "{{this.modificationTime}}", 6 | {{#if size}} 7 | "fileLength" : "{{this.size}}", 8 | {{/if}} 9 | {{#if children}} 10 | "itemType": "folder", 11 | {{/if}} 12 | {{#if content}} 13 | "itemType": "file", 14 | {{/if}} 15 | "metadata": { 16 | {{#if content}} 17 | "downloadUrl" : "{{../endpoint.url}}{{content.href}}" 18 | {{/if}} 19 | {{#if children}} 20 | "downloadUrl": "{{../endpoint.url}}{{children.href}}" 21 | {{/if}} 22 | } 23 | }{{#unless @last}},{{/unless}} 24 | {{/file}} 25 | ] -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/Tasks/DownloadTeamCityArtifacts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "sourceMap": false, 7 | "allowJs": true, 8 | "checkJs": true, 9 | "noEmit": true, 10 | "noEmitOnError": false, 11 | "forceConsistentCasingInFileNames": true, 12 | "strict": true, 13 | "noImplicitAny": true, 14 | "strictNullChecks": true, 15 | "strictFunctionTypes": true, 16 | "strictBindCallApply": true, 17 | "strictPropertyInitialization": true, 18 | "noImplicitThis": true, 19 | "useUnknownInCatchVariables": true, 20 | "alwaysStrict": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "noImplicitReturns": true, 24 | "noFallthroughCasesInSwitch": true, 25 | "allowUnusedLabels": true, 26 | "allowUnreachableCode": true, 27 | "skipLibCheck": true 28 | }, 29 | "include": [ 30 | "./**.ts" 31 | ] 32 | } -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/images/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/images/screen1.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/images/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/images/screen2.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/images/tc-icon128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/images/tc-icon128px.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/images/vss_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/images/vss_default.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/vss_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/vss_default.png -------------------------------------------------------------------------------- /Extensions/TeamCity/Src/vss_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/Extensions/TeamCity/Src/vss_wide.png -------------------------------------------------------------------------------- /Extensions/Terraform/README.md: -------------------------------------------------------------------------------- 1 | # Terraform Extension for Azure DevOps 2 | 3 | The Terraform extension has a new home at https://github.com/microsoft/azure-pipelines-terraform. To report a problem with the Terraform extension, create an issue in that repository. The maintainers of this repository will review and respond to the issue. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © Microsoft Corporation. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /MIT License.txt: -------------------------------------------------------------------------------- 1 | IIS Web App Deployment Using WinRM 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/AzureFunctionAdvancedHandler.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0 4 | v4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | Never 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/AdvancedCheckAsyncConfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/AdvancedCheckAsyncConfig.png -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/AzureFunctionConfiguration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/AzureFunctionConfiguration.png -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/ServiceBusQueue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/ServiceBusQueue.png -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/ServiceBusSharedAccessPolicies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/ServerTaskHelper/AzureFunctionAdvancedHandler/Pictures/ServiceBusSharedAccessPolicies.png -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AzureFunctionAdvancedSample": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7257", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedHandler/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedServiceBusTrigger/AzureFunctionAdvancedServiceBusTrigger.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0 4 | v4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Always 19 | 20 | 21 | PreserveNewest 22 | 23 | 24 | PreserveNewest 25 | Never 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedServiceBusTrigger/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AzureFunctionAdvancedServiceBusTrigger": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7243", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedServiceBusTrigger/README.md: -------------------------------------------------------------------------------- 1 | # Advanced Invoke Azure Function Check Dependency Example 2 | 3 | This advanced example shows how to trigger an Azure Function that checks if an [Azure Boards](https://azure.microsoft.com/products/devops/boards/) work item is in a **Completed** state. 4 | 5 | For more information about the workflow and configuration of this Azure Function, refer to the [README.md file of AzureFunctionAdvancedHandler project](../AzureFunctionAdvancedHandler/README.md). 6 | 7 | # Steps 8 | 9 | The Azure Function goes through the following steps: 10 | 11 | 1. Runs when there is a new a message in the `az-advanced-checks-queue` ServiceBus queue 12 | 2. Checks if the build is completed and stops if it is 13 | 3. Retrieves the Azure Boards work item referenced in the build's commit 14 | 4. Checks if the work item is in the `Completed` state 15 | 5. Sends a status update with the result of the check 16 | 6. If the work item isn't in the `Completed` state, the function reschedules another evaluation in `{ChecksEvaluationPeriodInMinutes}` minutes (by default, 1 minute) 17 | 7. Once the work item is in the correct state, the function sends a positive decision to Azure Pipelines 18 | -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionAdvancedServiceBusTrigger/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionBasicHandler/AzureFunctionBasicHandler.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0 4 | v4 5 | NU1701 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | PreserveNewest 18 | 19 | 20 | PreserveNewest 21 | Never 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionBasicHandler/Pictures/BasicCheckAsyncConfiguration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/ServerTaskHelper/AzureFunctionBasicHandler/Pictures/BasicCheckAsyncConfiguration.png -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionBasicHandler/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AzureFunctionBasicSample": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7013", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionBasicHandler/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionSample/AzureFunctionSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0 4 | v4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | PreserveNewest 20 | 21 | 22 | PreserveNewest 23 | Never 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionSample/MyAppParameters.cs: -------------------------------------------------------------------------------- 1 | namespace AzureFunctionSample 2 | { 3 | internal class MyAppParameters 4 | { 5 | public string TenantId { get; set; } 6 | public string AzureSubscriptionClientId { get; set; } 7 | public string AzureSubscriptionClientSecret { get; set; } 8 | public string ResourceGroupName { get; set; } 9 | public string PipelineAccountName { get; set; } 10 | public string AgentName { get; set; } 11 | public string AgentPoolName { get; set; } 12 | public string PATToken { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /ServerTaskHelper/AzureFunctionSample/readme.md: -------------------------------------------------------------------------------- 1 | ### Sample to create Azure DevOps Pipeline agent using Azure function 2 | 3 | You need to provide following inputs in Azure function task body 4 | 5 | ``` 6 | { 7 | "AzureSubscriptionClientId": "x7de5365-0305-1a2d-531f-2e44a1f9ec37", 8 | "AzureSubscriptionClientSecret": "secret", 9 | "TenantId": "abf9xubf-8aaf1-4134-12ab-2d7cd011db4x", 10 | "ResourceGroupName" : "testaci", 11 | "PipelineAccountName": "testaccount", 12 | "AgentName": "my-test-agent", 13 | "AgentPoolName": "MyTestPool", 14 | "PATToken": "abcedf4y22xamjqb1112315pgf22o4pq21ma3a" // This PAT token used to configure the agent. This PAT token should have permission to configure the agent. 15 | } 16 | ``` -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/DistributedTask.ServerTask.Remote.Common.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | DistributedTask.ServerTask.Remote.Common 6 | NU1701 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/Exceptions/AzureFunctionEvaluationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DistributedTask.ServerTask.Remote.Common.Exceptions 4 | { 5 | public class AzureFunctionEvaluationException : Exception 6 | { 7 | public AzureFunctionEvaluationException() : base() { } 8 | public AzureFunctionEvaluationException(string message) : base(message) { } 9 | public AzureFunctionEvaluationException(string message, Exception innerException) : base(message, innerException) { } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/ITaskExecutionHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using DistributedTask.ServerTask.Remote.Common.Request; 4 | using DistributedTask.ServerTask.Remote.Common.TaskProgress; 5 | using Microsoft.TeamFoundation.DistributedTask.WebApi; 6 | 7 | namespace DistributedTask.ServerTask.Remote.Common 8 | { 9 | public interface ITaskExecutionHandler 10 | { 11 | Task ExecuteAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken); 12 | 13 | void CancelAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken); 14 | } 15 | } -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/Request/RequestType.cs: -------------------------------------------------------------------------------- 1 | namespace DistributedTask.ServerTask.Remote.Common.Request 2 | { 3 | // use this in TaskProperties to determine if the request type is Execute or Cancel and call respective api 4 | public enum RequestType 5 | { 6 | Execute, 7 | Cancel 8 | } 9 | } -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/Request/TaskMessage.cs: -------------------------------------------------------------------------------- 1 | namespace DistributedTask.ServerTask.Remote.Common.Request 2 | { 3 | public class TaskMessage 4 | { 5 | private readonly string taskMessageBody; 6 | private readonly TaskProperties taskProperties; 7 | 8 | public TaskMessage(string taskMessageBody, TaskProperties taskProperties) 9 | { 10 | this.taskMessageBody = taskMessageBody; 11 | this.taskProperties = taskProperties; 12 | } 13 | 14 | public string GetTaskMessageBody() 15 | { 16 | return taskMessageBody; 17 | } 18 | 19 | public TaskProperties GetTaskProperties() 20 | { 21 | return taskProperties; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/ServiceBus/ServiceBusClient.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using System; 3 | using DistributedTask.ServerTask.Remote.Common.Request; 4 | using Microsoft.Azure.ServiceBus; 5 | using Newtonsoft.Json; 6 | 7 | namespace DistributedTask.ServerTask.Remote.Common.ServiceBus 8 | { 9 | public class ServiceBusClient 10 | { 11 | private readonly TaskProperties _taskProperties; 12 | private readonly QueueClient _queueClient; 13 | public ServiceBusClient(TaskProperties taskProperties, ServiceBusSettings serviceBusSettings) 14 | { 15 | _taskProperties = taskProperties; 16 | 17 | _queueClient = new QueueClient(serviceBusSettings.ConnectionString, serviceBusSettings.QueueName); 18 | } 19 | 20 | public long SendScheduledMessageToQueue(int timeSpanInMinutes) 21 | { 22 | var deliveryScheduleTime = DateTime.Now.AddMinutes(timeSpanInMinutes); 23 | var messageBody = JsonConvert.SerializeObject(_taskProperties); 24 | var message = new Message(Encoding.UTF8.GetBytes(messageBody)); 25 | return _queueClient.ScheduleMessageAsync(message, deliveryScheduleTime).Result; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/ServiceBus/ServiceBusSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DistributedTask.ServerTask.Remote.Common.ServiceBus 2 | { 3 | public class ServiceBusSettings 4 | { 5 | public ServiceBusSettings(string connectionString, string queueName) 6 | { 7 | ConnectionString = connectionString; 8 | QueueName = queueName; 9 | } 10 | public string ConnectionString { get; set; } 11 | public string QueueName { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ServerTaskHelper/DistributedTask.ServerTask.Remote.Common/WorkItemProgress/Exceptions/WorkItemNotCompletedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DistributedTask.ServerTask.Remote.Common.WorkItemProgress.Exceptions 4 | { 5 | public class WorkItemNotCompletedException : Exception 6 | { 7 | public WorkItemNotCompletedException() : base() { } 8 | public WorkItemNotCompletedException(string message) : base(message) { } 9 | public WorkItemNotCompletedException(string message, Exception innerException) : base(message, innerException) { } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/Http/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | 3 | namespace HttpRequestHandler.Http 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | BuildWebHost(args).Run(); 10 | } 11 | 12 | public static IWebHost BuildWebHost(string[] args) => 13 | WebHost.CreateDefaultBuilder(args) 14 | .UseStartup() 15 | .Build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/Http/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Server.Kestrel.Core; 2 | 3 | namespace HttpRequestHandler.Http 4 | { 5 | public class Startup 6 | { 7 | public Startup(IConfiguration configuration) 8 | { 9 | Configuration = configuration; 10 | } 11 | 12 | public IConfiguration Configuration { get; } 13 | 14 | // This method gets called by the runtime. Use this method to add services to the container. 15 | public void ConfigureServices(IServiceCollection services) 16 | { 17 | services.AddMvc(options => options.EnableEndpointRouting = false); 18 | 19 | // If using Kestrel: 20 | services.Configure(options => 21 | { 22 | options.AllowSynchronousIO = true; 23 | }); 24 | 25 | // If using IIS: 26 | services.Configure(options => 27 | { 28 | options.AllowSynchronousIO = true; 29 | }); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | 40 | app.UseMvc(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/HttpRequestHandler.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/MyTaskExecutionHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using DistributedTask.ServerTask.Remote.Common; 4 | using DistributedTask.ServerTask.Remote.Common.Request; 5 | using DistributedTask.ServerTask.Remote.Common.TaskProgress; 6 | using Microsoft.TeamFoundation.DistributedTask.WebApi; 7 | using Newtonsoft.Json; 8 | 9 | namespace HttpRequestHandler 10 | { 11 | public class MyTaskExecutionHandler : ITaskExecutionHandler 12 | { 13 | public async Task ExecuteAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken) 14 | { 15 | // get taskmessage 16 | // log some values from object 17 | // return result 18 | var myObject = JsonConvert.DeserializeObject(taskMessage.GetTaskMessageBody()); 19 | 20 | var message = $"Hello {myObject.Name}"; 21 | await taskLogger.Log(message).ConfigureAwait(false); 22 | 23 | return await Task.FromResult(TaskResult.Succeeded); 24 | } 25 | 26 | public void CancelAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken) 27 | { 28 | } 29 | } 30 | 31 | public class MyTaskObject 32 | { 33 | public string Name { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:57636/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "launchUrl": "api/mytask", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestHandler/readme.md: -------------------------------------------------------------------------------- 1 | ### This is a sample app demonstrates how to plugin an execution handler for a HttpRequest server task using DistributedTask.ServerTask.Remote.Common library. 2 | 3 | #### Sample app does the following: 4 | 1. Recieve VSTS Task related properties in Http request headers 5 | 2. Recieve your object in Http request body 6 | 3. Implement my own `ITaskExecutionHandler`, `MyTaskExecutionHandler`, which deserialize the input object and log a message to VSTS using TaskLogger. 7 | 4. Initialize `ExecutionHandler` providing `MyTaskExecutionHandler` object, messageBody and taskProperties as input 8 | 5. Invoke `ExecutionHandler.Execute` in a new thread, to make it run asynchronously. 9 | 10 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestSampleWithoutHandler/Http/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | 3 | namespace HttpRequestSampleWithoutHandler.Http 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | BuildWebHost(args).Run(); 10 | } 11 | 12 | public static IWebHost BuildWebHost(string[] args) => 13 | WebHost.CreateDefaultBuilder(args) 14 | .UseStartup() 15 | .Build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestSampleWithoutHandler/Http/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Server.Kestrel.Core; 2 | 3 | namespace HttpRequestSampleWithoutHandler.Http 4 | { 5 | public class Startup 6 | { 7 | public Startup(IConfiguration configuration) 8 | { 9 | Configuration = configuration; 10 | } 11 | 12 | public IConfiguration Configuration { get; } 13 | 14 | // This method gets called by the runtime. Use this method to add services to the container. 15 | public void ConfigureServices(IServiceCollection services) 16 | { 17 | services.AddMvc(options => options.EnableEndpointRouting = false); 18 | 19 | // If using Kestrel: 20 | services.Configure(options => 21 | { 22 | options.AllowSynchronousIO = true; 23 | }); 24 | 25 | // If using IIS: 26 | services.Configure(options => 27 | { 28 | options.AllowSynchronousIO = true; 29 | }); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | 40 | app.UseMvc(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestSampleWithoutHandler/HttpRequestSampleWithoutHandler.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ServerTaskHelper/HttpRequestSampleWithoutHandler/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:57636/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "launchUrl": "api/mytask", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/MyTaskExecutionHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using DistributedTask.ServerTask.Remote.Common; 4 | using DistributedTask.ServerTask.Remote.Common.Request; 5 | using DistributedTask.ServerTask.Remote.Common.TaskProgress; 6 | using Microsoft.TeamFoundation.DistributedTask.WebApi; 7 | using Newtonsoft.Json; 8 | 9 | namespace ServiceBusMessageHandler 10 | { 11 | public class MyTaskExecutionHandler : ITaskExecutionHandler 12 | { 13 | public async Task ExecuteAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken) 14 | { 15 | // get taskmessage 16 | // log some values from object 17 | // return result 18 | var myObject = JsonConvert.DeserializeObject(taskMessage.GetTaskMessageBody()); 19 | 20 | var message = $"Hello {myObject.Name}"; 21 | await taskLogger.Log(message).ConfigureAwait(false); 22 | 23 | return await Task.FromResult(TaskResult.Succeeded); 24 | } 25 | 26 | public void CancelAsync(TaskMessage taskMessage, TaskLogger taskLogger, CancellationToken cancellationToken) 27 | { 28 | } 29 | } 30 | 31 | public class MyTaskObject 32 | { 33 | public string Name { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using ServiceBusMessageHandler.ServiceBus; 3 | 4 | namespace ServiceBusMessageHandler 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | var configBuilder = new ConfigurationBuilder(); 11 | var config = configBuilder.AddJsonFile("appsettings.json").Build(); 12 | 13 | var serviceBusSettings = new ServiceBusSettings 14 | { 15 | ConnectionString = config.GetSection("ServiceBus:ConnectionString").Value, 16 | QueueName = config.GetSection("ServiceBus:QueueName").Value, 17 | }; 18 | 19 | var myHandler = new MyTaskExecutionHandler(); 20 | var listener = new ServiceBusMessageListener(serviceBusSettings, myHandler); 21 | 22 | Console.WriteLine( 23 | "Starting the VSTS request listener on queue '{0}'", serviceBusSettings.QueueName); 24 | 25 | listener.Start(); 26 | 27 | Console.WriteLine("Press any key to exit after receiving all the messages ..."); 28 | 29 | Console.ReadKey(); 30 | 31 | listener.Stop(); 32 | Console.WriteLine("Shutting down VSTS request listener ..."); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/ServiceBus/ServiceBusSettings.cs: -------------------------------------------------------------------------------- 1 | namespace ServiceBusMessageHandler.ServiceBus 2 | { 3 | public class ServiceBusSettings 4 | { 5 | public string ConnectionString { get; set; } 6 | public string QueueName { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/ServiceBusMessageHandler.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ServiceBus": { 3 | "ConnectionString": "", 4 | "QueueName": "" 5 | }, 6 | "Vsts": { 7 | "SubscriptionName": "Subscription", 8 | "ReleaseHubName": "release" 9 | } 10 | } -------------------------------------------------------------------------------- /ServerTaskHelper/ServiceBusMessageHandler/readme.md: -------------------------------------------------------------------------------- 1 | ### This is a sample app demonstrates how to plugin an execution handler for a ServiceBus server task using DistributedTask.ServerTask.Remote.Common library. 2 | 3 | #### Sample app does the following: 4 | 1. Implement my own `ITaskExecutionHandler`, `MyTaskExecutionHandler`, which deserialize the input object and log a message to VSTS using TaskLogger. 5 | 2. Read service bus settings, connection string and queue name from appsettings.json. 6 | 3. Initialize `ServiceBusMessageListener` providing service bus settings and my task execution handler as inputs. 7 | 4. Register message handler using `QueueClient.RegisterMessageHandler` 8 | 5. On receiving service bus message, initialize `ExecutionHandler` providing my task execution handler, service bus message body and message properties. 9 | 6. Call `ExecutionHandler.Execute` method 10 | 7. on completion of `Execute`, call `QueueClient.CompleteAsync` so that service bus message will be marked as processed and deleted. 11 | -------------------------------------------------------------------------------- /ServerTaskHelper/VstsServerTaskHelper.SampleClient/SampleServiceBusMessageBody.txt: -------------------------------------------------------------------------------- 1 | Sample Message body: 2 | 3 | { 4 | "JobId": "$(system.jobId)", 5 | "PlanId": "$(system.planId)", 6 | "scheduleBuildRequesterAlias": "$(scheduleBuildRequesterAlias)", 7 | "requesterEmail": "$(Release.requestedForEmail)", 8 | "requesterName": "$(Release.requestedFor)", 9 | "requesterId": "$(Release.requestedForId)", 10 | "TimelineId": "$(system.timelineId)", 11 | "ProjectId": "$(system.teamProjectId)", 12 | "VstsUrl": "$(system.CollectionUri)", 13 | "AuthToken": "$(system.AccessToken)", 14 | "ReleaseProperties": { 15 | "ReleaseId": "$(Release.releaseId)", 16 | "ReleaseName": "$(Release.releaseName)", 17 | "ReleaseDefinitionName": "$(Release.definitionName)", 18 | "ReleaseEnvironmentName": "$(Release.environmentName)", 19 | "ReleaseEnvironmentUri": "$(release.environmentUri)", 20 | "ReleaseUri": "$(release.releaseUri)" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | ## TODO 2 | 1. Add the following capabilities to Fetch Engine 3 | - [x] parallization 4 | - [x] retry 5 | - [x] partial download 6 | - [x] level by level download 7 | - [ ] logging 8 | - [ ] cancellation 9 | - [ ] incremental download 10 | 11 | 2. Implement the following providers 12 | - [x] web provider 13 | - [ ] fileshare provider 14 | - [x] stub provider for testing 15 | 16 | 3. Add the webprovider templates for the following services 17 | - [x] Jenkins 18 | - [x] Teamcity 19 | - [x] External Build 20 | 21 | 4. Add tests 22 | - [x] Setup testing framework 23 | - [ ] Add fetch engine tests 24 | 25 | 5. Others 26 | - [ ] Publish package to npm gallery 27 | - [ ] Setup CI 28 | - [ ] Support proxy 29 | - [ ] Enable localization 30 | -------------------------------------------------------------------------------- /TaskModules/powershell/Publish-PSModule.ps1: -------------------------------------------------------------------------------- 1 | param([string] $baseDirectory, 2 | [string] $nugetAPIKey) 3 | 4 | $subDirectories = Get-ChildItem -Directory $baseDirectory 5 | 6 | foreach($directory in $subDirectories) { 7 | 8 | try{ 9 | $directoryName = $directory.Name 10 | Publish-Module -Path "$baseDirectory\$directoryName" -NuGetApiKey $nugetAPIKey 11 | } 12 | catch{ 13 | Write-Warning $_.Exception 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TaskModules/powershell/RemoteDeployer/Strings/resources.resjson/en-US/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.RemoteDeployer_ConnectedMachines": "PSSession created for Machines:'{0}'", 3 | "loc.messages.RemoteDeployer_NotConnectedMachines": "PSSession could not be created for Machine:'{0}:{1}'", 4 | "loc.messages.RemoteDeployer_ScriptJobFailed": "Execution of remote script job failed. ComputerName: '{0}', Message: '{1}'", 5 | "loc.messages.RemoteDeployer_NonZeroExitCode": "Non-Zero exit code: '{1}' for ComputerName: '{0}'", 6 | "loc.messages.RemoteDeployer_ScriptExecutionSucceeded": "Script execution succeeded for ComputerName: '{0}'", 7 | "loc.messages.RemoteDeployer_UnknownStatus": "Unknown remote script job execution status: '{0}'", 8 | "loc.messages.RemoteDeployer_UnableToGetRemoteJobResults": "Unable to get remote script job results", 9 | "loc.messages.PS_TM_UnableToCreatePSSession": "Unable to create pssession. Error: '{0}'", 10 | "loc.messages.RemoteDeployer_JobResultEvaluationFailure": "Atleast one remote job failed. Consult logs for more details. ErrorCodes(s): '{0}'", 11 | "loc.messages.RemoteDeployer_UnableToUploadTargetMachineLogs": "Unable to upload target machine logs files. SourceFolder: '{0}'. Error: '{1}'" 12 | } -------------------------------------------------------------------------------- /TaskModules/powershell/RemoteDeployer/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "RemoteDeployer_ConnectedMachines" : "PSSession created for Machines:'{0}'", 4 | "RemoteDeployer_NotConnectedMachines" : "PSSession could not be created for Machine:'{0}:{1}'", 5 | "RemoteDeployer_ScriptJobFailed" : "Execution of remote script job failed. ComputerName: '{0}', Message: '{1}'", 6 | "RemoteDeployer_NonZeroExitCode" : "Non-Zero exit code: '{1}' for ComputerName: '{0}'", 7 | "RemoteDeployer_ScriptExecutionSucceeded": "Script execution succeeded for ComputerName: '{0}'", 8 | "RemoteDeployer_UnknownStatus": "Unknown remote script job execution status: '{0}'", 9 | "RemoteDeployer_UnableToGetRemoteJobResults" : "Unable to get remote script job results", 10 | "PS_TM_UnableToCreatePSSession": "Unable to create pssession. Error: '{0}'", 11 | "RemoteDeployer_JobResultEvaluationFailure": "Atleast one remote job failed. Consult logs for more details. ErrorCodes(s): '{0}'", 12 | "RemoteDeployer_UnableToUploadTargetMachineLogs": "Unable to upload target machine logs files. SourceFolder: '{0}'. Error: '{1}'" 13 | } 14 | } -------------------------------------------------------------------------------- /TaskModules/powershell/RemoteDeployer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Sanitizer.psm1: -------------------------------------------------------------------------------- 1 | # Override the DebugPreference. 2 | if ($global:DebugPreference -eq 'Continue') { 3 | Write-Verbose '$OVERRIDING $global:DebugPreference from ''Continue'' to ''SilentlyContinue''.' 4 | $global:DebugPreference = 'SilentlyContinue' 5 | } 6 | 7 | # Import the loc strings. 8 | Import-VstsLocStrings -LiteralPath $PSScriptRoot/module.json 9 | 10 | # Don't source the private functions. 11 | . $PSScriptRoot/ArgumentsSanitizer.ps1 12 | 13 | # Export public functions. 14 | Export-ModuleMember -Function Get-SanitizerFeatureFlags 15 | Export-ModuleMember -Function Get-SanitizerCallStatus 16 | Export-ModuleMember -Function Get-SanitizerActivateStatus 17 | Export-ModuleMember -Function Protect-ScriptArguments -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/de-DE/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/en-US/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | "loc.messages.PS_ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`). More information is available here: https://aka.ms/ado/75787", 3 | "loc.messages.PS_ScriptArgsNotSanitized": "Arguments passed sanitization without change." 4 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/es-ES/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/fr-FR/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/it-IT/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/ja-JP/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/ko-KR/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/ru-RU/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/zh-CN/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Strings/resources.resjson/zh-TW/resources.resjson: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Get-SanitizedArgumentsArray.DoesNotBreakExistingBashFormats.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 6 | 7 | # Arrange 8 | 9 | $bashArgumentsFormats = @( 10 | "-parameter", # Single hyphen followed by a single letter or digit (POSIX style) 11 | "-parameter value", # When the parameter needs a value 12 | "--parameter", # Double hyphen followed by a word (GNU style) 13 | "--parameter=value", # Value directly attached to the parameter with an equals sign 14 | "parameter=value", # Used to pass environment variables to a command 15 | "parameter value.txt" # Argument with dot in the middle 16 | ) 17 | 18 | foreach ($argument in $bashArgumentsFormats) { 19 | 20 | # Act 21 | $sanitizedArguments = Get-SanitizedArguments -InputArgs $argument 22 | 23 | # Assert 24 | Assert-AreEqual -Actual $sanitizedArguments -Expected $argument 25 | } 26 | -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Get-SanitizedArgumentsArray.DoesNotBreakExistingCmdFormats.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 6 | 7 | # Arrange 8 | 9 | $cmdArgumentsFormats = @( 10 | "/parameter", # Traditional way to pass parameters in CMD 11 | "-parameter", # Modern applications accept parameters with a hyphen 12 | "--parameter", # Many modern applications accept parameters with double hyphen 13 | "parameter=value", # Format for passing values to parameters 14 | "parameter value.txt" # Argument with dot in the middle 15 | ) 16 | 17 | foreach ($argument in $cmdArgumentsFormats) { 18 | 19 | # Act 20 | $sanitizedArguments = Get-SanitizedArguments -InputArgs $argument 21 | 22 | # Assert 23 | Assert-AreEqual -Actual $sanitizedArguments -Expected $argument 24 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Get-SanitizedArgumentsArray.DoesNotBreakExistingPowerShellFormats.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 6 | 7 | # Arrange 8 | 9 | $powershellArgumentsFormats = @( 10 | "-Parameter Value", # Most common form 11 | "-Parameter:Value", # Colon connects the parameter and its value 12 | "/p:Parameter=Value", # Specific syntax for tools like MSBuild or NuGet 13 | "--Parameter Value", # Used by cmdlets or scripts for cross-platform compatibility 14 | "--Parameter=Value", # Used by cross-platform tools 15 | "parameter value.txt" # Argument with dot in the middle 16 | ) 17 | 18 | foreach ($argument in $powershellArgumentsFormats) { 19 | 20 | # Act 21 | $sanitizedArguments = Get-SanitizedArguments -InputArgs $argument 22 | 23 | # Assert 24 | Assert-AreEqual -Actual $sanitizedArguments -Expected $argument 25 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Get-SanitizedArgumentsArray.ReplacesForbiddenCharacters.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 6 | 7 | # Arrange 8 | 9 | $arguments = "start notepad.exe | echo 'hello' ; calc.exe" 10 | 11 | # Act 12 | 13 | $sanitizedArguments = Get-SanitizedArguments -InputArgs $arguments 14 | 15 | # Assert 16 | 17 | # We need to use $sanitizedArguments[1] because $sanitizedArguments contains buffer with Write-Output message from the function execution. 18 | Assert-AreEqual -Expected "start notepad.exe _#removed#_ echo 'hello' _#removed#_ calc.exe" -Actual $sanitizedArguments 19 | -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Protect-ScriptArguments.Throws.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | Set-Item -Path env:AZP_75787_ENABLE_NEW_LOGIC -Value 'true' 5 | 6 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 7 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 8 | 9 | $inputArgsSuites = @( 10 | 'test; whoami', 11 | 'test && whoami', 12 | 'echo "$(rm ./somedir)"', 13 | 'test | whoami' 14 | ) 15 | 16 | $expectedMsg = Get-VstsLocString -Key 'PS_ScriptArgsSanitized' 17 | 18 | foreach ($inputArgs in $inputArgsSuites) { 19 | Assert-Throws { 20 | Protect-ScriptArguments $inputArgs 21 | } -MessagePattern $expectedMsg 22 | } 23 | -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/Tests/L0Split-Arguments.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param() 3 | 4 | . $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 5 | . $PSScriptRoot\..\ArgumentsSanitizer.ps1 6 | 7 | # Arrange 8 | 9 | $someString = "some string" 10 | 11 | $argumentsFormats = @( 12 | "", # Empty string 13 | " ", # Single space 14 | "/parameter", # Single word 15 | "/parameter1 /parameter2", # Multiple words separated by space 16 | "/parameter1 '/path/my file.txt'", # Argument with spaces in quotes 17 | "/parameter1 '/path/my file.txt' /parameter2 'value with spaces'", # Complex example 18 | "/parameter1 `"$someString`"" # Argument with variable in quotes 19 | ) 20 | 21 | $expectedOutputs = @( 22 | @(), 23 | @(), 24 | @("/parameter"), 25 | @("/parameter1", "/parameter2"), 26 | @("/parameter1", "/path/my file.txt"), 27 | @("/parameter1", "/path/my file.txt", "/parameter2", "value with spaces"), 28 | @("/parameter1", "some string") 29 | ) 30 | 31 | for ($i = 0; $i -lt $argumentsFormats.Length; $i++) { 32 | # Act 33 | [string[]]$splitArguments = Split-Arguments -arguments $argumentsFormats[$i] 34 | 35 | # Assert 36 | Assert-AreEqual -Expected $splitArguments -Actual $expectedOutputs[$i] 37 | } 38 | -------------------------------------------------------------------------------- /TaskModules/powershell/Sanitizer/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "PS_ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`). More information is available here: https://aka.ms/ado/75787", 4 | "PS_ScriptArgsNotSanitized": "Arguments passed sanitization without change." 5 | } 6 | } -------------------------------------------------------------------------------- /TaskModules/powershell/TaskModuleIISManageUtility/TaskModuleIISManageUtility.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | RootModule = 'TaskModuleIISManageUtility.psm1' 3 | ModuleVersion = '0.1.9' 4 | GUID = '61fa1dac-d205-4cc7-a24f-502a8f461576' 5 | Author = 'Microsoft' 6 | CompanyName = 'Microsoft' 7 | Copyright = '(c) 2015 Microsoft. All rights reserved.' 8 | Description = 'TaskModule IIS Manage Utility' 9 | PowerShellVersion = '3.0' 10 | FunctionsToExport = '*' 11 | CmdletsToExport = '' 12 | VariablesToExport = '' 13 | AliasesToExport = '' 14 | PrivateData = @{ 15 | PSData = @{ 16 | ProjectUri = 'https://github.com/Microsoft/azure-pipelines-extensions' 17 | CommitHash = '_COMMIT_HASH_' # Do not modify. This value gets replaced at build time. 18 | } 19 | } 20 | HelpInfoURI = 'https://github.com/Microsoft/azure-pipelines-extensions' 21 | DefaultCommandPrefix = '' 22 | } 23 | -------------------------------------------------------------------------------- /TaskModules/powershell/TaskModuleIISManageUtility/TaskModuleIISManageUtility.psm1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param( 3 | [ValidateNotNull()] 4 | [Parameter()] 5 | [hashtable]$ModuleParameters = @{ }) 6 | 7 | if ($host.Name -ne 'ConsoleHost') { 8 | Write-Warning "TaskModuleIISManageUtility is designed for use with powershell.exe (ConsoleHost). Output may be different when used with other hosts." 9 | } 10 | 11 | # Private module variables. 12 | [bool]$script:nonInteractive = "$($ModuleParameters['NonInteractive'])" -eq 'true' 13 | Write-Verbose "NonInteractive: $script:nonInteractive" 14 | 15 | # Import/export functions. 16 | . "$PSScriptRoot\AppCmdOnTargetMachines.ps1" 17 | 18 | Export-ModuleMember -Function @( 19 | 'Invoke-Main' 20 | ) 21 | 22 | # Special internal exception type to control the flow. Not currently intended 23 | # for public usage and subject to change. If the type has already 24 | # been loaded once, then it is not loaded again. 25 | Write-Verbose "Adding exceptions types." 26 | Add-Type -WarningAction SilentlyContinue -Debug:$false -TypeDefinition @' 27 | namespace TaskModuleIISManageUtility 28 | { 29 | public class TerminationException : System.Exception 30 | { 31 | public TerminationException(System.String message) : base(message) { } 32 | } 33 | } 34 | '@ 35 | -------------------------------------------------------------------------------- /TaskModules/powershell/TaskModuleSqlUtility/TaskModuleSqlUtility.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | RootModule = 'TaskModuleSqlUtility.psm1' 3 | ModuleVersion = '0.1.3' 4 | GUID = 'd997c6dd-33ad-481c-859b-01120229b91f' 5 | Author = 'Microsoft' 6 | CompanyName = 'Microsoft' 7 | Copyright = '(c) 2015 Microsoft. All rights reserved.' 8 | Description = 'TaskModule SqlUtility' 9 | PowerShellVersion = '3.0' 10 | FunctionsToExport = '*' 11 | CmdletsToExport = '' 12 | VariablesToExport = '' 13 | AliasesToExport = '' 14 | PrivateData = @{ 15 | PSData = @{ 16 | ProjectUri = 'https://github.com/Microsoft/azure-pipelines-extensions' 17 | CommitHash = '_COMMIT_HASH_' # Do not modify. This value gets replaced at build time. 18 | } 19 | } 20 | HelpInfoURI = 'https://github.com/Microsoft/azure-pipelines-extensions' 21 | DefaultCommandPrefix = '' 22 | } -------------------------------------------------------------------------------- /TaskModules/powershell/TaskModuleSqlUtility/TaskModuleSqlUtility.psm1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param( 3 | [ValidateNotNull()] 4 | [Parameter()] 5 | [hashtable]$ModuleParameters = @{ }) 6 | 7 | if ($host.Name -ne 'ConsoleHost') { 8 | Write-Warning "TaskModuleSqlUtility is designed for use with powershell.exe (ConsoleHost). Output may be different when used with other hosts." 9 | } 10 | 11 | # Private module variables. 12 | [bool]$script:nonInteractive = "$($ModuleParameters['NonInteractive'])" -eq 'true' 13 | Write-Verbose "NonInteractive: $script:nonInteractive" 14 | 15 | # Import/export functions. 16 | . "$PSScriptRoot\SqlPackageOnTargetMachines.ps1" 17 | . "$PSScriptRoot\SqlQueryOnTargetMachines.ps1" 18 | 19 | Export-ModuleMember -Function @( 20 | 'Invoke-SqlQueryDeployment', 21 | 'Invoke-DacpacDeployment' 22 | ) 23 | 24 | # Special internal exception type to control the flow. Not currently intended 25 | # for public usage and subject to change. If the type has already 26 | # been loaded once, then it is not loaded again. 27 | Write-Verbose "Adding exceptions types." 28 | Add-Type -WarningAction SilentlyContinue -Debug:$false -TypeDefinition @' 29 | namespace TaskModuleSqlUtility 30 | { 31 | public class TerminationException : System.Exception 32 | { 33 | public TerminationException(System.String message) : base(message) { } 34 | } 35 | } 36 | '@ 37 | -------------------------------------------------------------------------------- /TaskModules/powershell/Tests/TaskModuleIISManageUtility/MockHelpers.ps1: -------------------------------------------------------------------------------- 1 | ## Helper for global mock functions 2 | 3 | Register-Mock Get-AppCmdLocation { 4 | return "appcmdPath", 8 5 | } 6 | 7 | function Get-MockCredentials { 8 | $username = "domain\name" 9 | $password = 'random!123`"$password' 10 | 11 | $securePass = New-Object System.Security.SecureString 12 | ForEach ($ch in $password.ToCharArray()) { $securePass.appendChar($ch) } 13 | $authCredentials = New-Object System.Management.Automation.PSCredential($username, $securePass) 14 | return $authCredentials 15 | } -------------------------------------------------------------------------------- /TaskModules/powershell/Tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /base.tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "skipLibCheck": true 6 | } 7 | } -------------------------------------------------------------------------------- /docs/authoring/images/artifactItems.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/artifactItems.PNG -------------------------------------------------------------------------------- /docs/authoring/images/artifacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/artifacts.png -------------------------------------------------------------------------------- /docs/authoring/images/artifacturls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/artifacturls.png -------------------------------------------------------------------------------- /docs/authoring/images/browseartifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/browseartifact.png -------------------------------------------------------------------------------- /docs/authoring/images/commits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/commits.png -------------------------------------------------------------------------------- /docs/authoring/images/createrelease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/createrelease.png -------------------------------------------------------------------------------- /docs/authoring/images/defaultversion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/defaultversion.png -------------------------------------------------------------------------------- /docs/authoring/images/downloadtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/downloadtask.png -------------------------------------------------------------------------------- /docs/authoring/images/linkartifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/linkartifact.png -------------------------------------------------------------------------------- /docs/authoring/images/releaselogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/releaselogs.png -------------------------------------------------------------------------------- /docs/authoring/images/workitems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/azure-pipelines-extensions/f9fbe4510bebc6ee5fabc1024ae0787b0b81b7cd/docs/authoring/images/workitems.png -------------------------------------------------------------------------------- /externals.json: -------------------------------------------------------------------------------- 1 | { 2 | "npm": { 3 | "vsts-task-lib": "2.2.1" 4 | }, 5 | "nugetv2": { 6 | "VstsTaskSdk": { 7 | "version": "0.7.1", 8 | "repository": "https://www.powershellgallery.com/api/v2/" 9 | } 10 | }, 11 | "no-cache": [ 12 | "Ansible", 13 | "DownloadCircleCIArtifacts", 14 | "DownloadTeamCityArtifacts", 15 | "DownloadExternalBuildArtifacts", 16 | "DownloadArtifactsTfsVersionControl", 17 | "DownloadArtifactsTfsGit", 18 | "DownloadArtifactsBitbucket", 19 | "OptimizelyX", 20 | "CopyAgentJobVariableToReleaseVariable" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /scripts/DetermineCiTestPipelineName.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Parameter(Mandatory = $true)] 3 | [string]$ExtensionName, 4 | 5 | # Name of the variable to set in the pipeline 6 | [string]$AdoVariableName = 'TARGET_PIPELINE_NAME' 7 | ) 8 | 9 | $ErrorActionPreference = 'Stop' 10 | 11 | switch ($ExtensionName) { 12 | 'Ansible' { $pipelineName = 'AzDev-ReleaseManagement-Ansible-CI-Test' } 13 | 'BitBucket' { $pipelineName = 'AzDev-ReleaseManagement-BitBucket-CI-Test' } 14 | 'ExternalTfs' { $pipelineName = 'AzDev-ReleaseManagement-ExternalTFS-CI-Test' } 15 | 'IISWebAppDeploy' { $pipelineName = 'AzDev-ReleaseManagement-IIS-Test' } 16 | default { 17 | throw "Pipeline name can't be determined for extension '$ExtensionName'. Update the mapping." 18 | } 19 | } 20 | 21 | Write-Host "Mapping: $ExtensionName -> $pipelineName" 22 | # Make it available to later steps in the job 23 | Write-Host "##vso[task.setvariable variable=$AdoVariableName;]$pipelineName" 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "sourceMap": false, 7 | "allowJs": true, 8 | "checkJs": true, 9 | "noEmit": true, 10 | "noEmitOnError": false, 11 | "forceConsistentCasingInFileNames": true, 12 | "strict": true, 13 | "noImplicitAny": true, 14 | "strictNullChecks": true, 15 | "strictFunctionTypes": true, 16 | "strictBindCallApply": true, 17 | "strictPropertyInitialization": true, 18 | "noImplicitThis": true, 19 | "alwaysStrict": true, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "noImplicitReturns": true, 23 | "noFallthroughCasesInSwitch": true, 24 | "allowUnusedLabels": true, 25 | "allowUnreachableCode": true, 26 | "skipLibCheck": true, 27 | "resolveJsonModule": true, 28 | "useUnknownInCatchVariables": false 29 | }, 30 | "files": [ 31 | "gulpfile.js", 32 | "package.js", 33 | "package-utils.js" 34 | ] 35 | } --------------------------------------------------------------------------------