Skip to content

Commit

Permalink
8.0.17 Changed Package Deployer Task/Scripts to use ConnectionString.…
Browse files Browse the repository at this point in the history
… This now works with the Hosted VSTS Agent.
  • Loading branch information
WaelHamze committed Feb 25, 2017
1 parent bd10ce0 commit 045c95e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 134 deletions.
2 changes: 1 addition & 1 deletion CRM365/Xrm.Framework.CI/PackageFramework.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# PackageFramework.ps1
#

$version = "8.0.0"
$version = "8.0.17"

Write-Host "Packaging xRM CI Framework $version"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
#

param(
[string]$DeploymentType,
[string]$Username,
[string]$Password,
[string]$ServerUrl,
[string]$OrganizationName,
[string]$DeploymentRegion,
[string]$OnlineType,
[string]$CrmConnectionString,
[string]$PackageName,
[string]$PackageDirectory
)
Expand All @@ -19,13 +13,7 @@ $ErrorActionPreference = "Stop"
Write-Verbose 'Entering DeployPackage.ps1'

#Parameters
Write-Verbose "DeploymentType = $DeploymentType"
Write-Verbose "Username = $Username"
Write-Verbose "Password = ******"
Write-Verbose "ServerUrl = $ServerUrl"
Write-Verbose "OrganizationName = $OrganizationName"
Write-Verbose "DeploymentRegion = $DeploymentRegion"
Write-Verbose "OnlineType = $OnlineType"
Write-Verbose "CrmConnectionString = $CrmConnectionString"
Write-Verbose "PackageName = $PackageName"
Write-Verbose "PackageDirectory = $PackageDirectory"

Expand All @@ -46,17 +34,9 @@ Write-Verbose "Importing: $crmToolingDeployment"
Import-Module $crmToolingDeployment
Write-Verbose "Imported: $crmToolingDeployment"

#Create Credentials
$SecPassword = ConvertTo-SecureString $Password -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ($Username, $SecPassword)

#Create Connection

switch($DeploymentType)
{
"Onpremises" { $CRMConn = Get-CrmConnection -ServerUrl $ServerUrl -OrganizationName $OrganizationName -Credential $Cred -Verbose}
"Online" { $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion $DeploymentRegion –OnlineType $OnlineType –OrganizationName $OrganizationName -Verbose}
}
$CRMConn = Get-CrmConnection -ConnectionString $CrmConnectionString -Verbose

#Deploy Package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if ($override -or ($solution -eq $null) -or ($solution.Version -ne $solutionInfo
}
}

$importJob = Get-XrmSolutionImportLog -ImportJobId $importJobId -ConnectionString $CrmConnectionString -OutputFile "$importLogFile"
$importJob = Get-XrmSolutionImportLog -ImportJobId $importJobId -ConnectionString "$CrmConnectionString" -OutputFile "$importLogFile"

$importProgress = $importJob.Progress
$importResult = (Select-Xml -Content $importJob.Data -XPath "//solutionManifest/result/@result").Node.Value
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

This will allow you to setup a fully automated DevOps pipeline so you can deliver CRM more frequently in a consistent and reliable way.

The latest version of all tasks work on the VSTS Hosted Agent.

## Task Catalog

Below is a list of tasks that is included with the xRM CI Framework
Expand Down Expand Up @@ -35,4 +37,8 @@ Below is a sample release definition that imports the solution generated from th

## More Information

For more documentation and source code, check out Github using the links on this page
For more documentation and source code, check out Github using the links on this page.

## Version History

For information on changes between versions, check the commits on GitHub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "xrm-ci-framework-build-tasks",
"name": "Dynamics CRM Build Tools",
"version": "8.0.16",
"version": "8.0.17",
"publisher": "WaelHamze",
"targets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,15 @@ $ErrorActionPreference = "Stop"
Write-Verbose 'Entering MSCRMPackageDeployer.ps1'

#Get Parameters
$deploymentType= Get-VstsInput -Name deploymentType -Require
$username = Get-VstsInput -Name username -Require
$password = Get-VstsInput -Name password -Require
$serverUrl = Get-VstsInput -Name serverUrl
$organizationName = Get-VstsInput -Name organizationName
$deploymentRegion = Get-VstsInput -Name deploymentRegion
$onlineType = Get-VstsInput -Name onlineType
$crmConnectionString = Get-VstsInput -Name crmConnectionString -Require
$packageName = Get-VstsInput -Name packageName -Require
$packageDirectory = Get-VstsInput -Name packageDirectory -Require

#TFS Release Parameters
$artifactsFolder = $env:AGENT_RELEASEDIRECTORY

#Print Verbose
Write-Verbose "deploymentType = $deploymentType"
Write-Verbose "username = $username"
Write-Verbose "password = ******"
Write-Verbose "serverUrl = $serverUrl"
Write-Verbose "organizationName = $organizationName"
Write-Verbose "deploymentRegion = $deploymentRegion"
Write-Verbose "onlineType = $onlineType"
Write-Verbose "crmConnectionString = $crmConnectionString"
Write-Verbose "packageName = $packageName"
Write-Verbose "packageDirectory = $packageDirectory"
Write-Verbose "artifactsFolder = $artifactsFolder"
Expand All @@ -36,6 +24,6 @@ Write-Verbose "artifactsFolder = $artifactsFolder"
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Write-Verbose "Script Path: $scriptPath"

& "$scriptPath\ps_modules\xRMCIFramework\DeployPackage.ps1" -DeploymentType $deploymentType -Username $username -Password $password -ServerUrl $serverUrl -OrganizationName $organizationName -DeploymentRegion $deploymentRegion -OnlineType $onlineType -PackageName $packageName -PackageDirectory $packageDirectory
& "$scriptPath\ps_modules\xRMCIFramework\DeployPackage.ps1" -CrmConnectionString $crmConnectionString -PackageName $packageName -PackageDirectory $packageDirectory

Write-Verbose 'Leaving MSCRMPackageDeployer.ps1'
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
"demands": [ ],
"version": {
"Major": "8",
"Minor": "0",
"Patch": "4"
"Minor": "1",
"Patch": "1"
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "MSCRM Package Deployer: $(packageName)",
"groups": [
{
"name": "crmConnection",
"displayName": "Crm Connection",
"isExpanded": true
}
],
"inputs": [
{
"name": "crmConnectionString",
"type": "string",
"label": "CRM Connection String",
"defaultValue": "",
"required": true,
"helpMarkDown": "For more information on format: https://msdn.microsoft.com/en-gb/library/mt608573.aspx"
},
{
"name": "packageName",
"type": "string",
Expand All @@ -41,89 +42,6 @@
"defaultValue": "$(System.DefaultWorkingDirectory)/<BuildName>/<ArtifactName>/<PackageFolder>",
"required": false,
"helpMarkDown": "The absolute path to the CRM Package folder on the release agent machine"
},
{
"name": "deploymentType",
"type": "pickList",
"label": "Deployment Type",
"defaultValue": "Online",
"required": true,
"helpMarkDown": "The CRM deployment type",
"options": {
"Online": "Online",
"Onpremises": "On-premises"
},
"groupName": "crmConnection"
},
{
"name": "username",
"type": "string",
"label": "Username",
"defaultValue": "",
"required": true,
"helpMarkDown": "The Dynamics CRM username",
"groupName": "crmConnection"
},
{
"name": "password",
"type": "string",
"label": "Password",
"defaultValue": "",
"required": true,
"helpMarkDown": "The password used to connect to Dynamics CRM",
"groupName": "crmConnection"
},
{
"name": "serverUrl",
"type": "string",
"label": "Server Url",
"defaultValue": "",
"required": true,
"helpMarkDown": "The CRM server url to your on-premises instance. e.g. http://<your_CRM_Server>",
"visibleRule": "deploymentType = Onpremises",
"groupName": "crmConnection"
},
{
"name": "organizationName",
"type": "string",
"label": "Organization Name",
"defaultValue": "",
"required": true,
"helpMarkDown": "The CRM organization name",
"groupName": "crmConnection"
},
{
"name": "deploymentRegion",
"type": "pickList",
"label": "Deployment Region",
"defaultValue": "EMEA",
"required": true,
"helpMarkDown": "The CRM online deployment region",
"options": {
"NorthAmerica": "NorthAmerica",
"EMEA": "EMEA",
"APAC": "APAC",
"SouthAmerica": "SouthAmerica",
"Oceania": "Oceania",
"JPN": "JPN",
"NorthAmerica2": "NorthAmerica2"
},
"visibleRule": "deploymentType = Online",
"groupName": "crmConnection"
},
{
"name": "onlineType",
"type": "pickList",
"label": "Online Type",
"defaultValue": "Office365",
"required": true,
"helpMarkDown": "The type of CRM online authentication",
"options": {
"Office365": "Office365",
"LiveID": "LiveID"
},
"visibleRule": "deploymentType = Online",
"groupName": "crmConnection"
}
],
"execution": {
Expand Down

0 comments on commit 045c95e

Please sign in to comment.