-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
175 lines (129 loc) · 3.55 KB
/
Copy pathjustfile
File metadata and controls
175 lines (129 loc) · 3.55 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
set dotenv-load
alias bd := build
alias u := up
alias s := stop
alias rp := reset-permissions
alias b := bash
alias cct := cc-test
alias start := setup-project
alias sdb := setup-database
alias rdb := reset-database
alias ddb := drop-database
alias m := migrate
alias f := fixtures
alias mm := make-migration
alias sdbt := setup-database-test
alias ddbt := drop-database-test
alias mt := migrate-test
alias ft := fixtures-test
alias e := ecs
alias c := composer-install
alias im := importmap
alias ir := importmap-require
alias ii := importmap-install
alias iu := importmap-update
alias irm := importmap-remove
alias ima := importmap-audit
alias tw := tailwind-watch
alias ss := supervisor-start
alias sp := supervisor-stop
container-name := "deeta-php-1"
docker-running := `docker ps -q --filter name=deeta-php-1 | grep -q . && echo true || echo false`
d := if docker-running == "true" { "docker exec -t " + container-name + " php" } else { "php" }
shell := if docker-running == "true" { "docker exec -t " + container-name } else { "" }
console := if docker-running == "true" { "docker exec -t " + container-name + " php bin/console" } else { "php bin/console" }
default:
just --list
#---------- Docker management ----------
setup-project:
@echo "Building and starting the project..."
just bd
just u
just rp
just sdb
just sdbt
@echo "Project is ready!"
@echo "You can now access the project at https://localhost"
@echo "Webmail is available at http://localhost:8025"
build:
docker compose build --no-cache
up:
docker compose up -d
down:
docker compose down --remove-orphans
stop:
docker compose stop
prune:
docker compose down --remove-orphans
docker compose down --volumes
docker compose rm -f
reset-permissions:
sudo chown -Rf $(id -u):$(id -g) ./
#---------- Container commands ----------
bash:
@docker exec -it deeta-php-1 bash
#---------- Symfony commands ----------
cc:
{{console}} cache:clear
cc-test:
{{console}} cache:clear -e test
#---------- Database commands ----------
setup-database:
just m
just f
reset-database:
@echo "Resetting the database..."
just ddb
just sdb
# just sp
# just ss
drop-database:
{{shell}} rm var/data.db
migrate:
{{console}} doctrine:migrations:migrate --no-interaction
fixtures:
{{console}} doctrine:fixtures:load --no-interaction
make-migration:
{{console}} make:migration
setup-database-test:
just ddbt
just mt
just ft
drop-database-test:
{{shell}} rm var/data_test.db
migrate-test:
{{console}} doctrine:migrations:migrate --no-interaction -e test
fixtures-test:
{{console}} doctrine:fixtures:load --no-interaction -e test
#---------- Symfony & ImportMap commands ----------
importmap:
{{console}} importmap
importmap-require:
{{console}} importmap:require
importmap-install:
{{console}} importmap:install
importmap-update:
{{console}} importmap:update
importmap-remove:
{{console}} importmap:remove
importmap-audit:
{{console}} importmap:audit
tailwind-watch:
{{console}} tailwind:build --watch
#---------- Test & Analysis commands ----------
tests:
{{d}} vendor/bin/pest
stan:
{{d}} vendor/bin/phpstan analyse --memory-limit=256M
ecs:
{{d}} vendor/bin/ecs check --fix
ecs-check:
{{d}} vendor/bin/ecs check
#---------- Composer commands ----------
composer-install:
{{shell}} composer install
#---------- Supervisor commands ----------
supervisor-start:
{{shell}} supervisorctl start all
supervisor-stop:
{{shell}} supervisorctl stop all