-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from shanec-/development
Development - version 1.4.0
- Loading branch information
Showing
19 changed files
with
339 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ end_of_line = crlf | |
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.ps1] | ||
indent_style = tab | ||
tab_width = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- generated using [email protected] --> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
|
@@ -30,23 +31,17 @@ | |
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="bin\coretools\AntiXSSLibrary.dll" /> | ||
<Content Include="bin\coretools\CrmSvcUtil.exe" /> | ||
<Content Include="bin\coretools\CrmSvcUtil.xml" /> | ||
<Content Include="bin\coretools\Microsoft.Crm.Sdk.Proxy.dll" /> | ||
<Content Include="bin\coretools\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" /> | ||
<Content Include="bin\coretools\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll" /> | ||
<Content Include="bin\coretools\Microsoft.IdentityModel.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Client.CodeGeneration.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Client.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Portal.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Sdk.Deployment.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Sdk.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Tooling.Connector.dll" /> | ||
<Content Include="bin\coretools\Microsoft.Xrm.Tooling.CrmConnectControl.dll" /> | ||
<Content Include="bin\coretools\Other Redistributable.txt" /> | ||
<Content Include="bin\coretools\SolutionPackager.exe" /> | ||
<Content Include="bin\coretools\WebsiteCopy.exe" /> | ||
<Content Include="Mappings\<%= crmSolutionName %>-mapping.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
|
@@ -56,6 +51,7 @@ | |
<None Include="Scripts\Deploy-CrmSolution.ps1" /> | ||
<None Include="Scripts\Pull-CrmSolution.Param.ps1" /> | ||
<None Include="Scripts\Pull-CrmSolution.ps1" /> | ||
<None Include="Scripts\CrmSolution.Common.ps1" /> | ||
<None Include="_Install\Install-Microsoft.Xrm.Data.PowerShell.ps1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
|
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 |
---|---|---|
@@ -1,3 +1,27 @@ | ||
<# | ||
.SYNOPSIS | ||
Recursively finds a list of files and uses a pattern to match and replace matches with a specified version number. | ||
.DESCRIPTION | ||
Recursively finds a list of files within a folder and uses a regular expression pattern to match and replace it with a specified version number. | ||
.NOTES | ||
Author: Shane Carvalho | ||
Version: [email protected] | ||
.LINK | ||
https://nullfactory.net | ||
.PARAMETER BuildSourcePath | ||
The root folder to search. | ||
.PARAMETER versionFile | ||
The pattern of file to be searched. | ||
.PARAMETER regexPattern | ||
The regex pattern to be searched. | ||
.PARAMETER finalVersion | ||
The new version number. | ||
.PARAMETER encoding | ||
The optional encoding. Common encoding values include ASCII, Unicode, UTF8, Default. Default uses the encoding of the system's current ANSI code page. | ||
.EXAMPLE | ||
ReplaceVersion ".\SourceRootFolder" "*AssemblyInfo.cs" "\d+\.\d+\.\d+\.\d+" "1.3.0" | ||
Gets a list of all files starting with "*AssemblyInfo.cs" within the folder "SourceRootFolder". Within these files it attempts to match all instances of a version number ex. 0.0.0.0 and replace it with the new version number. | ||
#> | ||
function ReplaceVersion([string]$BuildSourcePath, [string] $versionFile, [string] $regexPattern, [string]$finalVersion, [string]$encoding='Default') | ||
{ | ||
[bool]$output = $false | ||
|
@@ -19,6 +43,16 @@ function ReplaceVersion([string]$BuildSourcePath, [string] $versionFile, [string | |
return $output | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Applies a specified version number to a list of file matching a pattern. | ||
.PARAMETER BuildSourcePath | ||
The root folder containing the source files. | ||
.PARAMETER BuildBuildNumber | ||
The new build number. | ||
.EXAMPLE | ||
ApplyVersionToAssemblies ".\RootFolder" "0.1.2" | ||
#> | ||
function ApplyVersionToAssemblies | ||
{ | ||
[CmdletBinding()] | ||
|
@@ -40,6 +74,16 @@ function ApplyVersionToAssemblies | |
} | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Applies a specified version number to a CRM solution. | ||
.PARAMETER BuildSourcePath | ||
The root folder containing the extracted (via solutio packager) CRM Solution. | ||
.PARAMETER BuildBuildNumber | ||
The new build number. | ||
.EXAMPLE | ||
ApplyVersionToCrmSolution ".\RootFolder" "0.1.2" | ||
#> | ||
function ApplyVersionToCrmSolution | ||
{ | ||
[CmdletBinding()] | ||
|
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 |
---|---|---|
@@ -1,4 +1,19 @@ | ||
function GetUsername($solutionName) | ||
<# | ||
.SYNOPSIS | ||
Retrieves the username for the specified CRM solution. | ||
.DESCRIPTION | ||
Retrieves the username for the specified CRM solution which is stored in a user-environmental variable. If one does not exist, the script would prompt the user for a new username, which is then stored in a new environment variable. | ||
.NOTES | ||
Author: Shane Carvalho | ||
Version: [email protected] | ||
.LINK | ||
https://nullfactory.net | ||
.PARAMETER solutionName | ||
The name of the CRM solution. | ||
.EXAMPLE | ||
$username = Get-CrmUsername("Nullfactory.Solution1") | ||
#> | ||
function Get-CrmUsername($solutionName) | ||
{ | ||
$variableName = "nfac_" + $solutionName + "_username" | ||
$username = [environment]::GetEnvironmentVariable($variableName, "User") | ||
|
@@ -12,7 +27,18 @@ function GetUsername($solutionName) | |
return $username; | ||
} | ||
|
||
function GetPassword($solutionName) | ||
<# | ||
.SYNOPSIS | ||
Retrieves the password for the specified CRM solution. | ||
.DESCRIPTION | ||
Retrieves the password for the specified CRM solution which is stored in a user-environmental variable. If one does not exist, the script would prompt the user for a new password, which is then stored in a new environment variable. | ||
Note that the password is stored as plain-text. | ||
.PARAMETER solutionName | ||
The name of the CRM solution. | ||
.EXAMPLE | ||
$username = Get-CrmPassword("Nullfactory.Solution1") | ||
#> | ||
function Get-CrmPassword($solutionName) | ||
{ | ||
$variableName = "nfac_" + $solutionName + "_password" | ||
$plainTextPassword = [environment]::GetEnvironmentVariable($variableName, "User") | ||
|
57 changes: 40 additions & 17 deletions
57
generators/app/templates/Nullfactory.Xrm.Tooling/Scripts/Deploy-CrmSolution.Param.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 |
---|---|---|
@@ -1,24 +1,47 @@ | ||
<# | ||
.SYNOPSIS | ||
Manually deploy the CRM Solutions to the remote CRM servers. | ||
.DESCRIPTION | ||
Manually deploy the CRM solution to the configured remote CRM servers. | ||
.NOTES | ||
Author: Shane Carvalho | ||
Version: [email protected] | ||
.LINK | ||
https://nullfactory.net | ||
#> | ||
|
||
# Importing common functions | ||
. .\CrmSolution.Common.ps1 | ||
|
||
Write-Host "Attempting to deploy solution(s)..." | ||
# Defaulting to increased verbosity for manual execution | ||
$oldverbose = $VerbosePreference | ||
$VerbosePreference = "continue" | ||
|
||
.\Deploy-CrmSolution.ps1 ` | ||
-serverUrl "<%= crmServerUrl %>" ` | ||
-username (GetUsername "<%= crmSolutionName %>") ` | ||
-password (GetPassword "<%= crmSolutionName %>") ` | ||
-solutionName "<%= crmSolutionName %>" ` | ||
-publishChanges ` | ||
-activatePlugins | ||
Write-Host "Attempting to deploy solution(s)..." | ||
try | ||
{ | ||
.\Deploy-CrmSolution.ps1 ` | ||
-serverUrl "<%= crmServerUrl %>" ` | ||
-username (Get-CrmUsername "<%= visualStudioSolutionProjectPrefix %>.<%= crmSolutionName %>") ` | ||
-password (Get-CrmPassword "<%= visualStudioSolutionProjectPrefix %>.<%= crmSolutionName %>") ` | ||
-solutionName "<%= visualStudioSolutionProjectPrefix %>.<%= crmSolutionName %>" ` | ||
-publishChanges ` | ||
-activatePlugins | ||
|
||
# Include new entry for each CRM solution to be released manually | ||
# Include new entry for each CRM solution to be released manually | ||
|
||
# .\Deploy-CrmSolution.ps1 ` | ||
# -serverUrl "http://servername/secondary" ` | ||
# -username (GetUsername "env_secondary_username_key") ` | ||
# -password (GetPassword "env_secondary_password_key") ` | ||
# -solutionName "secondary" ` | ||
# -publishChanges ` | ||
# -activatePlugins | ||
# .\Deploy-CrmSolution.ps1 ` | ||
# -serverUrl "http://servername/secondary" ` | ||
# -username (GetUsername "env_secondary_username_key") ` | ||
# -password (GetPassword "env_secondary_password_key") ` | ||
# -solutionName "secondary" ` | ||
# -publishChanges ` | ||
# -activatePlugins | ||
|
||
Write-Host "Deployment(s) complete." -ForegroundColor Green | ||
Write-Host "Deployment(s) complete." -ForegroundColor Green | ||
} | ||
finally | ||
{ | ||
# Reset the verbosity to original level | ||
$VerbosePreference = $oldverbose | ||
} |
Oops, something went wrong.