forked from wazuh/wazuh-docker
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5558b87c88 | ||
|
|
e6f11f8dea | ||
|
|
ae059f2b2e | ||
|
|
07b8ca9d16 | ||
|
|
f8dbec813f | ||
|
|
905b5b9a93 | ||
|
|
024a32bc15 | ||
|
|
bfe8dc4484 | ||
|
|
ea6bc171b6 | ||
|
|
5a9355c1ae | ||
|
|
90120cd9fc |
@@ -12,6 +12,14 @@ on:
|
|||||||
- 'wazuh-agent/**'
|
- 'wazuh-agent/**'
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
||||||
|
ARTIFACT_NAMES: |
|
||||||
|
wazuh-manager.tar
|
||||||
|
wazuh-indexer.tar
|
||||||
|
wazuh-dashboard.tar
|
||||||
|
wazuh-agent.tar
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker-images:
|
build-docker-images:
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
||||||
@@ -41,33 +49,17 @@ jobs:
|
|||||||
docker save wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
docker save wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
||||||
docker save wazuh/wazuh-agent:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
docker save wazuh/wazuh-agent:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
||||||
|
|
||||||
- name: Temporarily save Wazuh manager Docker image
|
- name: Temporarily save Wazuh Docker images
|
||||||
uses: actions/upload-artifact@v7
|
env:
|
||||||
with:
|
S3_ARTIFACTS_PATH: ${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
||||||
name: docker-artifact-manager
|
run: |
|
||||||
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-manager.tar
|
echo "Uploading Docker image artifacts to S3..."
|
||||||
retention-days: 1
|
while IFS= read -r artifact; do
|
||||||
|
[ -z "$artifact" ] && continue
|
||||||
- name: Temporarily save Wazuh indexer Docker image
|
echo " Uploading: $artifact"
|
||||||
uses: actions/upload-artifact@v7
|
aws s3 cp "${ARTIFACTS_LOCAL_DIR}/${artifact}" "${S3_ARTIFACTS_PATH}/${artifact}"
|
||||||
with:
|
done <<< "$ARTIFACT_NAMES"
|
||||||
name: docker-artifact-indexer
|
echo "All artifacts uploaded successfully."
|
||||||
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-indexer.tar
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
- name: Temporarily save Wazuh dashboard Docker image
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: docker-artifact-dashboard
|
|
||||||
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
- name: Temporarily save Wazuh agent Docker image
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: docker-artifact-agent
|
|
||||||
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
check-single-node:
|
check-single-node:
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
||||||
@@ -86,32 +78,21 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh indexer Docker image
|
- name: Retrieve saved Wazuh Docker images and load them into Docker
|
||||||
uses: actions/download-artifact@v8
|
env:
|
||||||
with:
|
S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
||||||
name: docker-artifact-indexer
|
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh manager Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-manager
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh dashboard Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-dashboard
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh agent Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-agent
|
|
||||||
|
|
||||||
- name: Docker load
|
|
||||||
run: |
|
run: |
|
||||||
docker load --input ./wazuh-indexer.tar
|
mkdir -p "${ARTIFACTS_LOCAL_DIR}"
|
||||||
docker load --input ./wazuh-dashboard.tar
|
echo "Downloading and loading Docker image artifacts from S3..."
|
||||||
docker load --input ./wazuh-manager.tar
|
while IFS= read -r artifact; do
|
||||||
docker load --input ./wazuh-agent.tar
|
[ -z "$artifact" ] && continue
|
||||||
|
echo " Downloading: $artifact"
|
||||||
|
aws s3 cp "${S3_ARTIFACTS_PATH}/${artifact}" "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
||||||
|
echo " Loading into Docker: $artifact"
|
||||||
|
docker load -i "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
||||||
|
done <<< "$ARTIFACT_NAMES"
|
||||||
|
echo "All artifacts downloaded and loaded successfully."
|
||||||
|
|
||||||
- name: Create single node certficates
|
- name: Create single node certficates
|
||||||
run: docker compose -f single-node/generate-indexer-certs.yml run --rm generator
|
run: docker compose -f single-node/generate-indexer-certs.yml run --rm generator
|
||||||
@@ -233,33 +214,21 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh dashboard Docker image
|
- name: Retrieve saved Wazuh Docker images and load them into Docker
|
||||||
uses: actions/download-artifact@v8
|
env:
|
||||||
with:
|
S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
||||||
name: docker-artifact-dashboard
|
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh manager Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-manager
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh indexer Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-indexer
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh agent Docker image
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: docker-artifact-agent
|
|
||||||
|
|
||||||
- name: Docker load
|
|
||||||
run: |
|
run: |
|
||||||
docker load --input ./wazuh-manager.tar
|
mkdir -p "${ARTIFACTS_LOCAL_DIR}"
|
||||||
docker load --input ./wazuh-indexer.tar
|
echo "Downloading and loading Docker image artifacts from S3..."
|
||||||
docker load --input ./wazuh-dashboard.tar
|
while IFS= read -r artifact; do
|
||||||
docker load --input ./wazuh-agent.tar
|
[ -z "$artifact" ] && continue
|
||||||
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar wazuh-agent.tar
|
echo " Downloading: $artifact"
|
||||||
|
aws s3 cp "${S3_ARTIFACTS_PATH}/${artifact}" "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
||||||
|
echo " Loading into Docker: $artifact"
|
||||||
|
docker load -i "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
||||||
|
done <<< "$ARTIFACT_NAMES"
|
||||||
|
echo "All artifacts downloaded and loaded successfully."
|
||||||
|
|
||||||
- name: Create multi node certficates
|
- name: Create multi node certficates
|
||||||
run: docker compose -f multi-node/generate-indexer-certs.yml run --rm generator
|
run: docker compose -f multi-node/generate-indexer-certs.yml run --rm generator
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
image_tag:
|
image_tag:
|
||||||
description: 'Docker image tag'
|
description: 'Docker image tag'
|
||||||
default: '5.0.0'
|
default: 'v5.0.0-beta3'
|
||||||
required: true
|
required: true
|
||||||
docker_reference:
|
docker_reference:
|
||||||
description: 'wazuh-docker reference'
|
description: 'wazuh-docker reference'
|
||||||
@@ -14,7 +14,7 @@ on:
|
|||||||
wazuh_automation_reference:
|
wazuh_automation_reference:
|
||||||
description: 'Branch or tag of the wazuh-automation repository'
|
description: 'Branch or tag of the wazuh-automation repository'
|
||||||
required: false
|
required: false
|
||||||
default: '5.0.0'
|
default: 'v5.0.0-beta3'
|
||||||
products:
|
products:
|
||||||
description: 'Comma-separated list of the image names to build and push'
|
description: 'Comma-separated list of the image names to build and push'
|
||||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||||
@@ -42,7 +42,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
image_tag:
|
image_tag:
|
||||||
description: 'Docker image tag'
|
description: 'Docker image tag'
|
||||||
default: '5.0.0'
|
default: 'v5.0.0-beta3'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
docker_reference:
|
docker_reference:
|
||||||
@@ -52,7 +52,7 @@ on:
|
|||||||
wazuh_automation_reference:
|
wazuh_automation_reference:
|
||||||
description: 'Branch or tag of the wazuh-automation repository'
|
description: 'Branch or tag of the wazuh-automation repository'
|
||||||
required: false
|
required: false
|
||||||
default: '5.0.0'
|
default: 'v5.0.0-beta3'
|
||||||
type: string
|
type: string
|
||||||
products:
|
products:
|
||||||
description: 'Comma-separated list of the image names to build and push'
|
description: 'Comma-separated list of the image names to build and push'
|
||||||
|
|||||||
@@ -101,18 +101,24 @@ jobs:
|
|||||||
version=${{ env.VERSION }}
|
version=${{ env.VERSION }}
|
||||||
stage=${{ env.STAGE }}
|
stage=${{ env.STAGE }}
|
||||||
tag=${{ env.TAG }}
|
tag=${{ env.TAG }}
|
||||||
|
|
||||||
set_as_main=${{ inputs.set_as_main }}
|
set_as_main=${{ inputs.set_as_main }}
|
||||||
|
|
||||||
if [[ "$set_as_main" == "true" ]]; then
|
if [[ -n "$version" && -n "$stage" && "$tag" != "true" ]]; then
|
||||||
script_params="--set-as-main"
|
script_params="--version ${version} --stage ${stage}"
|
||||||
|
elif [[ -n "$version" && -n "$stage" && "$tag" == "true" ]]; then
|
||||||
|
script_params="--version ${version} --stage ${stage} --tag"
|
||||||
|
elif [[ -z "$version" && -n "$stage" && "$tag" == "true" ]]; then
|
||||||
|
script_params="--stage ${stage} --tag"
|
||||||
|
elif [[ -z "$version" && -z "$stage" && "$tag" == "true" ]]; then
|
||||||
|
script_params="--tag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Both version and stage provided
|
if [[ "$set_as_main" == "true" ]]; then
|
||||||
if [[ -n "$version" && -n "$stage" && "$tag" != "true" ]]; then
|
if [[ -z "$version" || -z "$stage" ]]; then
|
||||||
script_params+=" --version ${version} --stage ${stage}"
|
echo "Error: set_as_main requires both version and stage inputs."
|
||||||
elif [[ -n "$version" && -n "$stage" && "$tag" == "true" ]]; then
|
exit 1
|
||||||
script_params+=" --version ${version} --stage ${stage} --tag ${tag}"
|
fi
|
||||||
|
script_params="${script_params} --set-as-main"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
issue_number=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}')
|
issue_number=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}')
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ on:
|
|||||||
automation_reference:
|
automation_reference:
|
||||||
description: 'Branch of wazuh-automation to use'
|
description: 'Branch of wazuh-automation to use'
|
||||||
required: false
|
required: false
|
||||||
default: '5.0.0'
|
default: 'v5.0.0-beta3'
|
||||||
type: string
|
type: string
|
||||||
deployment_type:
|
deployment_type:
|
||||||
description: 'Deployment type to test'
|
description: 'Deployment type to test'
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Bumper script issue when the tag is set to false ([#2477](https://github.com/wazuh/wazuh-docker/issues/2477))
|
||||||
- Fix reported WF vulnerabilities ([#2443](https://github.com/wazuh/wazuh-docker/issues/2443))
|
- Fix reported WF vulnerabilities ([#2443](https://github.com/wazuh/wazuh-docker/issues/2443))
|
||||||
- Adapt Wazuh manager healthcheck with local binaries ([#2422](https://github.com/wazuh/wazuh-docker/issues/2422))
|
- Adapt Wazuh manager healthcheck with local binaries ([#2422](https://github.com/wazuh/wazuh-docker/issues/2422))
|
||||||
- The Wazuh Docker image cannot be built during the Nightly ([#2337](https://github.com/wazuh/wazuh-docker/issues/2337))
|
- The Wazuh Docker image cannot be built during the Nightly ([#2337](https://github.com/wazuh/wazuh-docker/issues/2337))
|
||||||
|
|||||||
+9
-9
@@ -24,15 +24,15 @@ Below is a step-by-step example of how to perform this update:
|
|||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
wazuh.manager:
|
wazuh.manager:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh.indexer:
|
wazuh.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:5.0.0
|
image: wazuh/wazuh-dashboard:5.0.0-beta3
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -48,27 +48,27 @@ Below is a step-by-step example of how to perform this update:
|
|||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
wazuh.master:
|
wazuh.master:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh.worker:
|
wazuh.worker:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh1.indexer:
|
wazuh1.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh2.indexer:
|
wazuh2.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh3.indexer:
|
wazuh3.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
...
|
...
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:5.0.0
|
image: wazuh/wazuh-dashboard:5.0.0-beta3
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.master:
|
wazuh.master:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
hostname: wazuh.master
|
hostname: wazuh.master
|
||||||
container_name: multi-node-wazuh.master
|
container_name: multi-node-wazuh.master
|
||||||
restart: always
|
restart: always
|
||||||
@@ -44,7 +44,7 @@ services:
|
|||||||
- ./config/wazuh_master/certs/wazuh.master-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
- ./config/wazuh_master/certs/wazuh.master-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||||
|
|
||||||
wazuh.worker:
|
wazuh.worker:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
hostname: wazuh.worker
|
hostname: wazuh.worker
|
||||||
container_name: multi-node-wazuh.worker
|
container_name: multi-node-wazuh.worker
|
||||||
restart: always
|
restart: always
|
||||||
@@ -83,7 +83,7 @@ services:
|
|||||||
- ./config/wazuh_worker/certs/wazuh.worker-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
- ./config/wazuh_worker/certs/wazuh.worker-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||||
|
|
||||||
wazuh1.indexer:
|
wazuh1.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
hostname: wazuh1.indexer
|
hostname: wazuh1.indexer
|
||||||
container_name: multi-node-wazuh1.indexer
|
container_name: multi-node-wazuh1.indexer
|
||||||
restart: always
|
restart: always
|
||||||
@@ -121,7 +121,7 @@ services:
|
|||||||
- ./config/wazuh1_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
- ./config/wazuh1_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
||||||
|
|
||||||
wazuh2.indexer:
|
wazuh2.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
hostname: wazuh2.indexer
|
hostname: wazuh2.indexer
|
||||||
container_name: multi-node-wazuh2.indexer
|
container_name: multi-node-wazuh2.indexer
|
||||||
restart: always
|
restart: always
|
||||||
@@ -159,7 +159,7 @@ services:
|
|||||||
- ./config/wazuh2_indexer/certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
- ./config/wazuh2_indexer/certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||||
|
|
||||||
wazuh3.indexer:
|
wazuh3.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
hostname: wazuh3.indexer
|
hostname: wazuh3.indexer
|
||||||
container_name: multi-node-wazuh3.indexer
|
container_name: multi-node-wazuh3.indexer
|
||||||
restart: always
|
restart: always
|
||||||
@@ -197,7 +197,7 @@ services:
|
|||||||
- ./config/wazuh3_indexer/certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
- ./config/wazuh3_indexer/certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:5.0.0
|
image: wazuh/wazuh-dashboard:5.0.0-beta3
|
||||||
hostname: wazuh.dashboard
|
hostname: wazuh.dashboard
|
||||||
container_name: multi-node-wazuh.dashboard
|
container_name: multi-node-wazuh.dashboard
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.manager:
|
wazuh.manager:
|
||||||
image: wazuh/wazuh-manager:5.0.0
|
image: wazuh/wazuh-manager:5.0.0-beta3
|
||||||
hostname: wazuh.manager
|
hostname: wazuh.manager
|
||||||
container_name: single-node-wazuh.manager
|
container_name: single-node-wazuh.manager
|
||||||
restart: always
|
restart: always
|
||||||
@@ -44,7 +44,7 @@ services:
|
|||||||
- ./config/wazuh_manager/certs/wazuh.manager-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
- ./config/wazuh_manager/certs/wazuh.manager-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||||
|
|
||||||
wazuh.indexer:
|
wazuh.indexer:
|
||||||
image: wazuh/wazuh-indexer:5.0.0
|
image: wazuh/wazuh-indexer:5.0.0-beta3
|
||||||
hostname: wazuh.indexer
|
hostname: wazuh.indexer
|
||||||
container_name: single-node-wazuh.indexer
|
container_name: single-node-wazuh.indexer
|
||||||
restart: always
|
restart: always
|
||||||
@@ -81,7 +81,7 @@ services:
|
|||||||
- ./config/wazuh_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
- ./config/wazuh_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:5.0.0
|
image: wazuh/wazuh-dashboard:5.0.0-beta3
|
||||||
hostname: wazuh.dashboard
|
hostname: wazuh.dashboard
|
||||||
container_name: single-node-wazuh.dashboard
|
container_name: single-node-wazuh.dashboard
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
+80
-56
@@ -9,6 +9,8 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|||||||
LOG_FILE="${DIR}/tools/repository_bumper_$(date +"%Y-%m-%d_%H-%M-%S-%3N").log"
|
LOG_FILE="${DIR}/tools/repository_bumper_$(date +"%Y-%m-%d_%H-%M-%S-%3N").log"
|
||||||
VERSION=""
|
VERSION=""
|
||||||
STAGE=""
|
STAGE=""
|
||||||
|
TAG=""
|
||||||
|
REFERENCE=""
|
||||||
FILES_EDITED=()
|
FILES_EDITED=()
|
||||||
FILES_EXCLUDED='--exclude="repository_bumper_*.log" --exclude="CHANGELOG.md" --exclude="repository_bumper.sh" --exclude="*_bumper_repository.yml" --exclude="mermaid-init.js" --exclude="mermaid.min.js"'
|
FILES_EXCLUDED='--exclude="repository_bumper_*.log" --exclude="CHANGELOG.md" --exclude="repository_bumper.sh" --exclude="*_bumper_repository.yml" --exclude="mermaid-init.js" --exclude="mermaid.min.js"'
|
||||||
|
|
||||||
@@ -74,40 +76,44 @@ update_stage_in_files() {
|
|||||||
FILES_EDITED+=("${file}")
|
FILES_EDITED+=("${file}")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
if [ $STAGE != "alpha0" ]; then
|
# Compute the value written into branch reference defaults ("<key>: '...'").
|
||||||
version_tag_string=": 'v${VERSION}'"
|
# Without --tag, references stay branch-like (e.g. 5.0.0).
|
||||||
files_tag=( $(grep_command "${version_tag_string}" "${DIR}") )
|
# With --tag, references become tag-like (e.g. v5.0.0-beta3), or a plain release
|
||||||
for file in "${files_tag[@]}"; do
|
# tag (e.g. v5.0.0) when no stage is provided.
|
||||||
sed -i -E "s/(: )'v${VERSION}'/\1'v${VERSION}-${STAGE}'/g" "${file}"
|
build_reference() {
|
||||||
if [[ $(git diff --name-only "${file}") ]]; then
|
if [[ -n "$TAG" ]]; then
|
||||||
FILES_EDITED+=("${file}")
|
if [[ -z "$STAGE" ]]; then
|
||||||
fi
|
REFERENCE="v${VERSION}"
|
||||||
done
|
else
|
||||||
|
REFERENCE="v${VERSION}-${STAGE}"
|
||||||
version_number_string=": '${VERSION}'"
|
fi
|
||||||
files_version=( $(grep -RlE ": '[0-9]\.[0-9]+\.[0-9]+'" "${DIR}") )
|
else
|
||||||
for file in "${files_version[@]}"; do
|
REFERENCE="${VERSION}"
|
||||||
sed -i -E "s/(: )'${VERSION}'/\1'v${VERSION}-${STAGE}'/g" "${file}"
|
|
||||||
if [[ $(git diff --name-only "${file}") ]]; then
|
|
||||||
FILES_EDITED+=("${file}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Tag mode only: normalize every reference to the current version
|
||||||
|
# (branch-like "5.0.0", "v5.0.0" or "v5.0.0-<stage>") into ${REFERENCE}.
|
||||||
|
# Matching is restricted to "<key>: '...'" entries so plain version strings
|
||||||
|
# elsewhere in the repository are left untouched.
|
||||||
|
update_tag_references() {
|
||||||
|
local V_ESC="${VERSION//./\\.}"
|
||||||
|
files=( $(grep_command "${VERSION}" "${DIR}") )
|
||||||
|
for file in "${files[@]}"; do
|
||||||
|
sed -Ei "s/(:[[:space:]]*')v?${V_ESC}(-[A-Za-z0-9]+)?(')/\1${REFERENCE}\3/g" "${file}"
|
||||||
|
if [[ $(git diff --name-only "${file}") ]]; then
|
||||||
|
FILES_EDITED+=("${file}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
update_main_in_files() {
|
update_main_in_files() {
|
||||||
if [[ $STAGE == "alpha0" ]]; then
|
local main_string=": 'main'"
|
||||||
bump_value="${VERSION}"
|
|
||||||
else
|
|
||||||
bump_value="v${VERSION}"
|
|
||||||
fi
|
|
||||||
main_string=": 'main'"
|
|
||||||
files=( $(grep_command "${main_string}" "${DIR}") )
|
files=( $(grep_command "${main_string}" "${DIR}") )
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
if [[ "$skip_urls" != "yes" ]]; then
|
sed -Ei "s/(:[[:space:]])'main'/\1'${REFERENCE}'/g" "${file}"
|
||||||
sed -Ei "s/(:[[:space:]])'main'/\1'${bump_value}'/g" "${file}"
|
|
||||||
fi
|
|
||||||
if [[ $(git diff --name-only "${file}") ]]; then
|
if [[ $(git diff --name-only "${file}") ]]; then
|
||||||
FILES_EDITED+=("${file}")
|
FILES_EDITED+=("${file}")
|
||||||
fi
|
fi
|
||||||
@@ -141,8 +147,8 @@ main() {
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--tag)
|
--tag)
|
||||||
TAG="$2"
|
TAG="yes"
|
||||||
shift 2
|
shift 1
|
||||||
;;
|
;;
|
||||||
--set-as-main)
|
--set-as-main)
|
||||||
set_as_main="yes"
|
set_as_main="yes"
|
||||||
@@ -155,15 +161,33 @@ main() {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Validate arguments
|
# --tag rewrites branch references into tag-like references (e.g. v5.0.0-beta3)
|
||||||
if [[ -z "${VERSION}" ]]; then
|
# and re-tags the Docker images accordingly. It is mutually exclusive with
|
||||||
echo "Error: --version argument is required." | tee -a "${LOG_FILE}"
|
# --set-as-main, which keeps references on main.
|
||||||
|
if [[ -n "$TAG" && -n "$set_as_main" ]]; then
|
||||||
|
echo "Error: --tag cannot be combined with --set-as-main." | tee -a "${LOG_FILE}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${STAGE}" ]]; then
|
# Read the current version/stage early: tag scenarios may omit --version and/or
|
||||||
echo "Error: --stage argument is required." | tee -a "${LOG_FILE}"
|
# --stage and reuse the values already stored in VERSION.json.
|
||||||
exit 1
|
get_old_version_and_stage
|
||||||
|
|
||||||
|
# Resolve and validate arguments depending on the mode
|
||||||
|
if [[ -n "$TAG" ]]; then
|
||||||
|
# Tag mode: version defaults to the current one; stage is optional
|
||||||
|
# (absent yields a release tag without a stage suffix).
|
||||||
|
[[ -z "$VERSION" ]] && VERSION="$OLD_VERSION"
|
||||||
|
else
|
||||||
|
# Branch mode: a full version + stage bump is required
|
||||||
|
if [[ -z "${VERSION}" ]]; then
|
||||||
|
echo "Error: --version argument is required." | tee -a "${LOG_FILE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -z "${STAGE}" ]]; then
|
||||||
|
echo "Error: --stage argument is required." | tee -a "${LOG_FILE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate if version is in the correct format
|
# Validate if version is in the correct format
|
||||||
@@ -172,28 +196,25 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate if stage is in the correct format
|
# Validate if stage is in the correct format (when provided)
|
||||||
STAGE=$(echo "${STAGE}" | tr '[:upper:]' '[:lower:]')
|
if [[ -n "${STAGE}" ]]; then
|
||||||
if ! [[ "${STAGE}" =~ ^(alpha[0-9]*|beta[0-9]*|rc[0-9]*|stable)$ ]]; then
|
STAGE=$(echo "${STAGE}" | tr '[:upper:]' '[:lower:]')
|
||||||
echo "Error: Stage must be one of the following examples: alpha1, beta1, rc1, stable." | tee -a "${LOG_FILE}"
|
if ! [[ "${STAGE}" =~ ^(alpha[0-9]*|beta[0-9]*|rc[0-9]*|stable)$ ]]; then
|
||||||
exit 1
|
echo "Error: Stage must be one of the following examples: alpha1, beta1, rc1, stable." | tee -a "${LOG_FILE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set skip_urls variable based on set_as_main flag
|
# Compute the value written into branch reference defaults
|
||||||
|
build_reference
|
||||||
|
echo "Reference for branch defaults: ${REFERENCE}" | tee -a "${LOG_FILE}"
|
||||||
|
|
||||||
|
# Convert 'main' references unless they must keep pointing to main (set-as-main)
|
||||||
if [[ -z "$set_as_main" ]]; then
|
if [[ -z "$set_as_main" ]]; then
|
||||||
echo "Updating version from main to $VERSION" | tee -a "${LOG_FILE}"
|
echo "Updating 'main' references to ${REFERENCE}" | tee -a "${LOG_FILE}"
|
||||||
update_main_in_files "$VERSION" "$STAGE"
|
update_main_in_files
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate if tag is true or false
|
|
||||||
if [[ -n "${TAG}" && ! "${TAG}" =~ ^(true|false)$ ]]; then
|
|
||||||
echo "Error: --tag must be either true or false." | tee -a "${LOG_FILE}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get old version and stage
|
|
||||||
get_old_version_and_stage
|
|
||||||
|
|
||||||
if [[ "${OLD_VERSION}" != "${VERSION}" ]]; then
|
if [[ "${OLD_VERSION}" != "${VERSION}" ]]; then
|
||||||
echo "Updating version from ${OLD_VERSION} to ${VERSION}" | tee -a "${LOG_FILE}"
|
echo "Updating version from ${OLD_VERSION} to ${VERSION}" | tee -a "${LOG_FILE}"
|
||||||
update_version_in_files "${VERSION}"
|
update_version_in_files "${VERSION}"
|
||||||
@@ -203,10 +224,13 @@ main() {
|
|||||||
update_stage_in_files "$VERSION" "$STAGE"
|
update_stage_in_files "$VERSION" "$STAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Docker images tag if tag is true
|
# Tag mode: normalize remaining version references and re-tag the Docker images
|
||||||
if [[ "${TAG}" == "true" ]]; then
|
# (image tags carry no leading 'v', e.g. 5.0.0-beta3).
|
||||||
echo "Updating Docker images tag to ${VERSION}-${STAGE}" | tee -a "${LOG_FILE}"
|
if [[ -n "$TAG" ]]; then
|
||||||
update_docker_images_tag "${VERSION}-${STAGE}"
|
echo "Updating version references to tag reference ${REFERENCE}" | tee -a "${LOG_FILE}"
|
||||||
|
update_tag_references
|
||||||
|
echo "Updating Docker images tag to ${REFERENCE#v}" | tee -a "${LOG_FILE}"
|
||||||
|
update_docker_images_tag "${REFERENCE#v}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.agent:
|
wazuh.agent:
|
||||||
image: wazuh/wazuh-agent:5.0.0
|
image: wazuh/wazuh-agent:5.0.0-beta3
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
||||||
|
|||||||
Reference in New Issue
Block a user