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
Open
Show file tree
Hide file tree
Changes from 3 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
15 changes: 14 additions & 1 deletion .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,22 @@ jobs:
displayName: 'Make configure'
postSteps:
- script: |
BUILD_REASON=$(Build.Reason)
if [[ "$BUILD_REASON" != "PullRequest" && "$BUILD_DEFINITIONNAME" == "Azure.sonic-buildimage.official.vs" ]]
then
PORT=443
DOCKERS=$(ls target/docker-ptf.gz)
BRANCH=$(Build.SourceBranchName)
LABELS="$BRANCH"
[[ "$BRANCH" == "master" ]] && LABELS="$LABELS latest"
for f in $DOCKERS; do
echo $f
./push_docker.sh $f $(REGISTRY_SERVER_PUBLIC) $PORT $(REGISTRY_USERNAME) "$REGISTRY_PASSWD" "$LABELS"
done
fi
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)

condition: always()
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ stages:
- stage: Build
pool: sonicbld-1es
variables:
- group: Container-Registry
- name: CACHE_MODE
value: wcache
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
Expand Down
Loading