Ein für Shopware 6 vorbereitet Systemmanagment.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#!/bin/bash
### DO NOT EDIT THIS FILE
source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh" app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd) source "$app_dir/etc/config.sh"
updatemode=0
echo echoMainTitle "Shopware installer/updater"
path="$app_dir/git/$project_name$git_shopware_path"
if [ -f "$path/install.lock" ] then updatemode=1 echo "Update mode" else echo "Install mode" fi
if [ "$updatemode" == "0" ] then echo echoSequenzeTitle "Wich database to use?" echo echoSelect "[live] " "Local live database" echoSelect "[stage]" "Local stage database" echo env=$(readConsole "Select: " "Invalid selection" "live stage") fi
### Fetch sources
echo echo "Fetch sources ..."
wget -q --show-progress -O "$app_dir/var/tmp/sdp.html" "https://www.shopware.com/de/download/"
if [ "$updatemode" == "0" ] then download_url=$(grep -Po '(?<=href=")https://releases.shopware.com/sw6/install_[^"]*' "$app_dir/var/tmp/sdp.html") filename="shopware_install.zip" else download_url=$(grep -Po '(?<=href=")https://releases.shopware.com/sw6/update_[^"]*' "$app_dir/var/tmp/sdp.html") filename="shopware_update.zip" fi
wget -q --show-progress -O "$app_dir/var/tmp/$filename" "$download_url"
echo "Install files ..."
unzip -oqq "$app_dir/var/tmp/$filename" -d "$path"
local_database_socket=$(eval "echo \"\$local_${env}_database_socket\"") local_database_host=$(eval "echo \"\$local_${env}_database_host\"") local_database_port=$(eval "echo \"\$local_${env}_database_port\"") local_database_name=$(eval "echo \"\$local_${env}_database_name\"") local_database_user=$(eval "echo \"\$local_${env}_database_user\"") local_database_password=$(eval "echo \"\$local_${env}_database_password\"")
if [ "$local_database_socket" != "" ] then database_url="mysql:unix_socket=$local_database_socket;dbname=$local_database_name;user=$local_database_user;password=$local_database_password" else database_url="mysql://$local_database_user:$local_database_password@$local_database_host:$local_database_port/$local_database_name" fi export DATABASE_URL="$database_url"
cwd=$(pwd) cd "$path"
if [ "$updatemode" == "0" ] then
echo "Setup Shopware ..." cp "$app_dir/etc/.env.local" "$path/.env" bin/console system:install --shop-name="$install_shopware_name" --shop-email="$install_shopware_email" \
--shop-locale="$install_shopware_locale" --shop-currency="$install_shopware_currency" --no-interaction --env="dev" bin/console sales-channel:create:storefront --name="$install_shopware_storefront_name" --url="$install_install_shopware_storefront_url" --no-interaction --quiet bin/console user:create -a --firstName="$local_shopware_user" --lastName="$local_shopware_firstname" --email="$local_shopware_email" "$local_shopware_user"
else echo "Prepare Shopware setup ..." bin/console --quiet --no-interaction --env="dev" system:update:prepare
"$path/public/recovery/update/index.php" fi
cd "$cwd"
postScript "$app_dir/bin/postscripts/install_shopware.sh"
rm "$app_dir/var/tmp/sdp.html" rm "$app_dir/var/tmp/$filename"
|