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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
63967191
Commit
63967191
authored
May 03, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Trac with LD_LIBRARY_PATH
parent
3411b14d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
slapos/recipe/trac.py
slapos/recipe/trac.py
+7
-5
software/trac-svn/instance-trac.cfg
software/trac-svn/instance-trac.cfg
+2
-0
software/trac-svn/software.cfg
software/trac-svn/software.cfg
+2
-2
software/trac-svn/templates/create-svn-repo.sh.in
software/trac-svn/templates/create-svn-repo.sh.in
+1
-0
No files found.
slapos/recipe/trac.py
View file @
63967191
...
...
@@ -54,6 +54,8 @@ class Recipe(GenericBaseRecipe):
def
install
(
self
):
install_path
=
[]
env
=
os
.
environ
env
[
'LD_LIBRARY_PATH'
]
=
self
.
options
[
'python-lib'
]
project_dir
=
self
.
options
[
'site-dir'
].
strip
()
trac_admin
=
self
.
options
[
'trac-admin'
].
strip
()
admin
=
self
.
options
[
'admin-user'
].
strip
()
...
...
@@ -74,7 +76,7 @@ class Recipe(GenericBaseRecipe):
self
.
options
[
'mysql-database'
].
strip
()
)
process_install
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
process_install
.
stdin
.
write
(
'%s
\
n
%s
\
n
'
%
(
self
.
options
[
'project'
].
strip
(),
db_string
))
result
=
process_install
.
communicate
()[
0
]
...
...
@@ -96,7 +98,7 @@ class Recipe(GenericBaseRecipe):
%
project_dir
)
trac_args
=
[
trac_admin
,
project_dir
,
'upgrade'
]
process_upgrade
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
result
=
process_upgrade
.
communicate
()[
0
]
if
process_upgrade
.
returncode
is
None
or
process_upgrade
.
returncode
!=
0
:
self
.
logger
.
error
(
"Failed to upgrade Trac.
\
n
The error was: %s"
%
result
)
...
...
@@ -106,7 +108,7 @@ class Recipe(GenericBaseRecipe):
self
.
logger
.
info
(
"Granting admin rights to the admin user."
)
trac_grant
=
[
trac_admin
,
project_dir
,
"permission add %s TRAC_ADMIN"
%
admin
]
process
=
subprocess
.
Popen
(
trac_grant
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
result
=
process
.
communicate
()[
0
]
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
raise
Exception
(
"Failed to execute Trac-admin.
\
n
The error was: %s"
%
result
)
...
...
@@ -146,9 +148,9 @@ class Recipe(GenericBaseRecipe):
subprocess
.
check_call
([
self
.
options
[
'git-binary'
],
'init'
,
'--bare'
,
absolute_path
])
subprocess
.
check_call
([
trac_admin
,
project_dir
,
'repository'
,
'add'
,
repo
,
absolute_path
,
'git'
])
'add'
,
repo
,
absolute_path
,
'git'
]
,
env
=
env
)
subprocess
.
check_call
([
trac_admin
,
project_dir
,
'repository'
,
'resync'
,
repo
])
'resync'
,
repo
]
,
env
=
env
)
# XXX: Hardcoded path
shutil
.
copy
(
self
.
options
[
'trac-git-hook'
].
strip
(),
os
.
path
.
join
(
absolute_path
,
'hooks/post-commit'
))
...
...
software/trac-svn/instance-trac.cfg
View file @
63967191
...
...
@@ -280,6 +280,7 @@ mode = 0700
trac_admin = ${buildout:bin-directory}
svn_bin = ${subversion-1.9:location}/bin
svn_python = ${subversion-1.9:location}/lib/svn-python
python_lib = ${python2.7:location}/lib
[gitweb-conf]
recipe = slapos.recipe.template
...
...
@@ -326,6 +327,7 @@ plugins-egg-dir = ${trac-plugins-egg:location}
eggs-dirs =
${buildout:eggs-directory}
${buildout:develop-eggs-directory}
python-lib = ${python2.7:location}/lib
trac-admin = ${buildout:bin-directory}/trac-admin
admin-user = $${trac-admin:user}
admin-password = $${trac-admin:password}
...
...
software/trac-svn/software.cfg
View file @
63967191
...
...
@@ -89,7 +89,7 @@ md5sum = bc6ed91a1862a10af661713aa0691848
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-trac.cfg
output = ${buildout:directory}/template-trac.cfg
md5sum =
8c05ef460aa15ba5b6c2a1250afbba82
md5sum =
bbdadd638ac10c5ca652fca27bf18fff
mode = 0644
[instance-mariadb]
...
...
@@ -133,7 +133,7 @@ md5sum = 917deaeda572ca3e98c2baaf15fcdacc
[create-svn-repo]
<= template-download
filename = create-svn-repo.sh.in
md5sum =
7ec8822bd5676c3506f079e33ed9f771
md5sum =
3e4d25ce53dcc3729f4bc682e0d2d239
[template-httpd-conf]
<= template-download
...
...
software/trac-svn/templates/create-svn-repo.sh.in
View file @
63967191
...
...
@@ -2,6 +2,7 @@
export
PATH
=
${
:trac_admin
}
:
${
:svn_bin
}
:
$PATH
export
PYTHONPATH
=
${
:svn_python
}
:
$PYTHONPATH
export
LD_LIBRARY_PATH
=
${
:python_lib
}
:
$LD_LIBRARY_PATH
ENV
=
"
$1
"
REPO
=
"
$2
"
...
...
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