Skip to content

Commit

Permalink
Merge pull request #1175 from ykuijs/master
Browse files Browse the repository at this point in the history
Various updates for CD/CI pipeline
  • Loading branch information
ykuijs authored Feb 21, 2020
2 parents 2156b35 + 118d4a9 commit 9194c37
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 15 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SharePointDsc
- Added automatic release with a new CI pipeline
- Updated PULL_REQUEST_TEMPLATE.md to match DSC standard
- Prepared Conceptual Help and Wiki Content generation
- SPAzureAccessControlServiceAppProxy
- Added new resource to create Azure Access Control Service Application Proxy
- SPExcelServiceApp
Expand All @@ -31,11 +32,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SharePointDsc
- Updated all resources and Invoke-SPDscCommand function to automatically
load Utils module, which broke with the new CI
- Extended Convert-SPDscHashtableToString function to support complex types
in arrays and the CIMInstance type
- SPConfigWizard
- Updated checks in Set method to make sure the resource also runs when
a language pack is installed
- SPContentDatabase
- Updated DatabaseServer parameter to support null value
- SPSearchIndexPartition
- Updated documentation to specifically mention that each index partition
requires its own dedicated RootDirectory
- SPUserProfileServiceApp
- Implemented ability to fix incorrectly linked proxy groups
- SPWebApplicationExtension
Expand All @@ -51,9 +57,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- SharePointDsc
- Corrected schema.mof files of SPSubscriptionSettingServiceApp and
SPPasswordChangeSettings resources, which caused failed Wiki generation
- SPSearchContentSource
- Add CrawlVirtualServers and CrawlSites CrawlSetting for SharePoint content
sources.
- SPSubscriptionSettingServiceApp
- Corrected incorrect information in Readme file
- SPUserProfileProperty
- Fixed typo in user profile property test for IsSearchable.

Expand Down
1 change: 1 addition & 0 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Sampler = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
'DscResource.DocGenerator' = 'latest'
MarkdownLinkCheck = 'latest'
xDSCResourceDesigner = 'latest'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("SPPasswordChangeSettings")]
class MSFT_SPPasswordChangeSettings : OMI_BaseResource
class MSFT_SPPasswordChangeSettings : OMI_BaseResource
{
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance;
[Required, Description("The email address to send notifications of password changes to")] string MailAddress;
Expand Down
15 changes: 10 additions & 5 deletions SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ before creating additional indexes. The first index will be created through
the use of the SPSearchRoles resource. Additional search index partitions can
be created through using this resource.

Note that for the search topology to apply correctly, the path specified for
RootDirectory needs to exist on the server that is executing this resource. For
example, if the below example was executed on "Server1" it would also need to
ensure that it was able to create the index path at I:\. If no disk labeled I:
was available on server1, this would fail, even though it will not hold an
NOTE 1:
To make sure that the search topology is applied correctly, the path specified
for RootDirectory needs to exist on the server that is executing this resource.
For example, if the below example was executed on "Server1" it would also need
to ensure that it was able to create the index path at I:\. If no disk labeled
I: was available on server1, this would fail, even though it will not hold an
actual index component.

NOTE 2:
Make sure that each created index partition uses its own RootDirectory folder,
else you will get an error stating that the specified directory is not empty.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("SPSubscriptionSettingsServiceApp")]
class MSFT_SPSubscriptionSettingsServiceApp : OMI_BaseResource
class MSFT_SPSubscriptionSettingsServiceApp : OMI_BaseResource
{
[Key, Description("The name of the subscription settings service app")] string Name;
[Required, Description("The name of the application pool the service app runs in")] String ApplicationPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
**Type:** Distributed
**Requires CredSSP:** No

This resource is used to provision and manage an instance of the App Management
Services Service Application. It will identify an instance of the subscription
This resource is used to provision and manage an instance of the Subscription
Settings Service Application. It will identify an instance of the subscription
settings service app through the application display name. Currently the
resource will provision the app if it does not yet exist, and will change the
service account associated to the app if it does not match the configuration.
resource will provision the serviceapp if it does not yet exist, and will change
the service account associated to the app if it does not match the configuration.
Database names or server name will not be changed if the configuration does
not match, these parameters are only used for the initial provisioning of the
service application.
Expand Down
67 changes: 66 additions & 1 deletion SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ function Convert-SPDscHashtableToString
{
if ($pair.Value -is [System.Array])
{
$str = "$($pair.Key)=($($pair.Value -join ","))"
$str = "$($pair.Key)=$(Convert-SPDscArrayToString -Array $pair.Value)"
}
elseif ($pair.Value -is [System.Collections.Hashtable])
{
$str = "$($pair.Key)={$(Convert-SPDscHashtableToString -Hashtable $pair.Value)}"
}
elseif ($pair.Value -is [Microsoft.Management.Infrastructure.CimInstance])
{
$str = "$($pair.Key)=$(Convert-SPDscCIMInstanceToString -CIMInstance $pair.Value)"
}
else
{
$str = "$($pair.Key)=$($pair.Value)"
Expand All @@ -127,6 +131,67 @@ function Convert-SPDscHashtableToString
return ($values -join "; ")
}

function Convert-SPDscArrayToString
{
param
(
[Parameter()]
[System.Array]
$Array
)

$str = "("
for ($i = 0; $i -lt $Array.Count; $i++)
{
$item = $Array[$i]
if ($item -is [System.Collections.Hashtable])
{
$str += "{"
$str += Convert-SPDscHashtableToString -Hashtable $item
$str += "}"
}
elseif ($Array[$i] -is [Microsoft.Management.Infrastructure.CimInstance])
{
$str += Convert-SPDscCIMInstanceToString -CIMInstance $item
}
else
{
$str += $item
}

if ($i -lt ($Array.Count - 1))
{
$str += ","
}
}
$str += ")"

return $str
}

function Convert-SPDscCIMInstanceToString
{
param
(
[Parameter()]
[Microsoft.Management.Infrastructure.CimInstance]
$CIMInstance
)

$str = "{"
foreach ($prop in $CIMInstance.CimInstanceProperties)
{
if ($str -notmatch "{$")
{
$str += "; "
}
$str += "$($prop.Name)=$($prop.Value)"
}
$str += "}"

return $str
}

function Get-SPDscOSVersion
{
[CmdletBinding()]
Expand Down
20 changes: 18 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param
[validateScript(
{ Test-Path -Path $_ }
)]
$BuildConfig = './build.yaml',
$BuildConfig,

[Parameter()]
# A Specific folder to build the artefact into.
Expand All @@ -36,7 +36,7 @@ param
$RequiredModulesDirectory = $(Join-Path 'output' 'RequiredModules'),

[Parameter()]
[string[]]
[object[]]
$PesterScript,

# Filter which tags to run when invoking Pester tests
Expand Down Expand Up @@ -222,6 +222,22 @@ process

Begin
{
# Find build config if not specified
if (-not $BuildConfig) {
$config = Get-ChildItem -Path "$PSScriptRoot\*" -Include 'build.y*ml', 'build.psd1', 'build.json*' -ErrorAction:Ignore
if (-not $config -or ($config -is [array] -and $config.Length -le 0)) {
throw "No build configuration found. Specify path via -BuildConfig"
}
elseif ($config -is [array]) {
if ($config.Length -gt 1) {
throw "More than one build configuration found. Specify which one to use via -BuildConfig"
}
$BuildConfig = $config[0]
}
else {
$BuildConfig = $config
}
}
# Bootstrapping the environment before using Invoke-Build as task runner

if ($MyInvocation.ScriptName -notLike '*Invoke-Build.ps1')
Expand Down
8 changes: 7 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BuildWorkflow:
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
#- Generate_Conceptual_Help

pack:
- build
Expand All @@ -61,6 +62,9 @@ BuildWorkflow:
hqrmtest:
- DscResource_Tests_Stop_On_Fail

#documentation:
# - Generate_Wiki_Content

publish:
- Publish_release_to_GitHub
- publish_module_to_gallery # runs if nuget is not available
Expand All @@ -83,7 +87,7 @@ Pester: #Passthru, OutputFile, CodeCoverageOutputFile not supported
# - tests/Integration
ExcludeTag:
Tag:
CodeCoverageThreshold: 50 # Set to 0 to bypass
CodeCoverageThreshold: 70 # Set to 0 to bypass

DscTest:
# OutputFolder:
Expand All @@ -110,6 +114,8 @@ ModuleBuildTasks:
# - ModuleName: 'alias to search'
Sampler:
- '*.build.Sampler.ib.tasks' # this means: import (dot source) all aliases ending with .ib.tasks exported by sampler module
DscResource.DocGenerator:
- 'Task.*'

# Invoke-Build Header to be used to 'decorate' the terminal output of the tasks.
TaskHeader: |
Expand Down

0 comments on commit 9194c37

Please sign in to comment.