From 69bc790ba6cbbf68cad05ac0b79c824dbbcd83c0 Mon Sep 17 00:00:00 2001 From: "JESUS D. GARCIA" Date: Mon, 30 Sep 2024 12:59:53 -0500 Subject: [PATCH] Modify push docker image procedure to support adding a '-dev' suffix to the image tag --- .../Procedure_push_docker_images.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Procedure_push_docker_images.yml b/.github/workflows/Procedure_push_docker_images.yml index 3fcb50ad..e013cc0e 100644 --- a/.github/workflows/Procedure_push_docker_images.yml +++ b/.github/workflows/Procedure_push_docker_images.yml @@ -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: @@ -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: @@ -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