Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
normal_site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chef Cookbooks
normal_site
Commits
903f1484
Commit
903f1484
authored
1 year ago
by
Fabian Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[FEATURE] Adds the shopware 6 support
parent
128a623b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
attributes/default.rb
+1
-1
1 addition, 1 deletion
attributes/default.rb
recipes/default.rb
+83
-20
83 additions, 20 deletions
recipes/default.rb
templates/default/shopware/.env.local.erb
+1
-0
1 addition, 0 deletions
templates/default/shopware/.env.local.erb
with
85 additions
and
21 deletions
attributes/default.rb
+
1
−
1
View file @
903f1484
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
recipes/default.rb
+
83
−
20
View file @
903f1484
...
...
@@ -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
This diff is collapsed.
Click to expand it.
templates/default/shopware/.env.local.erb
0 → 100644
+
1
−
0
View file @
903f1484
DATABASE_URL=mysql://shopware:shopware@127.0.0.1/shopware
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment