Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
alecrabbit committed Mar 6, 2023
1 parent e017dad commit fca11d7
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 69 deletions.
24 changes: 24 additions & 0 deletions .dam/make/.core/docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,27 @@ _docker_generate_stack:
@${_ECHO} "\n${_C_INFO} Generating stack file...${_C_STOP}\n";
@${_DOCKER_COMP} ${_FILES} config > ${_DC_STACK_FILE}
@${_ECHO_OK}

##
## —— Docker 🐳 ————————————————————————————————————————————————————————————————
up: _docker_up time_current ## Start the docker hub in detached mode

down: _docker_down time_current ## Stop the docker hub

reload: _docker_down _docker_generate_stack _docker_up _docker_ps time_current ## Recreate stack file, restart the docker hub and show the current status

restart: _docker_down _docker_up time_current ## Restart the docker hub

ps: _docker_ps time_current ## List all running containers

clear: _docker_down_clear cleanup time_current ## Stop the docker hub, remove volumes and cleanup the project

cleanup: _do_project_cleanup ## Do project cleanup

cfg: _docker_config time_current ## Display docker-compose config

logs: _docker_logs ## Show live logs

stack: _docker_config _docker_generate_stack time_current ## Show docker-compose config and Generate docker-compose stack file

build: _docker_pull _docker_build time_current ## Build the docker images
18 changes: 18 additions & 0 deletions .dam/make/.dist/.cp/dist.install.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include ./.dam/make/.dist/*
include ./.dam/make/.core/*
include ./.dam/make/.dist/.test/*

## ——————————————————————————————— #️⃣ Makefile #️⃣ ——————————————————————————————
##
help: ## Outputs this help screen
@grep -h -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "${_C_GREEN}%-30s${_C_STOP} %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'

##
## —— Installation 🏗️ ——————————————————————————-———————————————————————————————
install: _install ## Perform installation procedure
uninstall: _uninstall_not_possible ## Run uninstall procedure

init: _init_not_possible ## Initialize project and start docker hub

%: ## unknown target
@${_ECHO} "${_C_ERROR} ERROR ${_C_STOP} Unknown target: ${_C_YELLOW}$@${_C_STOP}"
46 changes: 0 additions & 46 deletions .dam/make/.dist/.cp/main.Makefile

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion .dam/make/.include/dummy.Makefile

This file was deleted.

16 changes: 14 additions & 2 deletions .dam/make/core.Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
include ./.make/.core/*
include ./.make/.include/*
include ./.dam/make/.core/*
ifneq ("$(wildcard $(_INCLUDE_DIR)/*.Makefile)","")
include $(wildcard $(_INCLUDE_DIR)/*.Makefile)
endif
include ${_PROJECT_DIR}/project.Makefile
include ./.dam/var.Makefile

## ——————————————————————————————— #️⃣ Makefile #️⃣ ——————————————————————————————
##
help: ## Outputs this help screen
@grep -h -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "${_C_GREEN}%-30s${_C_STOP} %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
@${_ECHO} "";

%: ## unknown target
@${_ECHO} "${_C_ERROR} ERROR ${_C_STOP} Unknown target: ${_C_YELLOW}$@${_C_STOP}"
8 changes: 7 additions & 1 deletion .dam/make/project/project.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ include ${_PROJECT_DIR}/project.install.Makefile

PROJECT_SEL=${_C_SELECT} ${PROJECT_NAME} ${_C_STOP}

##
## —— Project 🚧 ———————————————————————————————————————————————————————————————
init: _initialize ## Initialize project and start docker hub

chown: ## Change the owner(user) of the project
sudo chown -R ${USER_ID}:${GROUP_ID} .

project_info: ## Outputs project information
@${_ECHO} "\n${PROJECT_SEL} ${_C_INFO} Project info...${_C_STOP}\n";
@${_ECHO_DISABLED};
Expand All @@ -13,4 +20,3 @@ env_reset: ## Resets environment variables
@cp -v ${_ENV_DIST_FILE} ${_ENV_FILE};
@${_ECHO};
@${_ECHO_OK};

18 changes: 18 additions & 0 deletions .dam/var.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ifeq ($(wildcard $(_ENV_FILE)),)
# file does not exist
else
include $(_ENV_FILE) # to include environment variables
endif

PROJECT_NAME=project.name
PROJECT_SHORT_TITLE=✨

# DO NOT EDIT! See _VAR_FILE variable
# Git related variables
WORKING_BRANCH=dev
DEFAULT_COMMIT_MESSAGE=~wp

# Docker compose files

# _FILES = -f ${_DOCKER_COMPOSE_FILE} -f docker-compose.override.${_DC_EXTENSION}
_FILES = -f ${_DOCKER_COMPOSE_FILE}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.env
20 changes: 2 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
include ./.dam/make/.dist/*
include ./.dam/make/.core/*
include ./.dam/make/.dist/.test/*

## ——————————————————————————————— #️⃣ Makefile #️⃣ ——————————————————————————————
##
help: ## Outputs this help screen
@grep -h -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "${_C_GREEN}%-30s${_C_STOP} %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'

##
## —— Installation 🏗️ ——————————————————————————-———————————————————————————————
install: _install ## Perform installation procedure
uninstall: _uninstall_not_possible ## Run uninstall procedure

init: _init_not_possible ## Initialize project and start docker hub

%: ## unknown target
@${_ECHO} "${_C_ERROR} ERROR ${_C_STOP} Unknown target: ${_C_YELLOW}$@${_C_STOP}"
# Include core
include ./.dam/make/core.Makefile
2 changes: 1 addition & 1 deletion TERMINAL_TITLE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
🐮 Dev App
🚧 Project

0 comments on commit fca11d7

Please sign in to comment.