mirror of
https://github.com/cloudmaker97/JTL-Shop-Entwicklungsumgebung.git
synced 2025-12-06 00:48:34 +00:00
Funktionsumfang erweitert um Installation der Abhängigkeiten und Befehle für die Demo-Installation.
This commit is contained in:
parent
9cab7632f5
commit
f3c63b01ed
2 changed files with 32 additions and 6 deletions
|
|
@ -4,11 +4,14 @@
|
|||
|
||||
Dieses Repository enthält alle benötigten Scripts, um einen JTL-Shop schnell und automatisiert zu Entwicklungszwecken zu installieren. Die Nutzung für produktive Systeme ist mit diesem Projekt nicht vorgesehen und wird auch nicht empfohlen.
|
||||
|
||||
### Vorschau der Installation mit nur einem Befehl
|
||||
|
||||

|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
Es gelten die Lizenzbedingungen der JTL-Software-GmbH. Die Lizenzbedingungen sind in diesem Projekt als Lizenzdatei hinterlegt. Zur Nutzung dieses Repositories sind zudem folgende Voraussetzungen notwendig:
|
||||
|
||||
- [DDEV: Entwicklungsserver](https://ddev.readthedocs.io/en/stable/)
|
||||
- [Docker: Virtualisierung](https://www.docker.com/)
|
||||
- [Just: Command Runner](https://just.systems/)
|
||||
|
||||
|
|
@ -46,6 +49,9 @@ just uninstall
|
|||
| `shop_version` | `5.3.1` | Die Shop-Version, die installiert werden soll. Aktuell stehen zur Auswahl `5.3.1`, `5.2.5`, `5.1.6` oder `5.0.6`. Um weitere Versionen anzubieten, siehe weiter unten im Abschnitt 'Unterstützte Shop-Versionen' |
|
||||
| `php_version` | `8.2` | Die PHP-Version, die genutzt werden soll. `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, oder `8.3` |
|
||||
| `install_demo` | `true` | Ob der neue Shop Demo-Daten enthalten soll, ansonsten muss `false` angegeben werden. |
|
||||
| `install_demo_products` | `10` | Falls die Demo-Daten installiert werden: Anzahl der zu generierenden Produkte |
|
||||
| `install_demo_categories` | `3` | Falls die Demo-Daten installiert werden: Anzahl zu generierenden der Kategorien |
|
||||
| `install_demo_manufacturers` | `3` | Falls die Demo-Daten installiert werden: Anzahl der zu generierenden Hersteller |
|
||||
|
||||
### Befehle für den DDEV-Entwicklungsserver
|
||||
|
||||
|
|
|
|||
30
justfile
30
justfile
|
|
@ -1,26 +1,44 @@
|
|||
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
|
||||
[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
|
||||
cd ./shop && unzip -o core.zip && rm core.zip
|
||||
sudo apt-get update && sudo apt-get install rsync
|
||||
# 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."; \
|
||||
|
|
@ -55,12 +73,14 @@ describe:
|
|||
|
||||
[private]
|
||||
run-installer:
|
||||
@echo "\r\nInstalling JTL-Shop {{shop_version}}..."
|
||||
@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=10&demoCategories=10&demoManufacturers=10' https://jtl-shop-{{shop_version}}.ddev.site/install/install.php?task=doinstall
|
||||
@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=10&demoCategories=10&demoManufacturers=10' https://jtl-shop-{{shop_version}}.ddev.site/install/install.php?task=installdemodata; \
|
||||
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
|
||||
@echo "Installation finished. You can now access the shop at https://jtl-shop-{{shop_version}}.ddev.site"
|
||||
clear
|
||||
@echo "Installation erfolgreich abgeschlossen."
|
||||
@echo "Erreichbar unter: https://jtl-shop-{{shop_version}}.ddev.site"
|
||||
|
||||
[private]
|
||||
copy-installer:
|
||||
|
|
|
|||
Loading…
Reference in a new issue