Skip to content

Commit

Permalink
Merge pull request #3 from webmd-health-services/feature/prism-changes
Browse files Browse the repository at this point in the history
Reduce directory depth of dependencies
  • Loading branch information
splatteredbits authored Nov 27, 2024
2 parents e8d4c4c + ba25464 commit 44677e2
Show file tree
Hide file tree
Showing 26 changed files with 50 additions and 60 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/Carbon.DSC/LICENSE.txt
/Carbon.DSC/NOTICE.txt
/Carbon.DSC/README.md
/Carbon.DSC/Modules/
/Carbon.DSC/Carbon
/Carbon.DSC/Carbon.*
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@

# Carbon.DSC Changelog

## 1.0.1

Reducing directory depth of internal, private nested module dependencies.

## 1.0.0

> Released 13 Sep 2024
### Upgrade Instructions

Migrated DSC functionality from Carbon.
Expand Down
2 changes: 1 addition & 1 deletion Carbon.DSC/Carbon.DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
RootModule = 'Carbon.DSC.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# ID used to uniquely identify this module
GUID = '8aa43ac0-cd66-4fc0-aa13-efa08d573946'
Expand Down
2 changes: 1 addition & 1 deletion Carbon.DSC/Carbon.DSC.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Set-StrictMode -Version 'Latest'
# module in development has its functions in the Functions directory.
$script:moduleRoot = $PSScriptRoot

$psModulesRoot = Join-Path -Path $script:moduleRoot -ChildPath 'Modules' -Resolve
$psModulesRoot = $script:moduleRoot

Import-Module -Name (Join-Path -Path $psModulesRoot -ChildPath 'Carbon.Cryptography' -Resolve) `
-Function @('Get-CCertificate') `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Set-CEnvironmentVariable')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Get-CFirewallRule')

Expand Down
2 changes: 1 addition & 1 deletion Carbon.DSC/DscResources/Carbon_Group/Carbon_Group.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Install-CGroup', 'Get-CGroup', 'Test-CGroup', 'Uninstall-CGroup')

Expand Down
2 changes: 1 addition & 1 deletion Carbon.DSC/DscResources/Carbon_IniFile/Carbon_IniFile.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Remove-CIniEntry', 'Set-CIniEntry', 'Split-CIni')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @(
'ConvertTo-CContainerInheritanceFlags',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon.Security' -Resolve) `
-Function @('Get-CPrivilege', 'Grant-CPrivilege', 'Revoke-CPrivilege')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @(
'Get-CScheduledTask',
Expand Down
2 changes: 1 addition & 1 deletion Carbon.DSC/DscResources/Carbon_Service/Carbon_Service.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Install-CService', 'Test-CService', 'Uninstall-CService' )
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon.Accounts' -Resolve) `
Expand Down
3 changes: 1 addition & 2 deletions Carbon.DSC/prism.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@
"Name": "Carbon.Security",
"Version": "1.*"
}
],
"PSModulesDirectoryName": "Modules"
]
}
2 changes: 1 addition & 1 deletion Complete-CarbonDscTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ param(
#Requires -Version 5.1
Set-StrictMode -Version 'Latest'

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.DSC' -Resolve

Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Get-CPowerShellModuleInstallPath', 'Uninstall-CJunction') `
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,23 @@ Import-Module -Name '.\Carbon.DSC'
* `Start-CDscPullConfiguration`: performs a configuraiton check on a computer that is using DSC's pull refresh mode.
* `Test-CDscTargetResource`: determines if a target resource is out of date compared to a desired resource.
* `Write-CDscError`: takes DSC error events and writes them as PowerShell errors.

## Developing

We use [Whiskey](https://github.com/webmd-health-services/Whiskey/wiki) to script our builds. You can find the build
script in the whiskey.yml file. We use [AppVeyor](https://ci.appveyor.com/project/WebMD-Health-Services/carbon-dsc) to
run our builds. You can find AppVeyor script in appveyor.yml.

To get your local environment setup, run `.\build.ps1` from an administrator PowerShell prompt. Once the Pester tests
start running, you can quit the build or wait for them to finish. A full build should take less than 10 minutes. You can
check AppVeyor to see current approximate build times. If any tests are failing, reach out to the team to help figure
out why.

All code should have tests that are written using Pester 5. We recommend installing a global instance of the Pester 5
PowerShell module.

When you're developing and testing DSC resources, PowerShell expects the module containing the DSC resources to be in
the global `PSModulePath` environment variable. Use the `Start-CarbonDscTest.ps1` script to get your machine configured
so that the Carbon.DSC module you're working on gets added to PowerShell's module path. When you're done developing,
run `Complete-CarbonDscTest.ps1` to undo this configuration change. Note that a full build runs both scripts so you'll
still need to run `Start-CarbonDscTest.ps1` despite running a full build.
2 changes: 1 addition & 1 deletion Start-CarbonDscTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.DSC' -Reso
-Function @('Clear-CDscLocalResourceCache') `
-Verbose:$false

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.DSC' -Resolve

Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Get-CCimInstance', 'Get-CPowerShellModuleInstallPath', 'Install-CJunction') `
Expand Down
36 changes: 0 additions & 36 deletions TODO.md

This file was deleted.

2 changes: 1 addition & 1 deletion Tests/Carbon_FirewallRule.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Get-CFirewallRule') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_Group.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Get-CGroup', 'Install-CUser', 'Install-CGroup', 'Test-CGroup') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_IniFile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Split-CIni') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_Permission.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @(
'Get-CPermission',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_Privilege.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Install-CUser') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_ScheduledTask.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @(
'Get-CScheduledTask',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Carbon_Service.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Install-CUser', 'Uninstall-CService') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Initialize-CLcm.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$modulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$modulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve
Import-Module -Name (Join-Path -Path $modulesPath -ChildPath 'Carbon.Cryptography' -Resolve) `
-Function @('Get-CCertificate', 'Uninstall-CCertificate') `
-Verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Tests/Initialize-Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ finally
$Global:WhatIfPreference = $originalWhatIfPref
}

$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC\Modules' -Resolve
$psModulesPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.DSC' -Resolve

Import-Module -Name (Join-Path -Path $psModulesPath -ChildPath 'Carbon' -Resolve) `
-Function @('Install-CUser', 'Test-CUser') `
Expand Down

0 comments on commit 44677e2

Please sign in to comment.