Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Nov 13, 2023
1 parent 231afeb commit 3f98dae
Show file tree
Hide file tree
Showing 28 changed files with 3,096 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
* text eol=autocrlf

*.mof text eol=crlf
*.sh text eol=lf
*.svg eol=lf

# Ensure any exe files are treated as binary
*.exe binary
*.jpg binary
*.xl* binary
*.pfx binary
*.png binary
*.dll binary
*.so binary
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/General.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: General question or documentation update
about: If you have a general question or documentation update suggestion around the resource module.
---
<!--
Your feedback and support is greatly appreciated, thanks for contributing!
-->
102 changes: 102 additions & 0 deletions .github/ISSUE_TEMPLATE/Problem_with_module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Problem with the module
description: If you have a problem using this module, want to report a bug, or suggest an enhancement to this module.
labels: []
assignees: []
body:
- type: markdown
attributes:
value: |
TITLE: Please be descriptive not sensationalist.
Your feedback and support is greatly appreciated, thanks for contributing!
Please provide information regarding your issue under each section below.
**Write N/A in sections that do not apply, or if the information is not available.**
- type: textarea
id: description
attributes:
label: Problem description
description: Details of the scenario you tried and the problem that is occurring, or the enhancement you are suggesting.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Verbose logs
description: |
Verbose logs showing the problem. **NOTE! Sensitive information should be obfuscated.** _Will be automatically formatted as plain text._
placeholder: |
Paste verbose logs here
render: text
validations:
required: true
- type: textarea
id: reproducible
attributes:
label: How to reproduce
description: Provide the steps to reproduce the problem.
validations:
required: true
- type: textarea
id: expectedBehavior
attributes:
label: Expected behavior
description: Describe what you expected to happen.
validations:
required: true
- type: textarea
id: currentBehavior
attributes:
label: Current behavior
description: Describe what actually happens.
validations:
required: true
- type: textarea
id: suggestedSolution
attributes:
label: Suggested solution
description: Do you have any suggestions how to solve the issue?
validations:
required: true
- type: textarea
id: targetNodeOS
attributes:
label: Operating system the target node is running
description: |
Please provide as much as possible about the node running M365DSC.CompositeResources. _Will be automatically formatted as plain text._
To help with this information:
- On a Linux distribution, please provide the distribution name, version, and release. The following command can help get this information: `cat /etc/*-release && cat /proc/version`
- On a Windows OS please provide edition, version, build, and language. The following command can help get this information: `Get-ComputerInfo -Property @('OsName','OsOperatingSystemSKU','OSArchitecture','WindowsVersion','WindowsBuildLabEx','OsLanguage','OsMuiLanguages')`
placeholder: |
Add operating system information here
render: text
validations:
required: true
- type: textarea
id: targetNodePS
attributes:
label: PowerShell version and build the target node is running
description: |
Please provide the version and build of PowerShell the target node is running. _Will be automatically formatted as plain text._
To help with this information, please run this command: `$PSVersionTable`
placeholder: |
Add PowerShell information here
render: text
validations:
required: true
- type: textarea
id: moduleVersion
attributes:
label: Module version used
description: |
Please provide the version of the M365DSC.CompositeResources module that was used. _Will be automatically formatted as plain text._
To help with this information, please run this command: `Get-Module -Name 'M365DSC.CompositeResources' -ListAvailable | ft Name,Version,Path`
placeholder: |
Add module information here
render: text
validations:
required: true

63 changes: 63 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Pull Request

<!--
Thanks for submitting a Pull Request (PR) to this project.
Your contribution to this project is greatly appreciated!
TITLE: Please be descriptive not sensationalist.
Prepend the title with the [DscResourceName] if your PR is specific to a DSC resource.
Also prepend with [BREAKING CHANGE] if relevant.
i.e. [BREAKING CHANGE][xFile] Add security descriptor property
You may remove this comment block, and the other comment blocks, but please
keep the headers and the task list.
Try to keep your PRs atomic: changes grouped in smallest batch affecting a single logical unit.
-->

## Pull Request (PR) description

<!--
Replace this comment block with a description of your PR to provide context.
Please be describe the intent and link issue where the problem has been discussed.
try to link the issue that it fixes by providing the verb and ref: [fix|close #18]
After the description, please concisely list the changes as per keepachangelog.com
This **should** duplicate what you've updated in the changelog file.
### Added
- for new features [closes #15]
### Changed
- for changes in existing functionality.
### Deprecated
- for soon-to-be removed features.
### Security
- in case of vulnerabilities.
### Fixed
- for any bug fixes. [fix #52]
### Removed
- for now removed features.
-->

## Task list

<!--
To aid community reviewers in reviewing and merging your PR, please take
the time to run through the below checklist and make sure your PR has
everything updated as required.
Change to [x] for each task in the task list that applies to your PR.
For those task that don't apply to you PR, leave those as is.
-->

- [ ] The PR represents a single logical change. i.e. Cosmetic updates should go in different PRs.
- [ ] Added an entry under the Unreleased section of in the CHANGELOG.md as per [format](https://keepachangelog.com/en/1.0.0/).
- [ ] Local clean build passes without issue or fail tests (`build.ps1 -ResolveDependency`).
- [ ] Resource documentation added/updated in README.md.
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
- [ ] Comment-based help added/updated.
- [ ] Localization strings added/updated in all localization files as appropriate.
- [ ] Examples appropriately added/updated.
- [ ] Unit tests added/updated. See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] Integration tests added/updated (where possible). See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] New/changed code adheres to [DSC Resource Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md) and [Best Practices](https://github.com/PowerShell/DscResources/blob/master/BestPractices.md).
130 changes: 130 additions & 0 deletions .github/workflows/ModuleBuildTestRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Module Build, Test and Release

on:
push:
branches:
- main
paths-ignore:
- CHANGELOG.md
tags:
- v*
#tags-ignore:
#- '*-*'
pull_request:

env:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
defaultBranch: main
Agent.Source.Git.ShallowFetchDepth: 0

jobs:
Build_Stage_Package_Module:
name: Package Module
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate ModuleVersion (GitVersion)
id: GitVersion
run: |
$m365dscModule = Find-Module Microsoft365DSC
$m365dscCRModule = Find-Module M365DSC.CompositeResources -ErrorAction SilentlyContinue
if ($m365dscModule.Version -gt $m365dscCRModule)
{
Write-Output "ModuleVersion=$($m365dscModule.Version.ToString())" >> $env:GITHUB_OUTPUT
}
else
{
Write-Output "No new version of Microsoft365DSC found. Skipping build."
exit 1
}
shell: pwsh
- name: Build & Package Module
shell: pwsh
run: './build.ps1 -ResolveDependency -Tasks Build' # Pack' -> Changed from Pack to Build. Pack does not work with nested required modules.
env:
ModuleVersion: ${{ steps.GitVersion.outputs.ModuleVersion }}
- name: Publish Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.buildArtifactName }}
path: ${{ env.buildFolderName }}/

Test_Stage_test_windows_ps:
name: Windows (Windows PowerShell)
runs-on: windows-latest
needs:
- Build_Stage_Package_Module
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.buildArtifactName }}
path: ${{ env.buildFolderName }}/
- name: Run Tests
shell: powershell
run: './build.ps1 -Tasks Test'
- name: Publish Test Artifact
uses: actions/upload-artifact@v3
with:
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/
name: CodeCoverageWinPS51

# Test_Stage_Code_Coverage:
# name: Publish Code Coverage
# runs-on: ubuntu-latest
# needs:
# - Build_Stage_Package_Module
# - Test_Stage_test_windows_ps
# steps:
# - uses: actions/checkout@v2
# - name: Set Environment Variables
# run: |
# $repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
# echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
# echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
# shell: pwsh
# - name: Download Pipeline Artifact
# uses: actions/download-artifact@v2
# - name: Download Test Artifact Windows (PS 5.1)
# uses: actions/download-artifact@v2

Deploy_Stage_Deploy_Module:
name: Deploy Module
runs-on: ubuntu-latest
needs:
- Test_Stage_test_windows_ps
#- Test_Stage_Code_Coverage
if: (success() && ((github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/tags/')) && (contains(github.repository_owner, 'ykuijs')))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.buildArtifactName }}
path: ${{ env.buildFolderName }}/
- name: Publish Release
shell: pwsh
run: |
Get-ChildItem
./build.ps1 -Tasks Publish
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
GalleryApiToken: ${{ secrets.GalleryApiToken }}
ReleaseBranch: ${{ env.defaultBranch }}
MainGitBranch: ${{ env.defaultBranch }}
- name: Send Changelog PR
shell: pwsh
run: './build.ps1 -Tasks Create_ChangeLog_GitHub_PR'
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
ReleaseBranch: ${{ env.defaultBranch }}
MainGitBranch: ${{ env.defaultBranch }}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
output/

**.bak
*.local.*
!**/README.md
.kitchen/

*.nupkg
*.suo
*.user
*.coverage
.vs
.psproj
.sln
markdownissues.txt
node_modules
package-lock.json
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD029": {
"style": "one"
},
"MD013": true,
"MD024": false,
"MD034": false,
"no-hard-tabs": true
}
44 changes: 44 additions & 0 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@{
CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
includeDefaultRules = $true
IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
'PSAvoidDefaultValueSwitchParameter',
'PSAvoidInvokingEmptyMembers',
'PSAvoidNullOrEmptyHelpMessageAttribute',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingComputerNameHardcoded',
'PSAvoidUsingDeprecatedManifestFields',
'PSAvoidUsingEmptyCatchBlock',
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingPositionalParameters',
'PSAvoidShouldContinueWithoutForce',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSDSCReturnCorrectTypesForDSCFunctions',
'PSDSCStandardDSCFunctionsInResource',
'PSDSCUseIdenticalMandatoryParametersForDSC',
'PSDSCUseIdenticalParametersForDSC',
'PSMisleadingBacktick',
'PSMissingModuleManifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSProvideCommentHelp',
'PSReservedCmdletChar',
'PSReservedParams',
'PSUseApprovedVerbs',
'PSUseCmdletCorrectly',
'PSUseOutputTypeCorrectly',
'PSAvoidGlobalVars',
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingUsernameAndPasswordParams',
'PSDSCUseVerboseMessageInDSCResource',
'PSShouldProcess',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',

'Measure-*'
)

}
Loading

0 comments on commit 3f98dae

Please sign in to comment.