forked from skounis/drupal-codespaces
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.17 KB
/
Copy pathMakefile
File metadata and controls
47 lines (38 loc) · 1.17 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
44
45
46
47
# Variables
CMS_DIR := cms
COMPOSER_FILE := $(CMS_DIR)/composer.json
.PHONY: clean ddev setup launch
# Default target to run all steps
all: clean ddev setup launch
# Clean the cms/ folder but keep composer.json
clean:
@echo "Cleaning the $(CMS_DIR) folder but keeping $(COMPOSER_FILE)..."
@find $(CMS_DIR) -mindepth 1 -depth -ignore_readdir_race ! -name $(notdir $(COMPOSER_FILE)) -exec rm -rf {} +
# Start or restart ddev
ddev:
@echo "Checking ddev status..."
@if ddev describe >/dev/null 2>&1; then \
echo "ddev is already running. Restarting..."; \
ddev restart; \
else \
echo "ddev is not running. Starting..."; \
ddev start; \
fi
start:
@echo "Starting ddev..."
@ddev start
restart:
@echo "Restarting ddev..."
@ddev restart
# Run setup commands inside the ddev container
setup:
@echo "Running setup commands inside the ddev container..."
@echo "Commands to be executed:"
@echo "1. cd $(CMS_DIR)"
@echo "2. composer install"
@echo "3. composer run-script post-install-cmd"
@ddev exec "cd $(CMS_DIR) && composer install && composer run-script post-install-cmd"
# Launch the browser using ddev
launch:
@echo "Launching the browser with ddev..."
@ddev launch