-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (51 loc) · 1.75 KB
/
Makefile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## SETUP PROJECT, please read Readme.md in root of project
## =============================================== CONFIGURE ME ==================================##
TEMP_DIR = ./temp
LOG_DIR = ./log
# If you don't need create webtemp dir set false
WEBTEMP_DIR = false
CONFIG_PATH = ./app/config
LOCAL_CONFIG_EXAMPLE_NAME = config.local.neon.example
LOCAL_CONFIG_NAME = config.local.neon
## ============================================== /CONFIGURE ME ==================================##
LOCAL_CONFIG_EXAMPLE = $(CONFIG_PATH)/$(LOCAL_CONFIG_EXAMPLE_NAME)
LOCAL_CONFIG = $(CONFIG_PATH)/$(LOCAL_CONFIG_NAME)
## Do anything :-)
dev: clean_cache
composer install -o --no-dev; \
return 0;
prelive: dev
live: prelive
setup: create_dirs
@if [ -s $(LOCAL_CONFIG_EXAMPLE) ] && [ $(LOCAL_CONFIG_NAME) != false ] && [ ! -a $(LOCAL_CONFIG) ]; then \
echo "Creating local config in $(LOCAL_CONFIG), you may need update this file.";\
cp $(LOCAL_CONFIG_EXAMPLE) $(LOCAL_CONFIG); \
fi
@if [ -s composer.json ]; then \
echo "Running Composer install";\
composer install; \
fi
## Cleaning cache
clean_cache:
echo "Cleaning caches";\
@rm -rf $(TEMP_DIR)/*; \
@if [ -d $(WEBTEMP_DIR) ]; then \
rm -rf $(WEBTEMP_DIR)/*; \
fi
## Creating needed directories
create_dirs:
@if [ ! -d $(TEMP_DIR) ]; then \
echo "Making temp directory $(TEMP_DIR) witch chmod 0777"; \
mkdir -p $(TEMP_DIR); \
chmod 0777 $(TEMP_DIR);\
fi \
@if [ ! -d $(LOG_DIR) ]; then \
echo "Making log directory $(LOG_DIR) witch chmod 0777"; \
mkdir -p $(LOG_DIR); \
chmod 0777 $(LOG_DIR);\
fi \
@if [ ! -d $(WEBTEMP_DIR) ] && [ $(WEBTEMP_DIR) != false ] ; then \
echo "Making webtemp directory $(WEBTEMP_DIR) witch chmod 0777"; \
mkdir -p $(WEBTEMP_DIR); \
chmod 0777 $(WEBTEMP_DIR);\
fi \