Skip to content

Commit e34e57e

Browse files
committed
Merge branch 'NTBS-2176-Live-container-backups'
2 parents fa782b8 + 4ba9b68 commit e34e57e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.github/workflows/backup-live-image.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ jobs:
2828
BACKUP_DOCKER_PASSWORD: ${{ secrets.BACKUP_DOCKER_PASSWORD }}
2929
BACKUP_IMAGE_TAG: ${{ steps.get_tag.outputs.BRANCH_TAG }}
3030
run: |
31-
image_tag=$(az acr repository show-tags -n $DOCKER_REGISTRY_AZURE_NAME --repository $DOCKER_REPOSITORY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | grep $COMMIT_SHA | cut -d \" -f 2)
32-
[ -z "$image_tag" ] && { echo "An image could not be found for the commit $COMMIT_SHA"; exit 1; }
33-
echo "Discovered image $image_tag"
34-
echo "Logging in to $DOCKER_REGISTRY_URL"
35-
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
36-
full_image="$DOCKER_REGISTRY_URL/$DOCKER_REPOSITORY:$image_tag"
37-
echo "Pulling image $full_image"
38-
docker pull $full_image
39-
full_backup_image="$BACKUP_DOCKER_REGISTRY_URL/$BACKUP_DOCKER_REPOSITORY:$BACKUP_IMAGE_TAG"
40-
echo "Setting image tag to $full_backup_image"
41-
docker tag $full_image $full_backup_image
42-
echo "Logging in to $BACKUP_DOCKER_REGISTRY_URL"
43-
docker login -u $BACKUP_DOCKER_USERNAME -p $BACKUP_DOCKER_PASSWORD $BACKUP_DOCKER_REGISTRY_URL
44-
echo "Pushing image $full_backup_image"
45-
docker image push $full_backup_image
31+
image_tag=$(az acr repository show-tags -n $DOCKER_REGISTRY_AZURE_NAME --repository $DOCKER_REPOSITORY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | grep $COMMIT_SHA | cut -d \" -f 2)
32+
[ -z "$image_tag" ] && { echo "An image could not be found for the commit $COMMIT_SHA"; exit 1; }
33+
echo "Discovered image $image_tag"
34+
echo "Logging in to $DOCKER_REGISTRY_URL"
35+
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin $DOCKER_REGISTRY_URL
36+
full_image="$DOCKER_REGISTRY_URL/$DOCKER_REPOSITORY:$image_tag"
37+
echo "Pulling image $full_image"
38+
docker pull $full_image
39+
full_backup_image="$BACKUP_DOCKER_REGISTRY_URL/$BACKUP_DOCKER_REPOSITORY:$BACKUP_IMAGE_TAG"
40+
echo "Setting image tag to $full_backup_image"
41+
docker tag $full_image $full_backup_image
42+
echo "Logging in to $BACKUP_DOCKER_REGISTRY_URL"
43+
echo "$BACKUP_DOCKER_PASSWORD" | docker login -u $BACKUP_DOCKER_USERNAME --password-stdin $BACKUP_DOCKER_REGISTRY_URL
44+
echo "Pushing image $full_backup_image"
45+
docker image push $full_backup_image

0 commit comments

Comments
 (0)