Merge "Fix etherpad lite's use of git."

This commit is contained in:
Jenkins 2012-06-06 20:47:33 +00:00 committed by Gerrit Code Review
commit 75d632bf64
2 changed files with 21 additions and 11 deletions

View File

@ -3,16 +3,24 @@ define git_repo (
$repo,
$dest,
$user = 'root',
$branch = 'master'
$branch = 'master',
$clone_only = undef
) {
if $clone_only == 'true' {
$checkout_condition = "false"
}
else {
$checkout_condition = "test -d ${dest}"
}
# if we already have the git repo the pull updates
exec { "update_${title}":
command => "git pull --ff-only origin ${branch}",
cwd => $dest,
path => '/bin:/usr/bin',
user => $user,
onlyif => "test -d ${dest}",
onlyif => $checkout_condition,
before => Exec["clone_${title}"],
}
@ -108,10 +116,11 @@ class etherpad_lite (
}
git_repo { 'nodejs_repo':
repo => 'https://github.com/joyent/node.git',
dest => "${base_install_dir}/nodejs",
branch => 'v0.6.16-release',
require => Package['git']
repo => 'https://github.com/joyent/node.git',
dest => "${base_install_dir}/nodejs",
branch => 'v0.6.16-release',
clone_only => 'true',
require => Package['git']
}
package { ['gzip',
@ -135,10 +144,11 @@ class etherpad_lite (
}
git_repo { 'etherpad_repo':
repo => 'https://github.com/Pita/etherpad-lite.git',
dest => "${base_install_dir}/etherpad-lite",
user => $ep_user,
require => Package['git']
repo => 'https://github.com/Pita/etherpad-lite.git',
dest => "${base_install_dir}/etherpad-lite",
user => $ep_user,
clone_only => 'true',
require => Package['git']
}
exec { 'install_etherpad_dependencies':

View File

@ -27,7 +27,7 @@ class etherpad_lite::mysql {
} ->
exec { "grant-etherpad-lite-db":
unless => "mysql -ueplite -p'`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`' etherpad-lite",
unless => "mysql -ueplite -p\"`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`\" etherpad-lite",
path => ['/bin', '/usr/bin'],
command => "mysql --defaults-file=/etc/mysql/debian.cnf -e \"grant all on \`etherpad-lite\`.* to 'eplite'@'localhost' identified by '`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`';\" mysql",
require => [Service['mysql'],