mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-29 17:22:33 +00:00 
			
		
		
		
	[ci] Add branch tag on sonic-slave-bullseye image. (#13151)
Why I did it tag sonic-slave-* image with branch. Only keep sonic-slave-* latest tag when it is master branch and amd64 arch. How I did it How to verify it
This commit is contained in:
		| @@ -56,6 +56,7 @@ jobs: | ||||
|       set -ex | ||||
|       image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1) | ||||
|       image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest) | ||||
|       image_branch=$(echo $(echo $image_tag | awk -F: '{print$1}'):$(Build.SourceBranchName)) | ||||
|       docker rmi $image_tag || true | ||||
|  | ||||
|       if [[ "$(Build.Reason)" =~ [a-zA-Z]*CI ]] && docker pull ${{ parameters.registry_url }}/${image_tag};then | ||||
| @@ -69,7 +70,9 @@ jobs: | ||||
|  | ||||
|       docker tag ${image_tag} ${REGISTRY_SERVER}/${image_tag} | ||||
|       docker push ${REGISTRY_SERVER}/${image_tag} | ||||
|       if [[ "${{ parameters.arch }}" == "amd64" ]];then | ||||
|       docker tag ${image_tag} ${REGISTRY_SERVER}/${image_branch} | ||||
|       docker push ${REGISTRY_SERVER}/${image_branch} | ||||
|       if [[ "${{ parameters.arch }}" == "amd64" ]] && [[ "$(Build.SourceBranchName)" == "master" ]];then | ||||
|         docker tag ${image_tag} ${REGISTRY_SERVER}/${image_latest} | ||||
|         docker push ${REGISTRY_SERVER}/${image_latest} | ||||
|       fi | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Liu Shilong
					Liu Shilong