forked from WaelHamze/xrm-ci-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving CRM2013 version from CodePlex
- Loading branch information
Showing
60 changed files
with
393,379 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
$CIFrameworkDir = $env:TF_BUILD_BINARIESDIRECTORY + "\" + $env:TF_BUILD_BUILDNUMBER | ||
$CIPowerShellDir = $CIFrameworkDir + "\PowerShell" | ||
$CIBuildTemplatesDir = $CIFrameworkDir + "\BuildTemplates" | ||
$CIBuildCustomAssembliesDir = $CIBuildTemplatesDir + "\CustomAssemblies" | ||
|
||
New-Item $CIPowerShellDir -ItemType directory | ||
New-Item $CIBuildTemplatesDir -ItemType directory | ||
New-Item $CIBuildCustomAssembliesDir -ItemType directory | ||
|
||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.xrm.client.dll") $CIPowerShellDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.xrm.sdk.dll") $CIPowerShellDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.crm.sdk.proxy.dll") $CIPowerShellDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\Xrm.Framework.CI.PowerShell.dll") $CIPowerShellDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\*.ps1") $CIPowerShellDir -Force -Recurse -Verbose | ||
|
||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.xrm.client.dll") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.xrm.sdk.dll") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.crm.sdk.proxy.dll") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\microsoft.xrm.sdk.deployment.dll") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\CustomActivitiesAndExtensions.xml") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\Xrm.Framework.CI.TeamFoundation.Activities.dll") $CIBuildCustomAssembliesDir -Force -Recurse -Verbose | ||
|
||
Copy-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\DynamicsCRM2013ReleaseTfvcTemplate.12.xaml") $CIBuildTemplatesDir -Force -Recurse -Verbose | ||
|
||
[Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem" ) | ||
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal | ||
[System.IO.Compression.ZipFile]::CreateFromDirectory( $CIFrameworkDir, $CIFrameworkDir + ".zip", $compressionLevel, $false ) | ||
|
||
Remove-Item ($env:TF_BUILD_BINARIESDIRECTORY + "\*.*") -exclude "*.zip" -Force -Recurse -Verbose |
Binary file not shown.
7,009 changes: 7,009 additions & 0 deletions
7,009
CRM2013/Xrm.Framework.CI/Lib/CrmSdk/Microsoft.Crm.Sdk.Proxy.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
3,288 changes: 3,288 additions & 0 deletions
3,288
CRM2013/Xrm.Framework.CI/Lib/CrmSdk/Microsoft.Xrm.Client.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1,818 changes: 1,818 additions & 0 deletions
1,818
CRM2013/Xrm.Framework.CI/Lib/CrmSdk/Microsoft.Xrm.Sdk.Deployment.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
6,991 changes: 6,991 additions & 0 deletions
6,991
CRM2013/Xrm.Framework.CI/Lib/CrmSdk/Microsoft.Xrm.Sdk.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
$version = "6.1.0.0" | ||
|
||
Write-Host "Packaging xRM CI Framework $version" | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
#Script Location | ||
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition | ||
Write-Host "Script Path: $scriptPath" | ||
|
||
$CIFrameworkPackagesDir = $scriptPath + "\Packages" | ||
$CIFrameworkTempDir = $CIFrameworkPackagesDir + "\Temp" | ||
$CIFrameworkRootDir = $CIFrameworkTempDir + "\xRMCIFramework" | ||
$CIPowerShellDir = $CIFrameworkRootDir + "\PowerShell" | ||
$CIBuildTemplatesDir = $CIFrameworkRootDir + "\BuildTemplates" | ||
$CIBuildCustomAssembliesDir = $CIBuildTemplatesDir + "\CustomAssemblies" | ||
$xRMCIFrameworkPackageName = "xRMCIFramework_" + $version + ".zip" | ||
$xRMCIFrameworkPackagePath = $CIFrameworkPackagesDir + "\" + $xRMCIFrameworkPackageName | ||
|
||
if (Test-Path $CIFrameworkTempDir) | ||
{ | ||
Remove-Item $CIFrameworkTempDir -Force -Recurse | ||
} | ||
|
||
if (Test-Path $xRMCIFrameworkPackagePath) | ||
{ | ||
Remove-Item $xRMCIFrameworkPackagePath -Force -Recurse | ||
} | ||
|
||
New-Item $CIFrameworkTempDir -ItemType directory | ||
New-Item $CIFrameworkRootDir -ItemType directory | ||
New-Item $CIPowerShellDir -ItemType directory | ||
New-Item $CIBuildTemplatesDir -ItemType directory | ||
New-Item $CIBuildCustomAssembliesDir -ItemType directory | ||
|
||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.PowerShell\bin\Release\microsoft.xrm.client.dll") $CIPowerShellDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.PowerShell\bin\Release\microsoft.xrm.sdk.dll") $CIPowerShellDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.PowerShell\bin\Release\microsoft.crm.sdk.proxy.dll") $CIPowerShellDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.PowerShell\bin\Release\Xrm.Framework.CI.PowerShell.dll") $CIPowerShellDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.PowerShell\bin\Release\*.ps1") $CIPowerShellDir -Force -Recurse | ||
|
||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\microsoft.xrm.client.dll") $CIBuildCustomAssembliesDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\microsoft.xrm.sdk.dll") $CIBuildCustomAssembliesDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\microsoft.xrm.sdk.deployment.dll") $CIBuildCustomAssembliesDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\microsoft.crm.sdk.proxy.dll") $CIBuildCustomAssembliesDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\CustomActivitiesAndExtensions.xml") $CIBuildCustomAssembliesDir -Force -Recurse | ||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Activities\bin\Release\Xrm.Framework.CI.TeamFoundation.Activities.dll") $CIBuildCustomAssembliesDir -Force -Recurse | ||
|
||
Copy-Item ($scriptPath + "\Xrm.Framework.CI.TeamFoundation.Templates\DynamicsCRM2013ReleaseTfvcTemplate.12.xaml") $CIBuildTemplatesDir -Force -Recurse | ||
|
||
[Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem" ) | ||
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal | ||
[System.IO.Compression.ZipFile]::CreateFromDirectory( $CIFrameworkRootDir, $xRMCIFrameworkPackagePath, $compressionLevel, $false ) | ||
|
||
Remove-Item $CIFrameworkTempDir -Force -Recurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Run .\Packages.ps1 to generate the xRM CI Framework package in this folder |
Binary file not shown.
59 changes: 59 additions & 0 deletions
59
CRM2013/Xrm.Framework.CI/Xrm.Framework.CI.PowerShell/AddXrmEntityCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Management.Automation; | ||
using Microsoft.Xrm.Client; | ||
using Microsoft.Xrm.Client.Services; | ||
using Xrm.Framework.CI.Common; | ||
using Xrm.Framework.CI.Common.Entities; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace Xrm.Framework.CI.PowerShell | ||
{ | ||
[Cmdlet(VerbsCommon.Add, "XrmEntity")] | ||
public class AddXrmEntityCommand : Cmdlet | ||
{ | ||
#region Parameters | ||
|
||
[Parameter(Mandatory = true)] | ||
public string ConnectionString | ||
{ | ||
get { return connectionString; } | ||
set { connectionString = value; } | ||
} | ||
private string connectionString; | ||
|
||
[Parameter(Mandatory = true)] | ||
public Entity EntityObject | ||
{ | ||
get { return entityObject; } | ||
set { entityObject = value; } | ||
} | ||
private Entity entityObject; | ||
|
||
#endregion | ||
|
||
#region Process Record | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
base.ProcessRecord(); | ||
|
||
base.WriteVerbose(string.Format("Creating Entity: {0}", EntityObject)); | ||
|
||
CrmConnection connection = CrmConnection.Parse(connectionString); | ||
|
||
using (OrganizationService service = new OrganizationService(connection)) | ||
{ | ||
Guid id = service.Create(EntityObject); | ||
|
||
base.WriteObject(id); | ||
|
||
base.WriteVerbose(string.Format("Entity Created: {0}", EntityObject)); | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
CRM2013/Xrm.Framework.CI/Xrm.Framework.CI.PowerShell/DeployPackage.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
param( | ||
[string]$AuthenticationType, | ||
[string]$Username, | ||
[string]$Password, | ||
[string]$ServerUrl, | ||
[string]$OrganizationName, | ||
[string]$DeploymentRegion, | ||
[string]$OnlineType, | ||
[string]$HomRealmURL, | ||
[string]$PackageName, | ||
[string]$PackageDirectory | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
#Parameters | ||
Write-Host "AuthenticationType: $AuthenticationType" | ||
Write-Host "Username: $Username" | ||
Write-Host "Password: $Password" | ||
Write-Host "ServerUrl: $ServerUrl" | ||
Write-Host "OrganizationName: $OrganizationName" | ||
Write-Host "DeploymentRegion: $DeploymentRegion" | ||
Write-Host "OnlineType: $OnlineType" | ||
Write-Host "HomRealmURL: $HomRealmURL" | ||
Write-Host "PackageName: $PackageName" | ||
Write-Host "PackageDirectory: $PackageDirectory" | ||
|
||
#Script Location | ||
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition | ||
Write-Host "Script Path: $scriptPath" | ||
|
||
#Load XRM Tooling | ||
|
||
Add-PSSnapin Microsoft.Xrm.Tooling.Connector | ||
|
||
Add-PSSnapin Microsoft.Xrm.Tooling.PackageDeployment | ||
|
||
#Create Credentials | ||
$SecPassword = ConvertTo-SecureString $Password -AsPlainText -Force | ||
$Cred = New-Object System.Management.Automation.PSCredential ($Username, $SecPassword) | ||
|
||
#Create Connection | ||
|
||
switch($AuthenticationType) | ||
{ | ||
"AD" { $CRMConn = Get-CrmConnection -ServerUrl $ServerUrl -OrganizationName $OrganizationName -Credential $Cred } | ||
"Claims" { $CRMConn = Get-CrmConnection -ServerUrl $ServerUrl -OrganizationName $OrganizationName -Credential $Cred –HomRealmURL $HomRealmURL} | ||
"IFD" { $CRMConn = Get-CrmConnection -ServerUrl $ServerUrl -OrganizationName $OrganizationName -Credential $Cred } | ||
"Live" { $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion $DeploymentRegion –OnlineType $OnlineType –OrganizationName $OrganizationName } | ||
"Office365" { $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion $DeploymentRegion –OnlineType $OnlineType –OrganizationName $OrganizationName } | ||
} | ||
|
||
#Deploy Package | ||
|
||
Import-CrmPackage –CrmConnection $CRMConn –PackageDirectory $PackageDirectory –PackageName $PackageName -Verbose |
Oops, something went wrong.