Skip to content

Commit

Permalink
Minor fixes and enhancements, edit workflow to use newer inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
YisDav committed Sep 27, 2024
1 parent 9d882fc commit c544714
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/Procedure_push_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run-name: Launch Push Docker Images - Executed by @${{ github.actor }}
run-name: Launch Push Docker Images - ${{ inputs.id }}
name: Push Docker Images

on:
Expand All @@ -8,26 +8,56 @@ on:
description: 'Docker image tag'
default: '4.10.0'
required: true
DOCKER_REFERENCE:
description: 'wazuh-docker reference'
default: 'v4.10.0'
PRODUCTS:
description: 'Comma-separated list of the image names to build and push'
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer'
required: true
FILEBEAT_MODULE_VERSION:
description: 'Filebeat module version'
required: true
REVISION:
description: 'Package revision'
default: '1'
required: true
PUSH_IMAGES:
description: 'Push images'
type: boolean
default: true
required: true
ID:
description: "ID used to identify the workflow uniquely."
type: string
required: false
workflow_call:
inputs:
IMAGE_TAG:
description: 'Docker image tag'
default: '4.10.0'
required: true
type: string
PRODUCTS:
description: 'Comma-separated list of the image names to build and push'
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer'
required: true
type: string
FILEBEAT_MODULE_VERSION:
description: 'Filebeat module version'
required: true
type: string
REVISION:
description: 'Package revision'
default: '1'
required: true
type: string
PUSH_IMAGES:
description: 'Push images'
type: boolean
default: true
required: true
ID:
description: "ID used to identify the workflow uniquely."
type: string
required: false

jobs:
build-and-push:
Expand All @@ -44,8 +74,8 @@ jobs:
echo "---------------------------------------------"
echo "Inputs provided:"
echo "---------------------------------------------"
echo "* ID: ${{ inputs.ID }}"
echo "* IMAGE_TAG: ${{ inputs.IMAGE_TAG }}"
echo "* DOCKER_REFERENCE: ${{ inputs.DOCKER_REFERENCE }}"
echo "* PRODUCTS: ${{ inputs.PRODUCTS }}"
echo "* FILEBEAT_MODULE_VERSION: ${{ inputs.FILEBEAT_MODULE_VERSION }}"
echo "* REVISION: ${{ inputs.REVISION }}"
Expand All @@ -55,12 +85,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.DOCKER_REFERENCE }}
ref: ${{ github.ref }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: wazuh
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Install Docker Compose
Expand Down Expand Up @@ -109,6 +139,6 @@ jobs:
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
docker tag wazuh/$image:${WAZUH_VERSION} ${{ secrets.DOCKERHUB_USERNAME }}/$image:$IMAGE_TAG
docker push ${{ secrets.DOCKERHUB_USERNAME }}/$image:$IMAGE_TAG
done

0 comments on commit c544714

Please sign in to comment.