-
Notifications
You must be signed in to change notification settings - Fork 47
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
Publish module to ACR #236
base: main
Are you sure you want to change the base?
Conversation
- pwsh: | | ||
$modulePath = Join-Path $(drop) -ChildPath 'Microsoft.PowerShell.SecretManagement.$(version).nupkg' | ||
$fileExists = Test-Path $modulePath | ||
Write-Verbose -Verbose "Module file $modulePath Exists: $fileExists" | ||
|
||
$srcDir = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot' -ChildPath 'SrcFiles' | ||
New-Item $srcDir -ItemType Directory | ||
|
||
$dest = Join-Path $srcDir -ChildPath 'Microsoft.PowerShell.SecretManagement.$(version).nupkg' | ||
Copy-Item -Path $modulePath -Destination $dest | ||
|
||
Get-ChildItem '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/SrcFiles/' | ||
displayName: Move artifact to Ev2 folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pwsh: | | |
$modulePath = Join-Path $(drop) -ChildPath 'Microsoft.PowerShell.SecretManagement.$(version).nupkg' | |
$fileExists = Test-Path $modulePath | |
Write-Verbose -Verbose "Module file $modulePath Exists: $fileExists" | |
$srcDir = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot' -ChildPath 'SrcFiles' | |
New-Item $srcDir -ItemType Directory | |
$dest = Join-Path $srcDir -ChildPath 'Microsoft.PowerShell.SecretManagement.$(version).nupkg' | |
Copy-Item -Path $modulePath -Destination $dest | |
Get-ChildItem '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/SrcFiles/' | |
displayName: Move artifact to Ev2 folder | |
- task: CopyFiles@2 | |
SourceFolder: $(drop) | |
Contents: Microsoft.PowerShell.SecretManagement.$(version).nupkg | |
TargetFolder: $(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/SrcFiles/ |
- pwsh: | | ||
$srcPath = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot' -ChildPath 'Shell' | ||
$pathToRunTarFile = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/Shell' -ChildPath "Run.tar" | ||
tar -cvf $pathToRunTarFile -C $srcPath ./Run | ||
$tarExists = Test-Path $pathToRunTarFile | ||
Write-Verbose -Verbose "Tar file $pathToRunTarFile exists: $tarExists" | ||
displayName: Compress Run script into tar file as needed for EV2 Shell extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pwsh: | | |
$srcPath = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot' -ChildPath 'Shell' | |
$pathToRunTarFile = Join-Path '$(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/Shell' -ChildPath "Run.tar" | |
tar -cvf $pathToRunTarFile -C $srcPath ./Run | |
$tarExists = Test-Path $pathToRunTarFile | |
Write-Verbose -Verbose "Tar file $pathToRunTarFile exists: $tarExists" | |
displayName: Compress Run script into tar file as needed for EV2 Shell extension | |
- task: ArchiveFiles@2 | |
inputs: | |
rootFolderOrFile: $(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/Shell/Run | |
includeRootFolder: false | |
archiveType: tar | |
tarCompression: None | |
archiveFile: $(Build.SourcesDirectory)/EV2Specs/ServiceGroupRoot/Shell/Run.tar | |
displayName: Compress Run script into tar file as needed for EV2 Shell extension |
[xml]$xml = Get-Content Directory.Build.props | ||
$version = $xml.Project.PropertyGroup.ModuleVersion | ||
|
||
for ($i=0; $i -lt $envVarArrayLen; $i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per Viv's idea: we remove the predefined values from the environmentValues
array and simply build its contents here, instead of having to iterate over it with a bunch of checks and sets.
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
targetPath: '$(Pipeline.Workspace)' | ||
artifact: drop_PrepForEV2_CopyEv2FilesToArtifact | ||
displayName: 'Download drop_PrepForEV2_CopyEv2FilesToArtifact artifact that has all files needed' | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
buildType: 'current' | ||
targetPath: '$(Pipeline.Workspace)' | ||
displayName: 'Download to get EV2 Files' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- task: DownloadPipelineArtifact@2 | |
inputs: | |
targetPath: '$(Pipeline.Workspace)' | |
artifact: drop_PrepForEV2_CopyEv2FilesToArtifact | |
displayName: 'Download drop_PrepForEV2_CopyEv2FilesToArtifact artifact that has all files needed' | |
- task: DownloadPipelineArtifact@2 | |
inputs: | |
buildType: 'current' | |
targetPath: '$(Pipeline.Workspace)' | |
displayName: 'Download to get EV2 Files' | |
- download: current | |
displayName: Download artifacts |
$secretManagementFileName = "Microsoft.PowerShell.SecretManagement.$($env:SECRET_MANAGEMENT_VERSION).nupkg" | ||
|
||
Write-Verbose -Verbose "Download files" | ||
Invoke-WebRequest -Uri $env:SECRET_MANAGEMENT_MODULE -OutFile $secretManagementFileName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're both just curious what the original value of SECRET_MANAGEMENT_MODULE
is, and why we have to "download" it in the container. Like, is it a local URI?
@@ -0,0 +1 @@ | |||
1.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we need to update this? When? Is it tied to the package version?
Publish module to ACR as an intermediate step to publish module to MAR.
PR Summary
PR Context
Add step to run Ev2 shell extension that publishes module to our ACR.