Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
Commits
ca34ed84
Commit
ca34ed84
authored
Oct 19, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP of profile based erp5 update
parent
ae4a5d25
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
115 additions
and
53 deletions
+115
-53
setup.py
setup.py
+2
-1
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+0
-51
slapos/recipe/erp5_update/__init__.py
slapos/recipe/erp5_update/__init__.py
+90
-0
slapos/recipe/erp5_update/erp5.py
slapos/recipe/erp5_update/erp5.py
+0
-0
software/erp5/snippet-master.cfg
software/erp5/snippet-master.cfg
+22
-0
software/erp5/software.cfg
software/erp5/software.cfg
+1
-1
No files found.
setup.py
View file @
ca34ed84
...
@@ -90,6 +90,7 @@ setup(name=name,
...
@@ -90,6 +90,7 @@ setup(name=name,
'generic.zope.zeo.client = slapos.recipe.generic_zope_zeo_client:Recipe'
,
'generic.zope.zeo.client = slapos.recipe.generic_zope_zeo_client:Recipe'
,
'generate.erp5.tidstorage = slapos.recipe.generate_erp5_tidstorage:Recipe'
,
'generate.erp5.tidstorage = slapos.recipe.generate_erp5_tidstorage:Recipe'
,
'zeo = slapos.recipe.zeo:Recipe'
,
'zeo = slapos.recipe.zeo:Recipe'
,
'tidstorage = slapos.recipe.tidstorage:Recipe'
'tidstorage = slapos.recipe.tidstorage:Recipe'
,
'erp5.update = slapos.recipe.erp5_update:Recipe'
]},
]},
)
)
slapos/recipe/erp5/__init__.py
View file @
ca34ed84
...
@@ -535,57 +535,6 @@ SSLCARevocationPath %(ca_crl)s"""
...
@@ -535,57 +535,6 @@ SSLCARevocationPath %(ca_crl)s"""
certificate_authority_path
=
config
[
'ca_dir'
]
certificate_authority_path
=
config
[
'ca_dir'
]
)
)
def
installERP5Site
(
self
,
user
,
password
,
zope_access
,
mysql_conf
,
conversion_server_conf
=
None
,
memcached_conf
=
None
,
kumo_conf
=
None
,
erp5_site_id
=
'erp5'
,
default_bt5_list
=
[],
ca_conf
=
{},
supervisor_controlled
=
True
):
"""
Create a script to automatically set up an erp5 site (controlled by
supervisor by default) on available zope and mysql environments.
"""
conversion_server
=
None
if
conversion_server_conf
is
not
None
:
conversion_server
=
"%s:%s"
%
(
conversion_server_conf
[
'conversion_server_ip'
],
conversion_server_conf
[
'conversion_server_port'
])
if
memcached_conf
is
None
:
memcached_conf
=
{}
if
kumo_conf
is
None
:
kumo_conf
=
{}
# XXX Conversion server and memcache server coordinates are not relevant
# for pure site creation.
assert
mysql_conf
[
'mysql_user'
]
and
mysql_conf
[
'mysql_password'
],
\
"ZMySQLDA requires a user and a password for socket connections"
# XXX Use socket access to prevent unwanted connections to original MySQL
# server when cloning an existing ERP5 instance.
# TCP will be required if MySQL is in a different partition/server.
mysql_connection_string
=
"%(mysql_database)s %(mysql_user)s %(mysql_password)s %(socket)s"
%
mysql_conf
bt5_list
=
self
.
parameter_dict
.
get
(
"bt5_list"
,
""
).
split
()
or
default_bt5_list
bt5_repository_list
=
self
.
parameter_dict
.
get
(
"bt5_repository_list"
,
""
).
split
()
\
or
getattr
(
self
,
'bt5_repository_list'
,
[])
erp5_update_directory
=
supervisor_controlled
and
self
.
wrapper_directory
or
\
self
.
bin_directory
script
=
zc
.
buildout
.
easy_install
.
scripts
([(
'erp5_update'
,
__name__
+
'.erp5'
,
'updateERP5'
)],
self
.
ws
,
sys
.
executable
,
erp5_update_directory
,
arguments
=
[
erp5_site_id
,
mysql_connection_string
,
[
user
,
password
,
zope_access
],
memcached_conf
.
get
(
'memcached_url'
),
conversion_server
,
kumo_conf
.
get
(
"kumo_address"
),
bt5_list
,
bt5_repository_list
,
ca_conf
.
get
(
'certificate_authority_path'
),
self
.
options
.
get
(
'openssl_binary'
)])
self
.
path_list
.
extend
(
script
)
return
[]
def
installZeo
(
self
,
ip
):
def
installZeo
(
self
,
ip
):
# zodb_dir = os.path.join(self.data_root_directory, 'zodb')
# zodb_dir = os.path.join(self.data_root_directory, 'zodb')
# self._createDirectory(zodb_dir)
# self._createDirectory(zodb_dir)
...
...
slapos/recipe/erp5_update/__init__.py
0 → 100644
View file @
ca34ed84
##############################################################################
#
# Copyright (c) 2011 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
urlparse
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
def
install
(
self
):
# def installERP5Site(self, user, password, zope_access, mysql_conf,
# conversion_server_conf=None, memcached_conf=None,
# kumo_conf=None,
# erp5_site_id='erp5', default_bt5_list=[], ca_conf={},
# supervisor_controlled=True):
# """
# Create a script to automatically set up an erp5 site (controlled by
# supervisor by default) on available zope and mysql environments.
# """
conversion_server
=
None
if
'cloudooo-url'
in
self
.
options
and
self
.
options
[
'cloudooo-url'
]:
parsed
=
urlparse
.
urlparse
(
self
.
options
[
'cloudooo-url'
])
conversion_server
=
"%s:%s"
%
(
parsed
.
hostname
,
parsed
.
port
)
memcached
=
None
if
'memcached-url'
in
self
.
options
and
self
.
options
[
'memcached-url'
]:
parsed
=
urlparse
.
urlparse
(
self
.
options
[
'memcached-url'
])
memcached
=
"%s:%s"
%
(
parsed
.
hostname
,
parsed
.
port
)
kumofs
=
None
if
'kumofs-url'
in
self
.
options
and
self
.
options
[
'kumofs-url'
]:
parsed
=
urlparse
.
urlparse
(
self
.
options
[
'kumofs-url'
])
kumofs
=
"%s:%s"
%
(
parsed
.
hostname
,
parsed
.
port
)
parsed
=
urlparse
.
urlparse
(
self
.
options
[
'mysql-url'
])
mysql_connection_string
=
"%(database)s %(hostname)s@%(port)s %(username)s %(password)s"
%
dict
(
database
=
parsed
.
path
.
split
(
'/'
)[
1
],
hostname
=
parsed
.
hostname
,
port
=
parsed
.
port
,
username
=
parsed
.
username
,
password
=
parsed
.
password
)
raise
NotImplementedError
bt5_list
=
self
.
parameter_dict
.
get
(
"bt5_list"
,
""
).
split
()
or
default_bt5_list
bt5_repository_list
=
self
.
parameter_dict
.
get
(
"bt5_repository_list"
,
""
).
split
()
\
or
getattr
(
self
,
'bt5_repository_list'
,
[])
erp5_update_directory
=
supervisor_controlled
and
self
.
wrapper_directory
or
\
self
.
bin_directory
script
=
zc
.
buildout
.
easy_install
.
scripts
([(
'erp5_update'
,
__name__
+
'.erp5'
,
'updateERP5'
)],
self
.
ws
,
sys
.
executable
,
erp5_update_directory
,
arguments
=
[
erp5_site_id
,
mysql_connection_string
,
[
user
,
password
,
zope_access
],
memcached
,
conversion_server
,
kumofs
,
bt5_list
,
bt5_repository_list
,
ca_conf
.
get
(
'certificate_authority_path'
),
self
.
options
.
get
(
'openssl_binary'
)])
self
.
path_list
.
extend
(
script
)
return
[]
slapos/recipe/erp5/erp5.py
→
slapos/recipe/erp5
_update
/erp5.py
View file @
ca34ed84
File moved
software/erp5/snippet-master.cfg
View file @
ca34ed84
...
@@ -16,6 +16,7 @@ parts =
...
@@ -16,6 +16,7 @@ parts =
cron
cron
cron-entry-logrotate
cron-entry-logrotate
certificate-authority
certificate-authority
erp5-certificate-authority
tidstorage
tidstorage
cron-entry-tidstorage-backup
cron-entry-tidstorage-backup
logrotate-entry-tidstorage
logrotate-entry-tidstorage
...
@@ -108,6 +109,25 @@ recipe = slapos.cookbook:zeo
...
@@ -108,6 +109,25 @@ recipe = slapos.cookbook:zeo
ip = $${slap-network-information:local-ipv4}
ip = $${slap-network-information:local-ipv4}
binary-path = ${buildout:bin-directory}/runzeo
binary-path = ${buildout:bin-directory}/runzeo
[erp5-certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:erp5-ca-dir}
requests-directory = $${erp5-cadirectory:requests}
wrapper = $${basedirectory:services}/erp5-ca
ca-private = $${erp5-cadirectory:private}
ca-certs = $${erp5-cadirectory:certs}
ca-newcerts = $${erp5-cadirectory:newcerts}
ca-crl = $${erp5-cadirectory:crl}
[erp5-cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:erp5-ca-dir}/requests/
private = $${directory:erp5-ca-dir}/private/
certs = $${directory:erp5-ca-dir}/certs/
newcerts = $${directory:erp5-ca-dir}/newcerts/
crl = $${directory:erp5-ca-dir}/crl/
[certificate-authority]
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
openssl-binary = ${openssl:location}/bin/openssl
...
@@ -160,6 +180,7 @@ instance-constraint = $${:instance}/Constraint
...
@@ -160,6 +180,7 @@ instance-constraint = $${:instance}/Constraint
instance-import = $${:instance}/import
instance-import = $${:instance}/import
instance-lib = $${:instance}/lib
instance-lib = $${:instance}/lib
instance-tests = $${:instance}/tests
instance-tests = $${:instance}/tests
erp5-ca-dir = $${rootdirectory:srv}/erp5-ssl/
ca-dir = $${rootdirectory:srv}/ssl/
ca-dir = $${rootdirectory:srv}/ssl/
cron-entries = $${rootdirectory:etc}/cron.d/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
crontabs = $${rootdirectory:etc}/crontabs/
...
@@ -202,3 +223,4 @@ memcached-url = %(memcached-url)s
...
@@ -202,3 +223,4 @@ memcached-url = %(memcached-url)s
cloudooo-url = %(cloudooo-url)s
cloudooo-url = %(cloudooo-url)s
site-id = %(site_id)s
site-id = %(site_id)s
openssl-binary = ${openssl:location}/bin/openssl
openssl-binary = ${openssl:location}/bin/openssl
cadir-path = $${erp5-certificate-authority:ca-dir}
software/erp5/software.cfg
View file @
ca34ed84
...
@@ -88,7 +88,7 @@ mode = 0644
...
@@ -88,7 +88,7 @@ mode = 0644
[template-snippet-master]
[template-snippet-master]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-master.cfg
url = ${:_profile_base_location_}/snippet-master.cfg
md5sum =
7a4478ece1356918f37f4c98774b850
b
md5sum =
538d6e58a1ac78a10084b78c90a3a98
b
output = ${buildout:directory}/template-snippet-master.cfg
output = ${buildout:directory}/template-snippet-master.cfg
mode = 0644
mode = 0644
...
...
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