Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
138 lines (101 loc) · 4.07 KB
/
Copy pathmakefile
File metadata and controls
138 lines (101 loc) · 4.07 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
export DOCKER_USER=$(id -u)
APP_URL ?= "http://api.wellms.localhost"
ADMIN_URL ?= "http://admin.wellms.localhost"
FRONT_URL ?= "http://app.wellms.localhost"
MAILHOG_URL ?= "http://mailhog.wellms.localhost"
REPORTBRO_URL ?= "http://reportbro.wellms.localhost"
NAMESPACE ?= "escolalms"
bash:
docker compose exec -u 1000 api bash
generate-credentials:
bash ./scripts/credentials.sh
wait:
docker compose exec -T -u 1000 api bash -c "./wait.sh"
content-seeder:
- docker compose exec -T -u 1000 api bash -c "php artisan db:seed --force --no-interaction"
content-rich-seeder:
- docker compose exec -T -u 1000 api bash -c "php artisan db:seed --class=FullDatabaseSeeder --force --no-interaction"
docker-up:
docker compose up -d --remove-orphans
docker-up-force:
docker compose up -d --force-recreate
docker-down:
docker compose stop
docker-pull:
docker compose pull --ignore-pull-failures
docker-update: docker-pull docker-up-force dumpautoload
restart:
docker compose stop && docker compose up -d
h5p-seed:
- docker compose exec -T -u 1000 api bash -c "php artisan db:seed --class=H5PLibrarySeeder --force --no-interaction"
- docker compose exec -T -u 1000 api bash -c "php artisan db:seed --class=H5PContentSeeder --force --no-interaction"
- docker compose exec -T -u 1000 api bash -c "php artisan db:seed --class=H5PContentCoursesSeeder --force --no-interaction"
# creates a backup file into `data` folder
# TODO this should be called by user 1000 but there is an issue with volume
backup-postgres:
bash scripts/import.sh
# imports database backup from data folder
# make import BACKUP_FILE=backup-2020-09-15-14:49:22.sql
# or
# make import BACKUP_FILE=backup-latest.sql
#import-postgres: backup-postgres
import-postgres:
bash scripts/import.sh
flush-postgres:
- rm -rf docker/postgres-data
- docker compose down
success:
- @echo "Wellms is installed succesfully"
- @echo "Admin panel $(ADMIN_URL)"
- @echo "Demo $(FRONT_URL)"
- @echo "API REST $(APP_URL)/api/documentation"
- @echo "Credentials for admin are username: superadmin@escolalms.com password: secret"
- @echo "If you seeded the database credentials for student are username: student@escolalms.com password: secret"
- @echo "Emails are not sent, they are simulated. See $(MAILHOG_URL) mailhog for details"
- @echo "Run 'make bash' to lanuch bash mode, where you can use all 'artisan' commands"
init: generate-credentials docker-up wait ask-for-seed success
ask-for-seed:
@echo Do you want to seed database with sample courses and other data now? [Y/n]
@read line; if [ $$line = "n" ]; then echo skipping db seeding; else make content-seeder; fi
refresh: flush-postgres docker-pull init
# minikube
minikube-start:
minikube start
# minikube start --memory 8192 --cpus 4
minikube-addons:
minikube addons enable ingress
minikube addons enable ingress-dns
minikube-tunnel:
minikube tunnel
minikube-force-delete:
minikube delete
minikube start
# minikube start --memory 8192 --cpus 4
minikube-init: minikube-start minikube-addons
# k8s
k8s-generate-yaml:
./scripts/generate-k8s.sh
k8s-delete:
kubectl delete all --all -n $(NAMESPACE)
kubectl delete pvc --all -n $(NAMESPACE)
kubectl delete pv --all -n $(NAMESPACE)
kubectl delete storageclass --all -n $(NAMESPACE)
-rm -f k8s/*.yaml
-minikube ssh "sudo rm -rf /var/lib/postgresql/data"
k8s-apply:
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/deploy-admin.yaml
kubectl apply -f k8s/deploy-backend.yaml
kubectl apply -f k8s/deploy-frontend.yaml
kubectl apply -f k8s/deploy-mailhog.yaml
kubectl apply -f k8s/deploy-reportbro.yaml
kubectl apply -f k8s/deploy-postgres.yaml
kubectl apply -f k8s/deploy-redis.yaml
kubectl apply -f k8s/deploy-scheduler-queue.yaml
kubectl apply -f k8s/volume-backend.yaml
kubectl apply -f k8s/ingress.yaml
k8s-rebuild: k8s-delete k8s-generate-yaml k8s-apply
k8s-init: k8s-generate-yaml k8s-apply
#k8s-rebuild: minikube-init k8s-delete k8s-generate-yaml k8s-apply minikube-tunel
#k8s-init: minikube-init k8s-generate-yaml k8s-apply minikube-tunel