Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to PowerShell SDK to use sub modules for versions with root m… #91

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 6 additions & 1 deletion .github/workflows/build_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ jobs:
shell: pwsh
run: |
$DebugPreference="Continue"
Import-Module -Name '.\PSSailpoint' -Verbose
Import-Module -Name '.\PSSailpoint\beta\src\PSSailpoint.Beta' -Verbose
Import-Module -Name '.\PSSailpoint\v3\src\PSSailpoint.V3' -Verbose
Import-Module -Name '.\PSSailpoint\v2024\src\PSSailpoint.V2024' -Verbose

. .\PSSailpoint\Configuration.ps1
. .\PSSailpoint\Pagination.ps1

Install-Module -Name Pester -Force
Invoke-Pester -Output Detailed ./PSSailpoint/tests/
12 changes: 11 additions & 1 deletion .github/workflows/bump_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
cd PSSailpoint
sed -e "s/ModuleVersion = '${LATEST_TAG:1}'/ModuleVersion = '${{ github.event.inputs.version }}'/g" Build.ps1 > Build.ps1.tmp && mv Build.ps1.tmp Build.ps1
sed -e "s/RequiredVersion = '${LATEST_TAG:1}'/RequiredVersion = '${{ github.event.inputs.version }}'/g" Build.ps1 > Build.ps1.tmp && mv Build.ps1.tmp Build.ps1

- name: Build V2024 SDK
id: buildV2024
Expand Down Expand Up @@ -106,7 +107,16 @@ jobs:
run: |
$DebugPreference="Continue"
./PSSailpoint/Build.ps1
Import-Module -Name '.\PSSailpoint' -Verbose
./PSSailpoint/v3/Build.ps1
./PSSailpoint/v2024/Build.ps1
./PSSailpoint/beta/Build.ps1

Import-Module -Name '.\PSSailpoint\beta\src\Tm.Beta' -Verbose
Import-Module -Name '.\PSSailpoint\v3\src\Tm.V3' -Verbose
Import-Module -Name '.\PSSailpoint\v2024\src\Tm.V2024' -Verbose

. .\Tm\Configuration.ps1
. .\Tm\Pagination.ps1

- name: Commit changes and create new version tag
if: steps.buildSDK.outcome == 'success'
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,25 @@ jobs:
shell: pwsh
run: |
$DebugPreference="Continue"
Install-Module -Name PSYaml -RequiredVersion 1.0.2 -Force
Publish-Module `
-Path './PSSailpoint/beta/src/PSSailpoint.Beta' `
-NuGetApiKey ${{ secrets.PS_GALLERY_TOKEN }} `
-Verbose -Force
Publish-Module `
-Path './PSSailpoint/v3/src/PSSailpoint.V3' `
-NuGetApiKey ${{ secrets.PS_GALLERY_TOKEN }} `
-Verbose -Force
Publish-Module `
-Path './PSSailpoint/v2024/src/PSSailpoint.V2024' `
-NuGetApiKey ${{ secrets.PS_GALLERY_TOKEN }} `
-Verbose -Force

Start-Sleep -Seconds 60

Import-Module -Name 'PSSailpoint.Beta' -Force
Import-Module -Name 'PSSailpoint.V3' -Force
Import-Module -Name 'PSSailpoint.V2024' -Force

Publish-Module `
-Path './PSSailpoint' `
-NuGetApiKey ${{ secrets.PS_GALLERY_TOKEN }} `
Expand Down
8 changes: 7 additions & 1 deletion PSSailpoint/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-FunctionsToExport {
}

$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$FunctionPath = "$PSScriptRoot/v3/src/PSSailpoint/Api", "$PSScriptRoot/v3/src/PSSailpoint/Model", "$PSScriptRoot/v3/src/PSSailpoint/Client", "$PSScriptRoot/beta/src/PSSailpointBeta/Api", "$PSScriptRoot/beta/src/PSSailpointBeta/Model", "$PSScriptRoot/beta/src/PSSailpointBeta/Client","$PSScriptRoot/v2024/src/PSSailpointV2024/Api", "$PSScriptRoot/v2024/src/PSSailpointV2024/Model", "$PSScriptRoot/v2024/src/PSSailpointV2024/Client", "$PSScriptRoot" | ForEach-Object { $_ }
$FunctionPath = "$PSScriptRoot" | ForEach-Object { $_ }

$Manifest = @{
Path = "$ScriptDir\PSSailpoint.psd1"
Expand All @@ -64,6 +64,12 @@ $Manifest = @{

FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport

RequiredModules = @(
@{ModuleName = 'PSSailpoint.Beta'; RequiredVersion = '1.4.3'; },
@{ModuleName = 'PSSailpoint.V3'; RequiredVersion = '1.4.3'; },
@{ModuleName = 'PSSailpoint.V2024'; RequiredVersion = '1.4.3'; }
)

VariablesToExport = @()
AliasesToExport = @()
CmdletsToExport = @()
Expand Down
8 changes: 8 additions & 0 deletions PSSailpoint/Configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ System.Collections.Hashtable
#>
function Get-DefaultConfiguration {

if($null -eq $Script:Configuration) {
$Script:Configuration = [System.Collections.Hashtable]::new()
}

$Script:Configuration = Get-Config
$Configuration = $Script:Configuration

Expand Down Expand Up @@ -135,6 +139,10 @@ function Set-DefaultConfiguration {

Process {

if($null -eq $Script:Configuration) {
$Script:Configuration = [System.Collections.Hashtable]::new()
}

If ($BaseUrl) {
# validate URL
$URL = $BaseUrl -as [System.URI]
Expand Down
Loading
Loading