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

[CI environment] Removed checkout repository leftovers #2155

Merged
merged 1 commit into from
Sep 30, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 6 additions & 34 deletions .azuredevops/pipelineTemplates/jobs.publishModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

parameters:
# Pipeline-related parameters
checkoutRepositories: ''
displayName: 'Publishing'
serviceConnection: '$(serviceConnection)'
poolName: '$(poolName)'
Expand Down Expand Up @@ -93,11 +92,6 @@ jobs:
#--------------------------------
- checkout: self
fetchDepth: 0
- ${{ if ne(parameters.checkoutRepositories, '') }}:
- ${{ each checkoutRepository in parameters.checkoutRepositories }}:
- checkout: ${{ checkoutRepository }}
fetchDepth: 1 # the depth of commits to ask Git to fetch; if not set defaults to no limit
path: 's/${{ checkoutRepository }}'

# [Agent] Prepare environment
#----------------------------
Expand All @@ -120,28 +114,6 @@ jobs:
# Set agent up
Set-EnvironmentOnAgent -PSModules $Modules

# [Multi Repo] Support task
#--------------------------
- task: PowerShell@2
displayName: Handle Multi-Repo Invocation
inputs:
targetType: inline
pwsh: true
script: |
# ---------------------------- #
# HANDLE MULTI-REPO INVOCATION #
# ---------------------------- #

# Handle multiple-repositories
if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) {
Write-Verbose "Multi-Repo Checkout" -Verbose
$modulePath = Join-Path '$(System.DefaultWorkingDirectory)' '$(modulesRepository)' '${{ parameters.modulePath }}'
} else {
Write-Verbose "No Multi-Repo Checkout" -Verbose
$modulePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}'
}
Write-Output "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath"

# [Universal Artifact-feed publish] task(s)
#------------------------------------------
- task: PowerShell@2
Expand All @@ -160,9 +132,9 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactFeed.ps1')

#Prioritizing the bicep file
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.bicep'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep'
if (-not (Test-Path $TemplateFilePath)) {
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.json'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json'
}

$functionInput = @{
Expand Down Expand Up @@ -219,9 +191,9 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1')

#Prioritizing the bicep file
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.bicep'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep'
if (-not (Test-Path $TemplateFilePath)) {
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.json'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json'
}

$functionInput = @{
Expand Down Expand Up @@ -279,9 +251,9 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1')

#Prioritizing the bicep file
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.bicep'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep'
if (-not (Test-Path $TemplateFilePath)) {
$TemplateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.json'
$TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json'
}

$functionInput = @{
Expand Down
32 changes: 2 additions & 30 deletions .azuredevops/pipelineTemplates/jobs.validateModulePester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
## | poolName | '$(poolName)' | You can provide either a [poolname] or [vmImage] to run the job on | 'Custom Deployment Pool' |
## | vmImage | '$(vmImage)' | You can provide either a [poolname] or [vmImage] to run the job on | 'ubuntu20.04' |
## | defaultJobTimeoutInMinutes | 120 | The timeout for the job in this pipeline | 120 |
## | checkoutRepositories | '' | An optional list of repositories to check out at the beginning of this job in addition to the source | 'Components' |
## | modulePath | '$(modulePath)' | The path to the module to deploy. | 'c:/KeyVault' |
## | moduleTestFilePath | '$(moduleTestFilePath)' | The path to the module Pester tests. | 'utilities/pipelines/staticValidation/module.tests.ps1' |
## | location | '$(location)' | The location to validate with | 'France Central' |
Expand All @@ -49,7 +48,6 @@ parameters:
poolName: '$(poolName)'
vmImage: '$(vmImage)'
defaultJobTimeoutInMinutes: 120
checkoutRepositories: ''
# Logic-related parameters
modulePath: '$(modulePath)'
moduleTestFilePath: '$(moduleTestFilePath)'
Expand Down Expand Up @@ -79,32 +77,6 @@ jobs:
# [Checkout Repositories] task(s)
#--------------------------------
- checkout: self
- ${{ if ne(parameters.checkoutRepositories, '') }}:
- ${{ each checkoutRepository in parameters.checkoutRepositories }}:
- checkout: ${{ checkoutRepository }}
fetchDepth: 1 # the depth of commits to ask Git to fetch; if not set defaults to no limit
path: 's/${{ checkoutRepository }}'

# [Multi Repo] Support task
#--------------------------
- task: PowerShell@2
displayName: Handle Multi-Repo Invocation
inputs:
targetType: inline
pwsh: true
script: |
# Handle multiple-repositories
if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) {
Write-Verbose "Multi-Repo Checkout" -Verbose
$moduleRepoRoot = Join-Path '$(System.DefaultWorkingDirectory)' '$(modulesRepository)'
$parametersRepoRoot = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.parametersRepository }}'
} else {
Write-Verbose "No Multi-Repo Checkout" -Verbose
$moduleRepoRoot = '$(System.DefaultWorkingDirectory)'
$parametersRepoRoot = '$(System.DefaultWorkingDirectory)'
}
Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot"

# [Agent] Prepare environment
#----------------------------
Expand All @@ -115,7 +87,7 @@ jobs:
pwsh: true
script: |
# Load used functions
. (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1')
. (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1')

# Define PS modules to install on the runner
$Modules = @(
Expand All @@ -140,7 +112,7 @@ jobs:
pwsh: true
inline: |
# Set repo root path
$repoRootPath = '$(moduleRepoRoot)'
$repoRootPath = '$(System.DefaultWorkingDirectory)'

# Get Service Principal Object ID
$context = Get-AzContext
Expand Down