Skip to content

Commit

Permalink
changes for makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
pyToshka committed Jan 8, 2024
1 parent d9c0bcc commit c342105
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
32 changes: 26 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
VERSION ?= v4.3.10

.PHONY: help
help: ## Help for usage
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
all: docker

docker:
build-minideb: ## Build Wazuh Agent minideb based
docker build -t kennyopennix/wazuh-agent:latest . && \
docker build -t kennyopennix/wazuh-agent:$(VERSION) .
docker tag kennyopennix/wazuh-agent:latest kennyopennix/wazuh-agent:$(VERSION)

build-amazon-linux: ## Build Wazuh Agent amazon linux based
docker build -f ./images/Dockerfie.amazonlinux -t kennyopennix/wazuh-agent-amazonlinux:latest . && \
docker tag kennyopennix/wazuh-agent-amazonlinux:latest kennyopennix/wazuh-agent-amazonlinux:$(VERSION)

build-ubuntu: ## Build Wazuh Agent ubuntu linux based
docker build -f ./images/Dockerfie.ubuntu -t kennyopennix/wazuh-agent-ubuntu:latest . && \
docker tag kennyopennix/wazuh-agent-ubuntu:latest kennyopennix/wazuh-agent-ubuntu:$(VERSION)

docker-run:
docker-run: ## Run Wazuh Agent docker image minideb based
docker run kennyopennix/wazuh-agent:$(VERSION)

docker-push:
docker-push-minideb: ## Push Wazuh Agent docker image minideb based
docker push kennyopennix/wazuh-agent:latest && \
docker push kennyopennix/wazuh-agent:$(VERSION)

docker-push-amazon-linux: ## Push Wazuh Agent docker image amazon linux based
docker push kennyopennix/wazuh-agent-amazonlinux:latest && \
docker push kennyopennix/wazuh-agent-amazonlinux:$(VERSION)

docker-push-ubuntu: ## Push Wazuh Agent docker image ubuntu linux based
docker push kennyopennix/wazuh-agent-ubuntu:latest && \
docker push kennyopennix/wazuh-agent-ubuntu:$(VERSION)

docker-buildx:
docker buildx build --push -t kennyopennix/wazuh-agent:$(VERSION) --cache-to type=local,dest=./tmp/ --cache-from type=local,src=./tmp/ .

run-local:
run-local: ## Run docker compose stack with all agents on board
docker compose -f tests/single-node/generate-indexer-certs.yml run --rm generator
docker compose -f docker-compose.yml up -d --build
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The Simplest way of running the container
docker run --rm kennyopennix/wazuh-agent:latest
```
## Run docker-compose

Generate certificates
```shell
docker compose -f tests/single-node/generate-indexer-certs.yml run --rm generator
Expand All @@ -68,6 +69,20 @@ docker compose up -d

Will run Wazuh cluster in single node mode and 3 agents

## Use Makefile
```shell
make
help Help for usage
build-minideb Build Wazuh Agent minideb based
build-amazon-linux Build Wazuh Agent amazon linux based
build-ubuntu Build Wazuh Agent ubuntu linux based
docker-run Run Wazuh Agent docker image minideb based
docker-push-minideb Push Wazuh Agent docker image minideb based
docker-push-amazon-linux Push Wazuh Agent docker image amazon linux based
docker-push-ubuntu Push Wazuh Agent docker image ubuntu linux based
run-local Run docker compose stack with all agents on board

```
## Advanced usage

```bash
Expand Down

0 comments on commit c342105

Please sign in to comment.