env can modify size and time of uploads
This commit is contained in:
17
Makefile
17
Makefile
@@ -24,14 +24,9 @@ RESET = "\e[0m"
|
||||
|
||||
COMPOSE = ./srcs/docker-compose.yml
|
||||
|
||||
# same as 'LOGIN' var in .env file
|
||||
#V_USER = hulamy
|
||||
#V_USER = $(shell echo $(USER)) # gives root when make is run with sudo
|
||||
#V_USER = $(shell who | head -1 | tr " " "\n" | head -1) # gives bad result when in `sudo su`
|
||||
#V_USER = $(shell who | head -1 | cut -d " " -f 1) # gives bad result when in `sudo su`
|
||||
V_USER = $(shell users | tr " " "\n" | head -1)
|
||||
VOLUMES_D = /home/$(V_USER)/data/wp_volume \
|
||||
/home/$(V_USER)/data/db_volume
|
||||
VOLUME_PATH = $(shell grep "MAP_VOLUMES" ./srcs/.env | cut -d "=" -f 2)
|
||||
VOLUMES_D = $(VOLUME_PATH)/wp_volume \
|
||||
$(VOLUME_PATH)/db_volume
|
||||
WP_URL = $(shell grep "WP_URL" ./srcs/.env | cut -d "=" -f 2)
|
||||
|
||||
# list of running containers, see : https://stackoverflow.com/questions/10024279/how-to-use-shell-commands-in-makefile
|
||||
@@ -45,11 +40,12 @@ VOLUMES = $(shell docker volume ls -q)
|
||||
all: build up
|
||||
|
||||
volumes:
|
||||
sed -i "s/^LOGIN=.*/LOGIN=$(V_USER)/g" ./srcs/.env
|
||||
mkdir -p $(VOLUMES_D)
|
||||
|
||||
build:
|
||||
- bash -c 'echo -e "\n# adding for inception (you can delete it)\n127.0.0.1 $(WP_URL)" >> /etc/hosts'
|
||||
- if ! grep "127.0.0.1 ${WP_URL}" /etc/hosts 2> /dev/null; then \
|
||||
bash -c 'echo -e "\n# adding for inception (you can delete it)\n127.0.0.1 $(WP_URL)" >> /etc/hosts'; \
|
||||
fi
|
||||
docker-compose -f $(COMPOSE) build
|
||||
|
||||
up: volumes
|
||||
@@ -84,7 +80,6 @@ fclean-images: clean
|
||||
docker system prune -af
|
||||
fclean-volumes: clean
|
||||
- docker volume rm $(VOLUMES)
|
||||
- rm -rf $(VOLUMES_D)
|
||||
fclean: fclean-images fclean-volumes
|
||||
|
||||
re: fclean all
|
||||
|
||||
Reference in New Issue
Block a user