Force push for images and proper interruption when pulling images fail.
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @@ -32,7 +32,6 @@ steps: | ||||
|       REGISTRY_USERNAME: drone | ||||
|       REGISTRY_PASSWORD: | ||||
|         from_secret: drone_secret | ||||
|       DOCKER_MAX_CONCURRENT_UPLOADS: 1 | ||||
|     commands: | ||||
|       - apk add --no-cache bash | ||||
|       - ./mirror.sh | ||||
|   | ||||
							
								
								
									
										12
									
								
								mirror.sh
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								mirror.sh
									
									
									
									
									
								
							| @@ -135,6 +135,8 @@ function mirror() { | ||||
| 	# We presumes that amd64 image should always be available. | ||||
| 	if ! get_amd64_image "${image}"; then | ||||
| 		echo "! Image mirroring failed! Cannot obtain amd64 image!" | ||||
|  | ||||
| 		return 1 | ||||
| 	fi | ||||
|  | ||||
| 	get_arm64_image "${image}" | ||||
| @@ -145,13 +147,13 @@ function mirror() { | ||||
| function push_multiarch_image() { | ||||
| 	local image=$1 | ||||
|  | ||||
| 	if ! docker push "${REMOTE_IMAGE}"-amd64 &> /dev/null; then | ||||
| 	if ! docker push -f "${REMOTE_IMAGE}"-amd64 &> /dev/null; then | ||||
| 		echo -e "\t! amd64 image push failed!" | ||||
| 	else | ||||
| 		echo -e "\t* amd64 image pushed" | ||||
| 	fi | ||||
|  | ||||
| 	if ! docker push "${REMOTE_IMAGE}"-arm64 &> /dev/null; then | ||||
| 	if ! docker push -f ="${REMOTE_IMAGE}"-arm64 &> /dev/null; then | ||||
| 		echo -e "\t! arm64 image push failed!" | ||||
| 	else | ||||
| 		echo -e "\t* arm64 image pushed" | ||||
| @@ -186,5 +188,9 @@ login_to_registry | ||||
| collect_images | ||||
|  | ||||
| for package in "${WHAT_TO_MIRROR[@]}"; do | ||||
| 	mirror "${package}" | ||||
| 	if ! mirror "${package}"; then | ||||
| 		echo "! Failed to mirror package ${package}!" | ||||
|  | ||||
| 		exit 1 | ||||
| 	fi | ||||
| done | ||||
|   | ||||
		Reference in New Issue
	
	Block a user