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

[docker-ptf]: CI change to publish docker-ptf image to the docker registry #20528

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

opcoder0
Copy link
Contributor

@opcoder0 opcoder0 commented Oct 17, 2024

Why I did it

Changes to docker-ptf Dockerfile don't get automatically published to the docker registry accessed by the community. This PR addresses the issue.

Work item tracking
  • Microsoft ADO (number only): 29869315

How I did it

Modified the postSteps phase in azure-pipelines-image-template.yml to invoke the script to push docker-ptf image to the docker registry. The push is applicable to build branches (master, 202305, 202311 etc.) and not feature branches.

How to verify it

TBD

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Not applicable.

Description for the changelog

[docker-ptf]: CI change to publish docker-ptf image to the public/community docker registry

  • Change pipeline YAML to publish docker-ptf image to docker registry
  • Publish only docker-ptf image for main or release branches only and not feature branch

Link to config_db schema for YANG module changes

Not applicable

A picture of a cute animal (not mandatory but encouraged)

@@ -52,6 +52,8 @@ variables:
stages:
- stage: BuildVS
pool: sonicbld-1es
variables:
Copy link
Contributor

Choose a reason for hiding this comment

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

azure-pipelines.yml don't need this Variable Group
official-build.yml need this.

@@ -58,9 +58,23 @@ jobs:
displayName: 'Make configure'
postSteps:
- script: |
BUILD_REASON=$(Build.Reason)
if [[ "$BUILD_REASON" != "PullRequest" && "$GROUP_NAME" == "vs" ]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Azure.sonic-buildimage.official.vs
Please use pipeline name in condition. Only this pipeline need the step.

Publish to docker registry only for this pipeline
mkdir -p $(Build.ArtifactStagingDirectory)/target
mv target/* $(Build.ArtifactStagingDirectory)/target/
displayName: Copy Artifacts
displayName: Publish to Docker Registry and Copy Artifacts
Copy link
Contributor

Choose a reason for hiding this comment

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

you need add something like this
env:
REGISTRY_PASSWD: $(ABC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants