Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
5035baae
Commit
5035baae
authored
Oct 25, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added recipe for site and db init
parent
4db10c16
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
109 additions
and
9 deletions
+109
-9
setup.py
setup.py
+1
-0
slapos/recipe/drupal/__init__.py
slapos/recipe/drupal/__init__.py
+56
-0
software/drupal/instance-custom.cfg.in
software/drupal/instance-custom.cfg.in
+8
-0
software/drupal/settings.php.in
software/drupal/settings.php.in
+12
-1
software/drupal/software.cfg
software/drupal/software.cfg
+29
-5
stack/lamp/apache/instance-apache-php.cfg
stack/lamp/apache/instance-apache-php.cfg
+2
-2
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-1
No files found.
setup.py
View file @
5035baae
...
...
@@ -60,6 +60,7 @@ setup(name=name,
'dropbear.add_authorized_key = slapos.recipe.dropbear:AddAuthorizedKey'
,
'dropbear.client = slapos.recipe.dropbear:Client'
,
'dropbear = slapos.recipe.dropbear:Recipe'
,
'drupal_init = slapos.recipe.drupal:InitRecipe'
,
'dumpmdb = slapos.recipe.dumpmdb:Recipe'
,
'duplicity = slapos.recipe.duplicity:Recipe'
,
'egg_test = slapos.recipe.erp5_test:EggTestRecipe'
,
...
...
slapos/recipe/drupal/__init__.py
0 → 100644
View file @
5035baae
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
subprocess
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
InitRecipe
(
GenericBaseRecipe
):
"""
\
This recipe performs deployment steps for Drupal:
- Call the 'drush' command to install a Drupal site and initial database schema.
"""
def
install
(
self
):
drush_binary
=
self
.
options
[
'drush-binary'
]
htdocs
=
self
.
options
[
'htdocs'
]
os
.
chdir
(
htdocs
)
output
=
subprocess
.
check_output
([
drush_binary
,
'-y'
,
'site-install'
,
'--account-name=admin'
,
'--account-pass=admin'
])
# XXX return what?
return
[]
software/drupal/instance-custom.cfg.in
0 → 100644
View file @
5035baae
[buildout]
[drupal-init]
recipe = slapos.cookbook:drupal_init
drush-binary = ${apache-php:location}/bin/drush
htdocs = $${rootdirectory:srv}/www
dependency = $${apache-php:recipe}
software/drupal/settings.php.in
View file @
5035baae
...
...
@@ -200,12 +200,23 @@
* );
* @endcode
*/
/*
* The apachephp recipe provided with both host+port in the same string.
* Split them again, php way.
* And it could be an ipv6 as well, so beware of colons.
*/
$mysql_host_port = '%(mysql_host)s';
$mysql_port = substr(strrchr($mysql_host_port, ":"), 1);
$mysql_host = substr($mysql_host_port, 0, strlen($mysql_host_port) - strlen($mysql_port) - 1);
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => '%(mysql_database)s',
'username' => '%(mysql_user)s',
'password' => '%(mysql_password)s',
'host' => '%(mysql_host)s',
'host' => $mysql_host,
'port' => $mysql_port,
'prefix' => '',
);
...
...
software/drupal/software.cfg
View file @
5035baae
...
...
@@ -3,6 +3,13 @@
extends =
../../stack/lamp/buildout.cfg
develop =
/opt/slapdev
parts +=
pear-modules
[application]
recipe = slapos.recipe.build:download-unpacked
url = http://ftp.drupal.org/files/projects/drupal-7.16.tar.gz
...
...
@@ -11,16 +18,33 @@ md5sum = 352497b2df94b5308e31cb8da020b631
[application-template]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/settings.php.in
md5sum =
add9e4e96094a9d3fb7cf0f4d26ae544
md5sum =
b4dfbdb950c25c93a8c3f9f78e9bff6e
download-only = True
filename = template.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration]
location = sites/default/
default.
settings.php
location = sites/default/settings.php
[custom-application-deployment]
path = {:_profile_base_location_}/instance.cfg
part-list =
setup-database
path = ${custom-application-deployment-template:output}
part-list = drupal-init
[custom-application-deployment-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-custom.cfg.in
output = ${buildout:directory}/instance-custom.cfg
md5sum = bd071532528120f5da1fb6050d4c80e8
mode = 0644
[pear-modules]
recipe = cp.recipe.cmd
pear = ${apache-php:location}/bin/pear
install_cmd =
${:pear} channel-info pear.drush.org >/dev/null || ${:pear} channel-discover pear.drush.org
${:pear} info drush/drush >/dev/null || ${:pear} install drush/drush
${:pear} info Console_Table >/dev/null || ${:pear} install Console_Table
stack/lamp/apache/instance-apache-php.cfg
View file @
5035baae
[buildout]
extends = ${custom-
php-par
t:path}
extends = ${custom-
application-deploymen
t:path}
parts =
certificate-authority
...
...
@@ -15,7 +15,7 @@ parts =
frontend-promise
content-promise
publish-connection-informations
${custom-
php-par
t:part-list}
${custom-
application-deploymen
t:part-list}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
...
...
stack/lamp/buildout.cfg
View file @
5035baae
...
...
@@ -84,7 +84,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-php.cfg
output = ${buildout:directory}/template-apache-php.cfg
md5sum =
a5dd222b3faa4e1ef2df9b3b9bb47966
md5sum =
f789d2a84e0cd3ca28a6377c4f7b5ab2
mode = 0644
[template-apache-backup]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment