Skip to content

Commit 620720c

Browse files
authored
Merge pull request #532 from SteveL-MSFT/psgallery-cfs
Change installing modules for testing to use AzArtifacts feed
2 parents dc78c0c + b2957a7 commit 620720c

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.pipelines/DSC-Official.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ pr:
77
- onebranch
88
- release*
99

10+
schedules:
11+
- cron: '0 3 * * 1'
12+
displayName: Weekly Build
13+
branches:
14+
include:
15+
- main
16+
always: true
17+
1018
variables:
1119
BuildConfiguration: 'release'
1220
PackageRoot: '$(System.ArtifactsDirectory)/Packages'
@@ -25,9 +33,12 @@ extends:
2533
template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
2634
parameters:
2735
featureFlags:
28-
WindowsHostVersion:
36+
WindowsHostVersion:
2937
Disk: Large
30-
Version: 2022
38+
Version: 2022
39+
Network: KS3 # this retricts network access to public upstream repositories
40+
# Currently can't be used as some NPM pkgs like tree-sitter-cli reach out to GitHub to get the actual zip pkg
41+
# Network: NetLock
3142
customTags: 'ES365AIMigrationTooling'
3243
globalSdl:
3344
disableLegacyManifest: true
@@ -48,7 +59,7 @@ extends:
4859
apiscan:
4960
enabled: false
5061

51-
stages:
62+
stages:
5263
- stage: BuildAndSign
5364
displayName: Build Native Binaries
5465
dependsOn: []

build.ps1

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,29 @@ if (!$Clippy -and !$SkipBuild) {
352352
if ($Test) {
353353
$failed = $false
354354

355+
$usingADO = ($null -ne $env:TF_BUILD)
356+
$repository = 'PSGallery'
357+
358+
if ($usingADO) {
359+
$repository = 'CFS'
360+
if ($null -eq (Get-PSResourceRepository -Name CFS -ErrorAction Ignore)) {
361+
"Registering CFS repository"
362+
Register-PSResourceRepository -uri 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' -Name CFS -Trusted
363+
}
364+
}
365+
355366
if ($IsWindows) {
356367
# PSDesiredStateConfiguration module is needed for Microsoft.Windows/WindowsPowerShell adapter
357368
$FullyQualifiedName = @{ModuleName="PSDesiredStateConfiguration";ModuleVersion="2.0.7"}
358369
if (-not(Get-Module -ListAvailable -FullyQualifiedName $FullyQualifiedName))
359-
{ "Installing module PSDesiredStateConfiguration 2.0.7"
360-
Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository PSGallery -TrustRepository
370+
{
371+
Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository $repository -TrustRepository
361372
}
362373
}
363374

364375
if (-not(Get-Module -ListAvailable -Name Pester))
365376
{ "Installing module Pester"
366-
Install-PSResource Pester -WarningAction Ignore -Repository PSGallery -TrustRepository
377+
Install-PSResource Pester -WarningAction Ignore -Repository $repository -TrustRepository
367378
}
368379

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

414425
"Updated Pester module location:"

dsc/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)