Skip to content

Commit 5ee0de9

Browse files
author
Kevin Allioli
committed
Fix Docker Hub/Quay.io registry login conditions and snapshot creation command syntax
* Add step IDs to Docker Hub and Quay.io login actions * Replace continue-on-error with conditional execution based on login success * Fix openstack volume snapshot create command - move snapshot name to end as positional argument * Remove --name flag from snapshot creation (not supported in positional syntax)
1 parent 3b9c5a6 commit 5ee0de9

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555

5656
# Docker Hub
5757
- name: Login to Docker Hub
58+
id: dockerhub_login
5859
uses: docker/login-action@v3
5960
with:
6061
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -63,6 +64,7 @@ jobs:
6364

6465
# Quay.io
6566
- name: Login to Quay.io
67+
id: quay_login
6668
uses: docker/login-action@v3
6769
with:
6870
registry: quay.io
@@ -85,6 +87,7 @@ jobs:
8587
cache-to: type=gha,mode=max
8688

8789
- name: Build and push to Docker Hub
90+
if: steps.dockerhub_login.outcome == 'success'
8891
uses: docker/build-push-action@v5
8992
with:
9093
context: .
@@ -94,9 +97,9 @@ jobs:
9497
${{ env.DOCKERHUB_REPO }}/${{ env.IMAGE_NAME }}:latest
9598
cache-from: type=gha
9699
cache-to: type=gha,mode=max
97-
continue-on-error: true
98100

99101
- name: Build and push to Quay.io
102+
if: steps.quay_login.outcome == 'success'
100103
uses: docker/build-push-action@v5
101104
with:
102105
context: .
@@ -106,7 +109,6 @@ jobs:
106109
quay.io/${{ env.QUAY_REPO }}/${{ env.IMAGE_NAME }}:latest
107110
cache-from: type=gha
108111
cache-to: type=gha,mode=max
109-
continue-on-error: true
110112

111113
- name: Summary
112114
run: |

openstack-backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ create_backup_via_snapshot() {
124124
echo "Step 1/5: Creating snapshot of volume ${volume_name}..."
125125
local snapshot_name="temp_snap_${timestamp}_${volume_name}"
126126
local snapshot_output
127-
snapshot_output=$(openstack volume snapshot create --volume "$volume_id" --name "$snapshot_name" -f json 2>&1) || {
127+
snapshot_output=$(openstack volume snapshot create --volume "$volume_id" -f json "$snapshot_name" 2>&1) || {
128128
echo "Error: Failed to create snapshot for volume ${volume_name}: ${snapshot_output}"
129129
return 1
130130
}

0 commit comments

Comments
 (0)