mirror of
https://github.com/cloudmaker97/JTL-Shop-Entwicklungsumgebung.git
synced 2025-12-06 00:48:34 +00:00
105 lines
No EOL
4.2 KiB
Makefile
105 lines
No EOL
4.2 KiB
Makefile
shop_version := "5.3.1"
|
|
php_version := "8.2"
|
|
install_demo := "true"
|
|
install_demo_products := "10"
|
|
install_demo_categories := "3"
|
|
install_demo_manufacturers := "3"
|
|
install_url := "https://jtl-shop-"+shop_version+".ddev.site"
|
|
|
|
# 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
|
|
# 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 install_url="{{install_url}}" 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
|
|
|
|
run-installer:
|
|
#!/usr/bin/env bash
|
|
set -euxo pipefail
|
|
install_url_interpreted=""
|
|
if [ {{install_url}} = "CODESPACE" ]; then
|
|
install_url_interpreted="https://"$(jq -r ".CODESPACE_NAME" /workspaces/.codespaces/shared/environment-variables.json)"-8080.app.github.dev"
|
|
else
|
|
install_url_interpreted={{install_url}}
|
|
fi
|
|
curl -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}}' $install_url_interpreted/install/install.php?task=doinstall
|
|
if [ {{install_demo}} = "true" ]; then \
|
|
curl -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}}' $install_url_interpreted/install/install.php?task=installdemodata; \
|
|
fi
|
|
if [ {{install_url}} = "CODESPACE" ]; then
|
|
file_path="path/to/your/file.php"
|
|
sed -i "s|define('URL_SHOP', 'https://localhost');|define('URL_SHOP', '$install_url_interpreted');|g" ./shop/includes/config.JTL-Shop.ini.php
|
|
fi
|
|
clear
|
|
echo "Erreichbar unter: "$install_url_interpreted
|
|
|
|
[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
|
|
|
|
[private]
|
|
ddev-configuration:
|
|
ddev config --php-version {{php_version}} --project-type php --docroot ./shop --project-name jtl-shop-{{shop_version}} --webserver-type apache-fpm
|
|
ddev start
|
|
ddev exec composer install --working-dir=./shop/includes
|