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

Use OS variables from image.yml and remove ArtifactName template parameter which is always hard coded to 'packages' #44556

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions eng/pipelines/partner-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ extends:
targetPath: '$(Pipeline.Workspace)/packages-esrp-flattened'

pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC there were some issues with deployment jobs not being able to use variables so do be sure to test the deployment job with this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that kind of looks like what's going on with an outstanding lack of errors messages or any indication that's the case

image: $(WINDOWSVMIMAGE)
os: windows
strategy:
runOnce:
Expand Down
7 changes: 1 addition & 6 deletions eng/pipelines/templates/jobs/build-validate-pom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
image: $(LINUXVMIMAGE)
os: linux

strategy:
matrix:
Client Libraries:
ArtifactName: 'packages'

steps:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Expand Down Expand Up @@ -93,4 +88,4 @@ jobs:
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(ArtifactName)'
ArtifactName: 'packages'
3 changes: 1 addition & 2 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
- job: 'Build'

variables:
ArtifactName: 'packages'
# The ServiceDirectory is an identifier. The pullrequest's ServiceDirectory of
# 'auto' shouldn't cause any problems
Codeql.Enabled: true
Expand Down Expand Up @@ -226,7 +225,7 @@ jobs:
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)
ArtifactName: '$(ArtifactName)'
ArtifactName: 'packages'

# Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'.
# This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured
Expand Down
130 changes: 63 additions & 67 deletions eng/pipelines/templates/stages/archetype-java-release-batch.yml

Large diffs are not rendered by default.

93 changes: 45 additions & 48 deletions eng/pipelines/templates/stages/archetype-java-release-patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ parameters:
- name: TestPipeline
type: boolean
default: false
- name: ArtifactName
type: string
default: 'not-specified'
# A different environment will be passed in for service directories that have
# live tests enabled for release and ReleaseDependsOnLiveTests is false
- name: Environment
Expand All @@ -31,8 +28,8 @@ stages:
variables:
- template: /eng/pipelines/templates/variables/globals.yml
pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- checkout: azure-sdk-build-tools
Expand All @@ -47,36 +44,36 @@ stages:
- template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml

- download: current
displayName: 'Download Artifact: ${{parameters.ArtifactName}}'
artifact: ${{parameters.ArtifactName}}
displayName: 'Download Artifact: packages'
artifact: packages

# Publish the ESRP signed directory. This will still be used by the
# Dev feed publish.
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}'
ArtifactName: '${{parameters.ArtifactName}}-signed'
ArtifactPath: '$(Pipeline.Workspace)/packages'
ArtifactName: 'packages-signed'

# Downloading the ESRP signed artifacts
- download: current
displayName: 'Download Signed Artifacts'
artifact: ${{parameters.ArtifactName}}-signed
artifact: packages-signed

# gpg-sign and create the flattened directory for ESRP bulk publish
# Note: The maven release requires the files to be local GPG signed
# Dev feed publishes use the gpg-sign-and-deply to do it in one step
- template: tools/gpg/gpg.yml@azure-sdk-build-tools
- template: /eng/pipelines/templates/steps/gpg-sign-and-flatten.yml
parameters:
ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
OutputDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-esrp-gpg-signed
FlattenedESRPDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-esrp-flattened
ArtifactDirectory: $(Pipeline.Workspace)/packages-signed
OutputDirectory: $(Pipeline.Workspace)/packages-esrp-gpg-signed
FlattenedESRPDirectory: $(Pipeline.Workspace)/packages-esrp-flattened

# The packages-esrp-flattened will be used for the ESRP publish
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}-esrp-flattened'
ArtifactName: '${{parameters.ArtifactName}}-esrp-flattened'
ArtifactPath: '$(Pipeline.Workspace)/packages-esrp-flattened'
ArtifactName: 'packages-esrp-flattened'

# We generate two interdependent stages for each artifact listed in the ci.yml file, creates the release
# in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they
Expand All @@ -95,20 +92,20 @@ stages:
variables:
- template: /eng/pipelines/templates/variables/globals.yml
pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
- template: /eng/common/pipelines/templates/steps/retain-run.yml
# No pattern, just download everything that's been signed
- download: current
displayName: 'Download Artifact: ${{parameters.ArtifactName}}-signed'
artifact: ${{parameters.ArtifactName}}-signed
displayName: 'Download Artifact: packages-signed'
artifact: packages-signed
- ${{ each artifact in parameters.Artifacts }}:
- template: /eng/common/pipelines/templates/steps/create-tags-and-git-release.yml
parameters:
ArtifactLocation: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.groupId}}/${{artifact.name}}
ArtifactLocation: $(Pipeline.Workspace)/packages-signed/${{artifact.groupId}}/${{artifact.name}}
PackageRepository: Maven
ReleaseSha: $(Build.SourceVersion)

Expand All @@ -127,20 +124,20 @@ stages:
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: '${{parameters.ArtifactName}}-esrp-flattened'
targetPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}-esrp-flattened'
artifactName: 'packages-esrp-flattened'
targetPath: '$(Pipeline.Workspace)/packages-esrp-flattened'

pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
strategy:
runOnce:
deploy:
steps:
- template: /eng/pipelines/templates/steps/java-esrp-publishing.yml
parameters:
FlattenedDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-esrp-flattened
FlattenedDirectory: $(Pipeline.Workspace)/packages-esrp-flattened

- job: PublishDevFeedPackage
displayName: "Publish to Java Dev feed"
Expand All @@ -150,8 +147,8 @@ stages:
timeoutInMinutes: 120
dependsOn: PublishESRPPackage
pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- checkout: azure-sdk-build-tools
Expand All @@ -166,28 +163,28 @@ stages:
- template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml
- download: current
displayName: 'Download Artifacts'
artifact: ${{parameters.ArtifactName}}-signed
artifact: packages-signed
- template: tools/gpg/gpg.yml@azure-sdk-build-tools
# After publishing to Maven, publish to the azure-sdk-for-java feed. The reason for
# this is that the azure-sdk-for-java feed will have the package available immediately
# whereas Maven can take several hours for the package to become available.
- template: /eng/pipelines/templates/steps/java-dev-feed-publishing.yml
parameters:
ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
ArtifactDirectory: $(Pipeline.Workspace)/packages-signed
RepositoryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1
Target: JavaDevFeed
JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactName: ${{parameters.ArtifactName}}-javadevfeed-$(System.JobAttempt)
ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
ArtifactName: packages-javadevfeed-$(System.JobAttempt)
ArtifactPath: $(Pipeline.Workspace)/packages-signed
- template: /eng/common/pipelines/templates/steps/create-apireview.yml
parameters:
ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
ArtifactPath: $(Pipeline.Workspace)/packages-signed
Artifacts: ${{parameters.Artifacts}}
ConfigFileDir: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/PackageInfo
ConfigFileDir: $(Pipeline.Workspace)/packages-signed/PackageInfo
MarkPackageAsShipped: true
ArtifactName: ${{parameters.ArtifactName}}-signed
ArtifactName: packages-signed
SourceRootPath: $(Pipeline.Workspace)/azure-sdk-for-java

- job: UpdatePackageVersion
Expand All @@ -199,8 +196,8 @@ stages:
- name: ArtifactsJson
value: '${{ convertToJson(parameters.Artifacts) }}'
pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- download: none
Expand Down Expand Up @@ -248,8 +245,8 @@ stages:
dependsOn: PublishESRPPackage

pool:
name: azsdk-pool-mms-ubuntu-2004-general
image: azsdk-pool-mms-ubuntu-2004-1espt
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux

variables:
Expand All @@ -265,8 +262,8 @@ stages:
- '!sdk/**/test-recordings/*'
- '!sdk/**/session-records/*'
- download: current
displayName: 'Download Artifact: ${{parameters.ArtifactName}}'
artifact: ${{parameters.ArtifactName}}
displayName: 'Download Artifact: packages'
artifact: packages

- template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml

Expand All @@ -277,7 +274,7 @@ stages:
PackageInfoLocations:
- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- $(Pipeline.Workspace)/${{parameters.ArtifactName}}/PackageInfo/${{artifact.name}}.json
- $(Pipeline.Workspace)/packages/PackageInfo/${{artifact.name}}.json
WorkingDirectory: $(System.DefaultWorkingDirectory)
TargetDocRepoOwner: $(DocRepoOwner)
TargetDocRepoName: $(DocRepoName)
Expand All @@ -294,22 +291,22 @@ stages:
variables:
- template: /eng/pipelines/templates/variables/globals.yml
pool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
- download: current
displayName: 'Download Artifact: ${{parameters.ArtifactName}}-signed'
artifact: ${{parameters.ArtifactName}}-signed
displayName: 'Download Artifact: packages-signed'
artifact: packages-signed
- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- pwsh: |
Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.groupId}}/${{artifact.name}}
Get-ChildItem -Recurse $(Pipeline.Workspace)/packages-signed/${{artifact.groupId}}/${{artifact.name}}
workingDirectory: $(Pipeline.Workspace)
displayName: Output Visible Artifacts
- template: /eng/common/pipelines/templates/steps/publish-blobs.yml
parameters:
FolderForUpload: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.groupId}}/${{artifact.name}}'
FolderForUpload: '$(Pipeline.Workspace)/packages-signed/${{artifact.groupId}}/${{artifact.name}}'
TargetLanguage: 'java'
ArtifactLocation: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.groupId}}/${{artifact.name}}
ArtifactLocation: $(Pipeline.Workspace)/packages-signed/${{artifact.groupId}}/${{artifact.name}}
Loading
Loading