Skip to content

Commit

Permalink
AzureDevOpsDsc: Support publish wiki documentation (#31)
Browse files Browse the repository at this point in the history
- AzureDevOpsDsc
  - Added pipeline support for publish markdown content to the GitHub repository
    wiki ([issue #15](#15)).
    This will publish the markdown documentation that is generated bu the
    build pipeline.
  - Added new source folder `WikiSource`. Every markdown file in the folder
    `WikiSource` will be published to the GitHub repository wiki. The markdown
    file `Home.md` will be updated with the correct module version on each
    publish to gallery (including preview).
  - Updated pipeline file `RequiredModules.ps1` to latest pipeline pattern.
  - Updated pipeline file `build.yaml` to latest pipeline pattern.
- AzDevOpsProject
  - Added description to the comment-based help.
  - Added a validate set to the parameter `SourceControlType` to (for now)
    limit the parameter to the values `Git` and `Tfvc`.
  - Update comment-based help to remove text which the valid values are
    since that is now add automatically to the documentation (conceptual
    help and wiki documentation).
  • Loading branch information
johlju authored Feb 11, 2021
1 parent f1d8097 commit 5cd23a0
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 18 deletions.
28 changes: 25 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed `Examples` directory from being output in packaged module ([issue #11](https://github.com/dsccommunity/AzureDevOpsDsc/issues/11)).
- Moved 'Ensure' and 'RequiredAction' enums into 'Enum' directory and out of
'prefix.ps1' ([issue #12](https://github.com/dsccommunity/AzureDevOpsDsc/issues/12)).
- Added pipeline support for publish markdown content to the GitHub repository
wiki ([issue #15](https://github.com/dsccommunity/AzureDevOpsDsc/issues/15)).
This will publish the markdown documentation that is generated bu the
build pipeline.
- Added new source folder `WikiSource`. Every markdown file in the folder
`WikiSource` will be published to the GitHub repository wiki. The markdown
file `Home.md` will be updated with the correct module version on each
publish to gallery (including preview).
- AzureDevOpsDsc.Common
- Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/)

### Changed

- Enabled integration tests against https://dev.azure.com/azuredevopsdsc/ (see
comment https://github.com/dsccommunity/AzureDevOpsDsc/issues/9#issuecomment-766375424
for more information).
- AzureDevOpsDsc
- Enabled integration tests against https://dev.azure.com/azuredevopsdsc/ (see
comment https://github.com/dsccommunity/AzureDevOpsDsc/issues/9#issuecomment-766375424
for more information).
- Updated pipeline file `RequiredModules.ps1` to latest pipeline pattern.
- Updated pipeline file `build.yaml` to latest pipeline pattern.
- AzDevOpsProject
- Added a validate set to the parameter `SourceControlType` to (for now)
limit the parameter to the values `Git` and `Tfvc`.
- Update comment-based help to remove text which the valid values are
since that is now add automatically to the documentation (conceptual
help and wiki documentation).

### Fixed

- AzDevOpsProject
- Added description to the comment-based help.
5 changes: 1 addition & 4 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@{
# Set up a mini virtual environment...
PSDependOptions = @{
AddToPath = $true
Target = 'output\RequiredModules'
Parameters = @{
Repository = ''
}
Parameters = @{}
}

InvokeBuild = 'latest'
Expand Down
22 changes: 15 additions & 7 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ BuildWorkflow:
publish:
- Publish_release_to_GitHub
- publish_module_to_gallery

- Publish_GitHub_Wiki_Content

####################################################
# PESTER Configuration #
Expand All @@ -63,7 +63,7 @@ Pester:
ExcludeFromCodeCoverage:
- Modules/DscResource.Common
Script:
- tests/Integration
# Only run on unit test on './build.ps1 -Task test'
- tests/Unit
ExcludeTag:
Tag:
Expand All @@ -80,11 +80,6 @@ DscTest:
ExcludeModuleFile:
MainGitBranch: main

Resolve-Dependency:
Gallery: 'PSGallery'
AllowPrerelease: false
Verbose: false

ModuleBuildTasks:
Sampler:
- '*.build.Sampler.ib.tasks'
Expand All @@ -108,3 +103,16 @@ GitHubConfig:
GitHubConfigUserName: dscbot
GitHubConfigUserEmail: [email protected]
UpdateChangelogOnPrerelease: false

####################################################
# DscResource.DocGenerator Configuration #
####################################################
DscResource.DocGenerator:
Generate_Conceptual_Help:
MarkdownCodeRegularExpression:
- '\`(.+?)\`' # Match inline code-block
- '\\(\\)' # Match escaped backslash
- '\[[^\[]+\]\((.+?)\)' # Match markdown URL
- '_(.+?)_' # Match Italic (underscore)
- '\*\*(.+?)\*\*' # Match bold
- '\*(.+?)\*' # Match Italic (asterisk)
9 changes: 7 additions & 2 deletions source/Classes/010.AzDevOpsProject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.SYNOPSIS
A DSC Resource for Azure DevOps that represents the 'Project' resource.
.DESCRIPTION
A DSC Resource for Azure DevOps that represents the 'Project' resource.
.PARAMETER ProjectId
The 'Id' of the Azure DevOps, 'Project' resource.
Expand All @@ -12,9 +15,10 @@
The 'Description' of the Azure DevOps, 'Project' resource.
.PARAMETER SourceControlType
The 'SourceControlType' of the Azure DevOps, 'Project' resource. Valid options are 'Git' and 'Tfvc'.
The 'SourceControlType' of the Azure DevOps, 'Project' resource.
If the 'Project' resource already exists in Azure DevOps, the 'SourceControlType' cannot be changed to another type.
If the 'Project' resource already exists in Azure DevOps, the parameter
`SourceControlType` cannot be used to change to another type.
#>
[DscResource()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSDSCStandardDSCFunctionsInResource', '', Justification='Test() and Set() method are inherited from base, "AzDevOpsDscResourceBase" class')]
Expand All @@ -33,6 +37,7 @@ class AzDevOpsProject : AzDevOpsDscResourceBase
[System.String]$ProjectDescription

[DscProperty()]
[ValidateSet('Git', 'Tfvc')]
[System.String]$SourceControlType


Expand Down
45 changes: 45 additions & 0 deletions source/WikiSource/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Welcome to the AzureDevOpsDsc wiki

<sup>*AzureDevOpsDsc v#.#.#*</sup>

Here you will find all the information you need to make use of the AzureDevOpsDsc
DSC resources in the latest release. This includes details of the resources
that are available, current capabilities, known issues, and information to
help plan a DSC based implementation of AzureDevOpsDsc.

Please leave comments, feature requests, and bug reports for this module in
the [issues section](https://github.com/dsccommunity/AzureDevOpsDsc/issues)
for this repository.

## Getting started

To get started either:

- Install from the PowerShell Gallery using PowerShellGet by running the
following command:

```powershell
Install-Module -Name AzureDevOpsDsc -Repository PSGallery
```

- Download AzureDevOpsDsc from the [PowerShell Gallery](https://www.powershellgallery.com/packages/AzureDevOpsDsc)
and then unzip it to one of your PowerShell modules folders (such as
`$env:ProgramFiles\WindowsPowerShell\Modules`).

To confirm installation, run the below command and ensure you see the AzureDevOpsDsc
DSC resources available:

```powershell
Get-DscResource -Module AzureDevOpsDsc
```

## Prerequisites

The minimum Windows Management Framework (PowerShell) version required is 5.0
or higher, which ships with Windows 10 or Windows Server 2016,
but can also be installed on Windows 7 SP1, Windows 8.1, Windows Server 2012,
and Windows Server 2012 R2.

## Change log

A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/AzureDevOpsDsc/blob/main/CHANGELOG.md).
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ InModuleScope 'AzureDevOpsDsc' {
'Pat',
'ProjectId',
'ProjectName',
'ProjectDescription',
'SourceControlType'
'ProjectDescription'
)
$testCasesValidPropertyNames = $validPropertyNames | ForEach-Object {
@{
Expand All @@ -41,6 +40,11 @@ InModuleScope 'AzureDevOpsDsc' {
}
}

$testCasesValidPropertyNames += @{
PropertyName = 'SourceControlType'
PropertyValue = 'Git'
}

Context 'When creating a new instance of the class' {

It 'Should not throw' {
Expand Down

0 comments on commit 5cd23a0

Please sign in to comment.