@@ -36,25 +36,25 @@ DOCKER_VERSION = $(shell $(DOCKER) --version)
36
36
37
37
# Default target
38
38
.PHONY : help
39
- help : # # Show this help message (*=outside **=inside the dev- container)
39
+ help : # # Show this help message (*=outside **=inside the development container)
40
40
@awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST )
41
41
42
- # Common function to check if inside or outside the dev- container
42
+ # Common function to check if inside or outside the development container
43
43
check-container-state = \
44
44
if [ "$$IN_DEV_CONTAINER" = "$(1 ) " ]; then \
45
- printf "$(RED ) Error: This target can only be run $(2 ) the dev- container$(RESET ) \n"; \
45
+ printf "$(RED ) Error: This target can only be run $(2 ) the development container$(RESET ) \n"; \
46
46
exit 1; \
47
47
fi
48
48
49
49
# Conditional targets based on the environment
50
- .PHONY : dev dev-cntnr run login rm-cntnr rm-image get-geodb build clean info
51
- dev : dev-cntnr run login # # Build, run and login into the dev- container (*)
50
+ .PHONY : dev . dev-cntnr run login . rm-cntnr rm-dev get-geodb get-licenses build clean info
51
+ dev : . dev-cntnr . run login # # Build, run and login into the development container (*)
52
52
53
- dev-cntnr : # # Build the dev- container (*)
53
+ . dev-cntnr : # # Build the development container (*)
54
54
@$(call check-container-state,true,outside)
55
55
cd .devcontainer && $(DOCKER ) build -f Dockerfile -t $(IMAGE_NAME ) .
56
56
57
- run : # # Run the dev- container (*)
57
+ run : # # Run the development container (*)
58
58
@$(call check-container-state,true,outside)
59
59
@$(DOCKER ) run -d \
60
60
-v /var/run/docker.sock:/var/run/docker.sock \
@@ -65,16 +65,16 @@ run: ## Run the dev-container (*)
65
65
$(IMAGE_NAME ) \
66
66
sleep infinity
67
67
68
- login : # # Login into the running dev- container (*)
68
+ login : # # Log in to the running development container (*)
69
69
@$(call check-container-state,true,outside)
70
70
@$(DOCKER ) exec -it -w $(WORKDIR ) $(CONTAINER_NAME ) /bin/bash
71
71
72
- rm-cntnr : # # Stop and remove the dev- container (*)
72
+ . rm-cntnr : # # Stop and remove the development container (*)
73
73
@$(call check-container-state,true,outside)
74
74
@$(DOCKER ) stop $(CONTAINER_NAME ) || true
75
75
@$(DOCKER ) rm $(CONTAINER_NAME ) || true
76
76
77
- rm-image : # # Remove the dev- image (*)
77
+ rm-dev : .rm-cntnr # # Stop the development container, then remove both its container and image. (*)
78
78
@$(call check-container-state,true,outside)
79
79
@$(DOCKER ) rmi -f $(IMAGE_NAME ) || exit 1
80
80
@@ -83,6 +83,10 @@ get-geodb: ## Fetch latest GeoLite2-City (MaxMind.com) CDN files
83
83
wget -qO- https://cdn.jsdelivr.net/npm/geolite2-city/GeoLite2-City.mmdb.gz | \
84
84
gunzip -c > etc/master/conf/GeoLite2-City.mmdb
85
85
86
+ get-licenses : # # Fetch license information for all dependencies (**)
87
+ @$(call check-container-state,"",inside)
88
+ @mvn license:download-licenses
89
+
86
90
build : # # Compile java sources into JARs, create RPMs and Docker images (**)
87
91
@$(call check-container-state,"",inside)
88
92
@mvn package
@@ -97,9 +101,9 @@ clean: ## Stop containers, remove images, JARs, RPMs and dependencies (**)
97
101
98
102
info : # # Output the configuration
99
103
@if [ -n " $( IN_DEV_CONTAINER) " ]; then \
100
- printf " $( GREEN) ** You are INSIDE the dev- container **$( RESET) \n" ; \
104
+ printf " $( GREEN) ** You are INSIDE the development container **$( RESET) \n" ; \
101
105
else \
102
- printf " $( RED) ** You are OUTSIDE the dev- container **$( RESET) \n" ; \
106
+ printf " $( RED) ** You are OUTSIDE the development container **$( RESET) \n" ; \
103
107
fi
104
108
@echo " Software tag number: $( TAG) "
105
109
@echo " Docker host/current OS: $( DOCKER_HOST_OS) /$( DOCKER_GUEST_OS) "
0 commit comments