Skip to content
Snippets Groups Projects
Commit 903f1484 authored by Fabian Galinski's avatar Fabian Galinski :pouting_cat:
Browse files

[FEATURE] Adds the shopware 6 support

parent 128a623b
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ default['normal_site']['configure_typo3'] = false
# Shopware
default['normal_site']['download_shopware'] = false
default['normal_site']['shopware_version'] = '6.3.5.1'
default['normal_site']['shopware_version'] = '6.5.2.1'
default['normal_site']['configure_shopware'] = false
# Wordpress
......
......@@ -561,29 +561,55 @@ end
### Setup Shopware ###
######################
shopwareDownloadUrl = "https://github.com/shopware/production/archive/v#{node['normal_site']['shopware_version']}.zip"
if node['normal_site']['shopware_version'][0] == '5'
shopwareDownloadUrl = "https://github.com/shopware/shopware/archive/v#{node['normal_site']['shopware_version']}.zip"
end
bash 'Setup Shopware' do
cwd '/home/vagrant/'
bash 'Setup Shopware 5x' do
cwd '/home/vagrant/'
user 'vagrant'
group 'vagrant'
timeout 3000000
only_if { node['normal_site']['download_shopware'] }
user 'vagrant'
group 'vagrant'
timeout 3000000
only_if { node['normal_site']['download_shopware'] }
code <<-EOF
code <<-EOF
if [ ! -d #{node['normal_site']['webroot']}/#{base_hostname}/config ]
then
wget #{shopwareDownloadUrl} \
wget https://github.com/shopware/shopware/archive/v#{node['normal_site']['shopware_version']}.zip \
-O shopware.zip
unzip shopware.zip -d #{node['normal_site']['webroot']}/#{base_hostname}/;
fi
EOF
action :run
EOF
action :run
end
else
bash 'Setup Shopware 6x' do
cwd '/home/vagrant/'
user 'vagrant'
group 'vagrant'
timeout 3000000
only_if { node['normal_site']['download_shopware'] }
code <<-EOF
if [ ! -f #{node['normal_site']['webroot']}/#{base_hostname}/composer.json ]
then
cd #{node['normal_site']['webroot']}
if ! command -v composer &> /dev/null
then
export COMPOSER_HOME=/home/vagrant/.composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
fi
composer create-project shopware/production:dev-flex #{base_hostname} v#{node['normal_site']['shopware_version']}
touch #{base_hostname}/FIRST_INSTALL
fi
EOF
action :run
end
end
#########################
......@@ -692,13 +718,24 @@ end
####################################################
if node['normal_site']['configure_shopware']
file "#{node['normal_site']['webroot']}/#{base_hostname}/config.php" do
action :delete
end
if node['normal_site']['shopware_version'][0] == '5'
file "#{node['normal_site']['webroot']}/#{base_hostname}/config.php" do
action :delete
end
template "#{node['normal_site']['webroot']}/#{base_hostname}/config.php" do
source 'shopware/config.php.erb'
mode '0755'
template "#{node['normal_site']['webroot']}/#{base_hostname}/config.php" do
source 'shopware/config.php.erb'
mode '0755'
end
else
file "#{node['normal_site']['webroot']}/#{base_hostname}/.env.local" do
action :delete
end
template "#{node['normal_site']['webroot']}/#{base_hostname}/.env.local" do
source 'shopware/.env.local.erb'
mode '0755'
end
end
end
......@@ -848,3 +885,29 @@ if node['normal_site']['solr']['init']
end
end
############################
### Configure Shopware 6 ###
############################
if node['normal_site']['configure_shopware'] && node['normal_site']['shopware_version'][0] == '6'
bash 'Configure Shopware 6x if the file "FIRST_INSTALL" exists.' do
cwd '/home/vagrant/'
user 'vagrant'
group 'vagrant'
timeout 3000000
code <<-EOF
if [ -f #{node['normal_site']['webroot']}/#{base_hostname}/FIRST_INSTALL ]
then
cd #{node['normal_site']['webroot']}/#{base_hostname}
bin/console system:install --basic-setup --drop-database --create-database -f
rm -f FIRST_INSTALL
fi
EOF
action :run
end
end
DATABASE_URL=mysql://shopware:shopware@127.0.0.1/shopware
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment