Skip to content

Commit

Permalink
Modify push docker image procedure to support adding a '-dev' suffix …
Browse files Browse the repository at this point in the history
…to the image tag
  • Loading branch information
YisDav committed Sep 30, 2024
1 parent b5ac3e0 commit 69bc790
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/Procedure_push_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ on:
description: "ID used to identify the workflow uniquely."
type: string
required: false
dev:
description: "Add tag suffix '-dev' to the image tag ?"
type: boolean
default: false
required: false
workflow_call:
inputs:
image_tag:
Expand Down Expand Up @@ -67,6 +72,11 @@ on:
description: "ID used to identify the workflow uniquely."
type: string
required: false
dev:
description: "Add tag suffix '-dev' to the image tag ?"
type: boolean
default: false
required: false

jobs:
build-and-push:
Expand Down Expand Up @@ -144,11 +154,16 @@ jobs:
- name: Tag and Push Wazuh images
if: ${{ inputs.push_images }}
run: |
IMAGE_TAG=${{ inputs.image_tag }}
# IMAGE_TAG=${{ inputs.image_tag }}
# Add '-dev' suffix to the image tag if 'dev' input is set to true, else use inputs.image_tag
IMAGE_TAG=${{ inputs.image_tag }}${{ inputs.dev && '-dev' || '' }}
IMAGE_NAMES=${{ inputs.products }}
IFS=',' read -r -a images <<< "$IMAGE_NAMES"
for image in "${images[@]}"; do
echo "Tagging and pushing wazuh/$image:${WAZUH_VERSION} to wazuh/$image:$IMAGE_TAG"
docker tag wazuh/$image:${WAZUH_VERSION} wazuh/$image:$IMAGE_TAG
docker push wazuh/$image:$IMAGE_TAG
echo "Pushing wazuh/$image:$IMAGE_TAG ..."
# docker push wazuh/$image:$IMAGE_TAG
done

0 comments on commit 69bc790

Please sign in to comment.