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
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
Paul Graydon
slapos
Commits
e817dc5f
Commit
e817dc5f
authored
Jun 27, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate the bt5list and use local repositories to bootstrap instance.
A bit modified from Vincent Patch. Thanks to Vincent.
parent
807a10d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
2 deletions
+69
-2
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+44
-1
software/erp5/instance.cfg
software/erp5/instance.cfg
+2
-0
software/erp5/software.cfg
software/erp5/software.cfg
+1
-1
stack/erp5.cfg
stack/erp5.cfg
+22
-0
No files found.
slapos/recipe/erp5/__init__.py
View file @
e817dc5f
...
@@ -34,6 +34,10 @@ import sys
...
@@ -34,6 +34,10 @@ import sys
import
zc.buildout
import
zc.buildout
import
zc.recipe.egg
import
zc.recipe.egg
import
ConfigParser
import
ConfigParser
import
re
_isurl
=
re
.
compile
(
'([a-zA-Z0-9+.-]+)://'
).
match
# based on Zope2.utilities.mkzopeinstance.write_inituser
# based on Zope2.utilities.mkzopeinstance.write_inituser
def
Zope2InitUser
(
path
,
username
,
password
):
def
Zope2InitUser
(
path
,
username
,
password
):
...
@@ -478,6 +482,44 @@ class Recipe(BaseSlapRecipe):
...
@@ -478,6 +482,44 @@ class Recipe(BaseSlapRecipe):
self
.
_createDirectory
(
os
.
path
.
join
(
self
.
erp5_directory
,
directory
))
self
.
_createDirectory
(
os
.
path
.
join
(
self
.
erp5_directory
,
directory
))
self
.
_createDirectory
(
os
.
path
.
join
(
self
.
erp5_directory
,
'etc'
,
self
.
_createDirectory
(
os
.
path
.
join
(
self
.
erp5_directory
,
'etc'
,
'package-includes'
))
'package-includes'
))
# Symlink to BT5 repositories defined in instance config.
# Those paths will eventually end up in the ZODB, and having symlinks
# inside the XXX makes it possible to reuse such ZODB with another software
# release[ version].
# Note: this path cannot be used for development, it's really just a
# read-only repository.
repository_path
=
os
.
path
.
join
(
self
.
var_directory
,
"bt5_repository"
)
if
not
os
.
path
.
isdir
(
repository_path
):
os
.
mkdir
(
repository_path
)
self
.
path_list
.
append
(
repository_path
)
self
.
bt5_repository_list
=
[]
append
=
self
.
bt5_repository_list
.
append
for
repository
in
self
.
options
.
get
(
'bt5_repository_list'
,
''
).
split
():
repository
=
repository
.
strip
()
if
not
repository
:
continue
if
_isurl
(
repository
)
and
not
repository
.
startswith
(
"file://"
):
# XXX: assume it's a valid URL
append
(
repository
)
continue
if
repository
.
startswith
(
'file://'
):
repository
=
repository
.
replace
(
'file://'
,
''
,
''
)
if
os
.
path
.
isabs
(
repository
):
repo_id
=
hashlib
.
sha1
(
repository
).
hexdigest
()
link
=
os
.
path
.
join
(
repository_path
,
repo_id
)
if
os
.
path
.
lexists
(
link
):
if
not
os
.
path
.
islink
(
link
):
raise
zc
.
buildout
.
UserError
(
'Target link already %r exists but it is not link'
%
link
)
os
.
unlink
(
link
)
os
.
symlink
(
repository
,
link
)
self
.
logger
.
debug
(
'Created link %r -> %r'
%
(
link
,
repository_path
))
# Always provide a URL-Type
append
(
"file://"
+
link
)
return
user
,
password
return
user
,
password
def
installERP5Site
(
self
,
user
,
password
,
zope_access
,
mysql_conf
,
def
installERP5Site
(
self
,
user
,
password
,
zope_access
,
mysql_conf
,
...
@@ -498,7 +540,8 @@ class Recipe(BaseSlapRecipe):
...
@@ -498,7 +540,8 @@ class Recipe(BaseSlapRecipe):
# XXX URL list vs. repository + list of bt5 names?
# XXX URL list vs. repository + list of bt5 names?
bt5_list
=
self
.
parameter_dict
.
get
(
"bt5_list"
,
""
).
split
()
bt5_list
=
self
.
parameter_dict
.
get
(
"bt5_list"
,
""
).
split
()
bt5_repository_list
=
self
.
parameter_dict
.
get
(
"bt5_repository_list"
,
""
).
split
()
bt5_repository_list
=
self
.
parameter_dict
.
get
(
"bt5_repository_list"
,
""
).
split
()
\
or
getattr
(
self
,
'bt5_repository_list'
,
[])
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
'erp5_update'
,
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
'erp5_update'
,
__name__
+
'.erp5'
,
'updateERP5'
)],
self
.
ws
,
__name__
+
'.erp5'
,
'updateERP5'
)],
self
.
ws
,
...
...
software/erp5/instance.cfg
View file @
e817dc5f
...
@@ -60,6 +60,8 @@ link_binary_list =
...
@@ -60,6 +60,8 @@ link_binary_list =
${poppler:location}/bin/pdftotext
${poppler:location}/bin/pdftotext
${poppler:location}/bin/pdftohtml
${poppler:location}/bin/pdftohtml
bt5_repository_list = ${bt5-repository:list}
# XXX: products won't be needed as soon as all ERP5 (and products-deps)
# XXX: products won't be needed as soon as all ERP5 (and products-deps)
# products will be eggified so then it will be possible to use them thanks to
# products will be eggified so then it will be possible to use them thanks to
# availability in software's eggs
# availability in software's eggs
...
...
software/erp5/software.cfg
View file @
e817dc5f
...
@@ -23,6 +23,6 @@ module = erp5
...
@@ -23,6 +23,6 @@ module = erp5
# Default template for erp5 instance.
# Default template for erp5 instance.
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
url = ${:_profile_base_location_}/instance.cfg
md5sum = 2
92646776e6b7b9decf4291886a66603
md5sum = 2
a1445f3bcf30d8def43846317a4be5b
output = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
mode = 0644
mode = 0644
stack/erp5.cfg
View file @
e817dc5f
...
@@ -122,6 +122,28 @@ parts =
...
@@ -122,6 +122,28 @@ parts =
# get git repositories
# get git repositories
erp5
erp5
genbt5list
[bt5-repository]
# Format:
# <url or path> [...]
#
# Use absolute paths for local repositories, and URLs for non-local otherwise.
#
list = ${local-bt5-repository:list}
[local-bt5-repository]
# Same as bt5-repository, but only local repository.
# Used to generate bt5lists.
list = ${erp5:location}/bt5 ${erp5:location}/product/ERP5/bootstrap
[genbt5list]
recipe = plone.recipe.command
stop-on-error = true
genbt5list = ${erp5:location}/product/ERP5/bin/genbt5list
command =
${buildout:executable} ${:genbt5list} ${local-bt5-repository:list}
update-command = ${:command}
[bootstrap2.6]
[bootstrap2.6]
python = python2.6
python = python2.6
...
...
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