Enhance script execution of build and improve docs clarity

This commit is contained in:
Jesus Garcia
2025-12-17 01:37:49 -05:00
parent 424559518e
commit 089ce24ffc
3 changed files with 23 additions and 11 deletions
+11 -4
View File
@@ -42,7 +42,7 @@ build() {
if [ "${WAZUH_DEV_STAGE}" ];then
FILEBEAT_TEMPLATE_BRANCH="v${FILEBEAT_TEMPLATE_BRANCH}-${WAZUH_DEV_STAGE,,}"
if ! curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/${FILEBEAT_TEMPLATE_BRANCH}"; then
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
clean 1
fi
else
@@ -71,9 +71,16 @@ build() {
set +a
if [ "${MULTIARCH}" ];then
docker buildx bake --file build-images.yml --push --set *.platform=linux/amd64,linux/arm64 --no-cache || clean 1
docker buildx bake \
--file build-images.yml \
--push \
--set *.platform=linux/amd64,linux/arm64 \
--no-cache || clean 1
else
docker buildx bake --file build-images.yml --no-cache|| clean 1
docker buildx bake \
--file build-images.yml \
--load \
--no-cache || clean 1
fi
return 0
}
@@ -167,4 +174,4 @@ main() {
clean 0
}
main "$@"
main "$@"
+4 -4
View File
@@ -21,7 +21,7 @@ Run the following script to build the wazuh-certs-generator docker image
./build-image.sh -v <IMAGE_TAG> [-m] [-rg <REGISTRY>]
```
Replace <IMAGE_TAG> with the new image desired tag.
Use the `-m` flag to build a multi-architecture image (supports both `amd64` and `arm64`)
Use the `-rg <REGISTRY>` parameter to specify a custom Docker registry (default is Docker Hub)
By default, the script will attempt to push the image to the registry and will only work if credentials are properly configured.
- Replace <IMAGE_TAG> with the new image desired tag.
- Use the `-m` flag to build a multi-architecture image (supports both `amd64` and `arm64`)
- If multiarch build is enabled, the script will attempt to push the image to the specified registry. This image upload will only work if credentials are properly configured.
- Use the `-rg <REGISTRY>` parameter to specify a custom Docker registry (default is Docker Hub)
+8 -3
View File
@@ -37,11 +37,16 @@ build() {
set +a
if [ "${MULTIARCH}" ]; then
docker buildx bake --file build-image.yml \
docker buildx bake \
--file build-image.yml \
--set *.platform=linux/amd64,linux/arm64 \
--push \
--no-cache || clean 1
else
docker buildx bake --file build-image.yml --no-cache || clean 1
docker buildx bake \
--file build-image.yml \
--load \
--no-cache || clean 1
fi
return 0
}
@@ -99,4 +104,4 @@ main() {
clean 0
}
main "$@"
main "$@"