-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
99 lines (90 loc) · 3.76 KB
/
justfile
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
shop_version := "5.3.1"
php_version := "8.2"
install_demo := "true"
install_demo_products := "10"
install_demo_categories := "3"
install_demo_manufacturers := "3"
# Installiert den Shop mit den angegebenen Werten (Standard)
[linux]
install:
@echo "Installiere Abhängigkeiten (ddev, rsync, unzip, mkcert)"
just install-dependencies
just uninstall
mkdir -p ./shop
@echo "Lade JTL-Shop v{{shop_version}} herunter"
cd ./shop && wget https://gitlab.com/jtl-software/jtl-shop/core/-/archive/v{{shop_version}}/core-v{{shop_version}}.zip -O core.zip
# Unzip and ignore existing files
cd ./shop && unzip -on core.zip && rm core.zip
# Overwrite all files, otherwise set --ignore-existing for rsync
@echo "Kopiere heruntergeladene Dateien in das Shop-Verzeichnis"
cd ./shop && rsync -av core-*/* . && rm -rf core-*
@echo "Kopiere Installer in das Shop-Verzeichnis"
just copy-installer
@echo "Konfiguriere die Entwicklungsumgebung"
just ddev-configuration
@echo "Installiere den Shop automatisch und lösche das Installationsverzeichnis"
just run-installer
[private]
[linux]
install-dependencies:
sudo apt-get update
sudo apt-get install -y curl rsync unzip
curl -fsSL https://ddev.com/install.sh | bash
mkcert -install
# Deinstalliert den Shop. Löscht alle Dateien und Datenbanken
[linux]
uninstall:
@rm -rf ./shop/*
@if [ -d ".ddev" ]; then \
echo "Entferne vorherige Installation" \
ddev delete -y; \
else \
echo "Keine vorhandene Installation gefunden."; \
fi
# Startet die Entwicklungsumgebung
[linux]
start:
@if [ -d ".ddev" ]; then \
ddev start; \
else \
echo "Keine Konfiguration gefunden, bitte zuerst 'just install' ausführen."; \
fi
# Fährt die Entwicklungsumgebung herunter
[linux]
stop:
@if [ -d ".ddev" ]; then \
ddev stop; \
else \
echo "Keine Konfiguration gefunden, bitte zuerst 'just install' ausführen."; \
fi
# Zeigt Informationen zur Entwicklungsumgebung an
[linux]
describe:
@if [ -d ".ddev" ]; then \
ddev describe; \
else \
echo "Keine Konfiguration gefunden, bitte zuerst 'just install' ausführen."; \
fi
[linux]
[private]
run-installer:
@echo "\r\nInstalliere die Datenbank..."
@curl --silent -X POST -k -H 'Content-Type: application/x-www-form-urlencoded' -d 'admin[name]=admin&admin[pass]=admin&admin[locale]=de&wawi[name]=sync&wawi[pass]=sync&db[host]=db&db[pass]=db&db[socket]=&db[user]=db&db[name]=db&demoProducts={{install_demo_products}}&demoCategories={{install_demo_categories}}&demoManufacturers={{install_demo_manufacturers}}' https://jtl-shop-{{shop_version}}.ddev.site/install/install.php?task=doinstall
@if [ {{install_demo}} = "true" ]; then \
curl --silent -X POST -k -H 'Content-Type: application/x-www-form-urlencoded' -d 'admin[name]=admin&admin[pass]=admin&admin[locale]=de&wawi[name]=sync&wawi[pass]=sync&db[host]=db&db[pass]=db&db[socket]=&db[user]=db&db[name]=db&demoProducts={{install_demo_products}}&demoCategories={{install_demo_categories}}&demoManufacturers={{install_demo_manufacturers}}' https://jtl-shop-{{shop_version}}.ddev.site/install/install.php?task=installdemodata; \
fi
clear
@echo "Installation erfolgreich abgeschlossen."
@echo "Erreichbar unter: https://jtl-shop-{{shop_version}}.ddev.site"
[linux]
[private]
copy-installer:
cp ./tools/installer/install_{{shop_version}}.zip ./shop/install/installer.zip
unzip -o ./shop/install/installer.zip -d ./shop/install
rm ./shop/install/installer.zip
[linux]
[private]
ddev-configuration:
ddev config --php-version {{php_version}} --project-type php --docroot ./shop --project-name jtl-shop-{{shop_version}}
ddev start
ddev exec composer install --working-dir=./shop/includes