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

Change installing modules for testing to use AzArtifacts feed #532

Merged
merged 12 commits into from
Aug 28, 2024
17 changes: 14 additions & 3 deletions .pipelines/DSC-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ pr:
- onebranch
- release*

schedules:
- cron: '0 3 * * 1'
displayName: Weekly Build
branches:
include:
- main
always: true

variables:
BuildConfiguration: 'release'
PackageRoot: '$(System.ArtifactsDirectory)/Packages'
Expand All @@ -25,9 +33,12 @@ extends:
template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
parameters:
featureFlags:
WindowsHostVersion:
WindowsHostVersion:
Disk: Large
Version: 2022
Version: 2022
Network: KS3 # this retricts network access to public upstream repositories
# Currently can't be used as some NPM pkgs like tree-sitter-cli reach out to GitHub to get the actual zip pkg
# Network: NetLock
customTags: 'ES365AIMigrationTooling'
globalSdl:
disableLegacyManifest: true
Expand All @@ -48,7 +59,7 @@ extends:
apiscan:
enabled: false

stages:
stages:
- stage: BuildAndSign
displayName: Build Native Binaries
dependsOn: []
Expand Down
19 changes: 15 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,29 @@ if (!$Clippy -and !$SkipBuild) {
if ($Test) {
$failed = $false

$usingADO = ($null -ne $env:TF_BUILD)
$repository = 'PSGallery'

if ($usingADO) {
$repository = 'CFS'
if ($null -eq (Get-PSResourceRepository -Name CFS -ErrorAction Ignore)) {
"Registering CFS repository"
Register-PSResourceRepository -uri 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' -Name CFS -Trusted
}
}

if ($IsWindows) {
# PSDesiredStateConfiguration module is needed for Microsoft.Windows/WindowsPowerShell adapter
$FullyQualifiedName = @{ModuleName="PSDesiredStateConfiguration";ModuleVersion="2.0.7"}
if (-not(Get-Module -ListAvailable -FullyQualifiedName $FullyQualifiedName))
{ "Installing module PSDesiredStateConfiguration 2.0.7"
Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository PSGallery -TrustRepository
{
Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository $repository -TrustRepository
}
}

if (-not(Get-Module -ListAvailable -Name Pester))
{ "Installing module Pester"
Install-PSResource Pester -WarningAction Ignore -Repository PSGallery -TrustRepository
Install-PSResource Pester -WarningAction Ignore -Repository $repository -TrustRepository
}

foreach ($project in $projects) {
Expand Down Expand Up @@ -408,7 +419,7 @@ if ($Test) {
if (-not(Get-Module -ListAvailable -Name Pester))
{ "Installing module Pester"
$InstallTargetDir = ($env:PSModulePath -split ";")[0]
Find-PSResource -Name 'Pester' -Repository 'PSGallery' | Save-PSResource -Path $InstallTargetDir -TrustRepository
Find-PSResource -Name 'Pester' -Repository $repository | Save-PSResource -Path $InstallTargetDir -TrustRepository
}

"Updated Pester module location:"
Expand Down
2 changes: 1 addition & 1 deletion dsc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading