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
Łukasz Nowak
slapos
Commits
72fe465b
Commit
72fe465b
authored
Apr 18, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dedicaced python, update dependency between Trac and Mysql
parent
e6a156b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
slapos/recipe/trac.py
slapos/recipe/trac.py
+21
-9
software/trac-svn/instance-trac.cfg
software/trac-svn/instance-trac.cfg
+4
-0
software/trac-svn/software.cfg
software/trac-svn/software.cfg
+1
-1
No files found.
slapos/recipe/trac.py
View file @
72fe465b
...
...
@@ -43,8 +43,7 @@ class Recipe(GenericBaseRecipe):
if
eggs
:
for
item
in
os
.
listdir
(
eggs
):
path
=
os
.
path
.
join
(
eggs
,
item
)
if
os
.
path
.
isdir
(
path
):
pythonPath
=
path
+
":"
+
pythonPath
pythonPath
=
path
+
":"
+
pythonPath
options
[
'python_path'
]
=
pythonPath
options
[
'wsgi-dir'
]
=
os
.
path
.
join
(
options
[
'site-dir'
].
strip
(),
'apache'
)
...
...
@@ -60,7 +59,10 @@ class Recipe(GenericBaseRecipe):
admin
=
self
.
options
[
'admin-user'
].
strip
()
passwd
=
self
.
options
[
'admin-password'
].
strip
()
config
=
os
.
path
.
join
(
project_dir
,
'conf/trac.ini'
)
filestat
=
self
.
options
[
'file-status'
].
strip
()
self
.
logger
.
info
(
"Checking if trac project is not installed..."
)
if
os
.
path
.
exists
(
filestat
):
os
.
unlink
(
filestat
)
if
not
os
.
path
.
exists
(
project_dir
):
self
.
logger
.
info
(
"Starting trac project installation at %s"
%
project_dir
)
trac_args
=
[
trac_admin
,
project_dir
,
'initenv'
]
...
...
@@ -71,15 +73,17 @@ class Recipe(GenericBaseRecipe):
self
.
options
[
'mysql-port'
].
strip
(),
self
.
options
[
'mysql-database'
].
strip
()
)
process
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
process
_install
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
process
.
stdin
.
write
(
'%s
\
n
%s
\
n
'
%
(
self
.
options
[
'project'
].
strip
(),
process
_install
.
stdin
.
write
(
'%s
\
n
%s
\
n
'
%
(
self
.
options
[
'project'
].
strip
(),
db_string
))
result
=
process
.
communicate
()[
0
]
process
.
stdin
.
close
()
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
shutil
.
rmtree
(
project_dir
)
raise
Exception
(
"Failed to execute Trac-admin.
\
n
The error was: %s"
%
result
)
result
=
process_install
.
communicate
()[
0
]
process_install
.
stdin
.
close
()
if
process_install
.
returncode
is
None
or
process_install
.
returncode
!=
0
:
if
os
.
path
.
exists
(
project_dir
):
shutil
.
rmtree
(
project_dir
)
self
.
logger
.
error
(
"Failed to initialize Trac.
\
n
The error was: %s"
%
result
)
return
[]
os
.
mkdir
(
self
.
options
[
'wsgi-dir'
])
os
.
mkdir
(
self
.
options
[
'git-dir'
])
os
.
mkdir
(
self
.
options
[
'svn-dir'
])
...
...
@@ -90,6 +94,13 @@ class Recipe(GenericBaseRecipe):
else
:
self
.
logger
.
info
(
"The directory %s already exist, skip project installation"
%
project_dir
)
trac_args
=
[
trac_admin
,
project_dir
,
'upgrade'
]
process_upgrade
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
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
)
return
[]
#Add All grant to admin user
self
.
logger
.
info
(
"Granting admin rights to the admin user."
)
...
...
@@ -146,6 +157,7 @@ class Recipe(GenericBaseRecipe):
(
user
,
result
))
fd
.
write
(
"
\
n
%s = %s"
%
(
user
,
user_list
[
user
]))
fd
.
close
()
open
(
filestat
,
"w"
).
write
(
"done."
)
return
install_path
software/trac-svn/instance-trac.cfg
View file @
72fe465b
...
...
@@ -313,6 +313,7 @@ svn-repo-script = $${trac-svnrepo-script:output}
post-revprop-change = $${post-revprop-change-script:output}
trac-svn-hook = $${trac-svn-hook-script:output}
trac-git-hook = $${trac-git-hook-script:output}
file-status = $${buildout:directory}/.status
#Trac User list
htpasswd = ${apache:location}/bin/htpasswd
passwd-file = $${trac-config:project_dir}/.htpasswd
...
...
@@ -323,7 +324,9 @@ user-list = $${slap-parameter:trac-user-list}
recipe = slapos.cookbook:wrapper
command-line = ${apache:location}/bin/httpd -DFOREGROUND -f "$${httpd-conf:output}"
environment = PYTHONPATH=${subversion-1.9:location}/lib/svn-python:$${inittrac:python_path}
PATH=${python2.7:location}/bin:$PATH
wrapper-path = $${basedirectory:services}/httpd
wait-for-files = $${inittrac:file-status}
[logrotate-entry-apache]
<= logrotate
...
...
@@ -433,6 +436,7 @@ path = $${basedirectory:promises}/content
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
match = $${slap-parameter:project-name}
[slap-parameter]
domain =
...
...
software/trac-svn/software.cfg
View file @
72fe465b
...
...
@@ -115,7 +115,7 @@ md5sum = bc6ed91a1862a10af661713aa0691848
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-trac.cfg
output = ${buildout:directory}/template-trac.cfg
md5sum =
e31ae66fb08f9e44cedbaa09357b15ce
md5sum =
4c5caf5cfb7567964c54cd57adba46a4
mode = 0644
[create-svn-repo]
...
...
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