-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating ChocolateyPackage Class-based DSC Resource (#65)
- Loading branch information
Showing
41 changed files
with
741 additions
and
1,348 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 |
---|---|---|
@@ -1,38 +1,73 @@ | ||
--- | ||
# Check this doc: https://github.com/test-kitchen/kitchen-azurerm | ||
# you may set the following environment variables: | ||
# AZURE_CLIENT_ID="your-azure-client-id-here" | ||
# AZURE_CLIENT_SECRET="your-client-secret-here" | ||
# AZURE_TENANT_ID="your-azure-tenant-id-here" | ||
# (check doc https://github.com/test-kitchen/kitchen-azurerm for more details) | ||
|
||
driver: | ||
name: azurerm | ||
subscription_id: <%= ENV['AZ_SUBSCRIPTION_ID'] %> | ||
location: 'uksouth' | ||
machine_size: 'Standard_D2s_v3' | ||
username: azure | ||
password: <%= | ||
require "securerandom" | ||
if File.exists?("./.kitchen/pwd.txt") | ||
ENV['MACHINE_PASS'] = File.read("./.kitchen/pwd.txt") | ||
else | ||
ENV['MACHINE_PASS'] = SecureRandom.base64(24) | ||
File.open("./.kitchen/pwd.txt", "w") { |f| f.write ENV['MACHINE_PASS'] } | ||
end | ||
ENV['MACHINE_PASS'] | ||
%> | ||
|
||
provisioner: | ||
name: dsc | ||
dsc_local_configuration_manager_version: wmf5 | ||
dsc_local_configuration_manager: | ||
reboot_if_needed: true | ||
configuration_mode_frequency_mins: 15 | ||
debug_mode: none | ||
configuration_script_folder: Chocolatey/examples | ||
configuration_script: dsc_configuration.ps1 | ||
modules_path: BuildOutput/Artefact | ||
retry_on_exit_code: | ||
- 35 | ||
configuration_data_variable: configurationData | ||
modules_from_gallery: | ||
- xPSDesiredStateConfiguration | ||
- name: Pester | ||
requiredversion: 4.0.3 | ||
repository: PSGallery | ||
#- PackageManagementProviderResource | ||
name: shell # defaults to bash on linux, so the shebang is important! | ||
script: 'tests/kitchen/provisioning.ps1' | ||
|
||
verifier: | ||
name: pester | ||
test_folder: Chocolatey/tests/integration/ | ||
shell: powershell | ||
bootstrap: # installs modules from nuget feed by download and unzip. | ||
repository_url: "https://www.powershellgallery.com/api/v2" | ||
modules: | ||
- PackageManagement | ||
- PowerShellGet | ||
test_folder: ./tests/kitchen/ | ||
copy_folders: | ||
- output/module/Chocolatey | ||
downloads: | ||
"./PesterTestResults.xml": "./output/testResults/" | ||
# kitchen_cmd.ps1: "./output/testResults/" | ||
# ./coverage.xml: "./output/testResults/" | ||
# # : ./testresults | ||
|
||
platforms: | ||
- name: win2012r2_PPB | ||
- name: winCore2022 | ||
driver: | ||
# image_urn: MicrosoftWindowsServer:microsoftserveroperatingsystems-previews:windows-server-2022-azure-edition-preview-core:20348.11.2105262137 | ||
image_urn: MicrosoftWindowsServer:WindowsServer:2022-datacenter-core:latest #20348.288.2110071044 | ||
# use_ephemeral_osdisk: true | ||
os_type: windows | ||
shell: powershell | ||
lifecycle: | ||
post_create: | ||
- remote: | | ||
$null = Install-PackageProvider -Name NuGet -Confirm:$false -Force | ||
Install-Module PowerShellGet -Force -SkipPublisherCheck -Confirm:$false -Scope AllUsers | ||
Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' | ||
Remove-Module -Name PowerShellGet | ||
transport: | ||
name: winrm | ||
|
||
suites: | ||
- name: chocolatey | ||
provisioner: | ||
configuration_script_folder: Chocolatey/examples | ||
configuration_script: chocolateyConfig.ps1 | ||
- name: Default | ||
- name: Remove | ||
|
||
- name: GCPackages | ||
verifier: | ||
copy_folders: | ||
- output/GCPackages/ | ||
- output/module/Chocolatey # This is only used when troubleshooting interactively. | ||
install_modules: | ||
- Name: GuestConfiguration | ||
AllowPrerelease: true |
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 |
---|---|---|
|
@@ -51,6 +51,9 @@ BuildWorkflow: | |
# - Set_PSModulePath | ||
- Invoke_HQRM_Tests_Stop_On_Fail | ||
|
||
gcpol: | ||
- build_guestconfiguration_packages | ||
|
||
# Defining test task to be run when invoking `./build.ps1 -Tasks test` | ||
test: | ||
# - Set_PSModulePath | ||
|
@@ -152,6 +155,8 @@ TaskHeader: | | |
GitHubConfig: | ||
GitHubFilesToAdd: | ||
- 'CHANGELOG.md' | ||
ReleaseAssets: | ||
- output/GCPackages/ChocoIsInstalled*.zip | ||
GitHubConfigUserName: dscbot | ||
GitHubConfigUserEmail: [email protected] | ||
UpdateChangelogOnPrerelease: false | ||
|
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,8 @@ | ||
class ChocolateyReason | ||
{ | ||
[DscProperty(NotConfigurable)] | ||
[string] $Code | ||
|
||
[DscProperty(NotConfigurable)] | ||
[string] $Phrase | ||
} |
Oops, something went wrong.