-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (37 loc) · 1.16 KB
/
Makefile
File metadata and controls
43 lines (37 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!make
.DEFAULT_GOAL := help
IMAGE_NAME := tuoni-example-payload-plugin-builder
BUILD_DIR := build
JAR_NAME := tuoni-example-plugin-dotnet-payload-0.0.1.jar
##### GENERAL #####
## help: List all available make targets with descriptions
.PHONY: help
help:
@echo -e "[*] usage: make <target>"
@echo ""
@sed -nr 's/^##\s+/\t/p' $(MAKEFILE_LIST) | column -t -s ':'
## build: Build the plugin JAR inside Docker and extract to build/
.PHONY: build
build:
@mkdir -p $(BUILD_DIR)
DOCKER_BUILDKIT=1 sudo docker build \
-f scripts/docker/Dockerfile \
--target artifacts \
--output type=local,dest=$(BUILD_DIR)/ \
.
@echo ""
@echo "[+] Build complete: $(BUILD_DIR)/$(JAR_NAME)"
@echo "[+] Build complete: $(BUILD_DIR)/DotNetAgent.exe"
PLUGIN_DIR := /srv/tuoni/plugins/server
## install: Copy plugin JAR to Tuoni server and restart
.PHONY: install
install: build
sudo cp $(BUILD_DIR)/$(JAR_NAME) $(PLUGIN_DIR)/
tuoni server restart
@echo "[+] Installed $(JAR_NAME) to $(PLUGIN_DIR) and restarted tuoni"
## clean: Remove build artifacts and Docker images
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
@docker image rm $(IMAGE_NAME) 2>/dev/null || true
@echo "[+] Cleaned"