Ori.livneh has submitted this change and it was merged. Change subject: Use ppa to update git, then clone MediaWiki normally ......................................................................
Use ppa to update git, then clone MediaWiki normally This change tells puppet to add the git-core PPA to apt prior to installing git. This bumps the version of git installed by puppet to 1.8, which fixes the problems that made cloning the repository using 1.7.9.5 unfeasable. With Chad's work on making git-clones of MediaWiki core leaner, it is now sensible to clone the entire history. Change-Id: I9742facc682bb487a25760a522252e4d44cc59e9 --- M puppet/modules/mediawiki/manifests/git.pp M puppet/modules/mediawiki/manifests/init.pp M puppet/modules/mediawiki/manifests/phpsh.pp 3 files changed, 17 insertions(+), 39 deletions(-) Approvals: Ori.livneh: Verified Yurik: Looks good to me, approved diff --git a/puppet/modules/mediawiki/manifests/git.pp b/puppet/modules/mediawiki/manifests/git.pp index fc7a3b2..0bf5d35 100644 --- a/puppet/modules/mediawiki/manifests/git.pp +++ b/puppet/modules/mediawiki/manifests/git.pp @@ -1,50 +1,28 @@ # Clone MediaWiki via Git class mediawiki::git( - $repository = 'https://gerrit.wikimedia.org/r/p/mediawiki/core.git', - $branch = 'master', - $depth = 1 + $remote = 'https://gerrit.wikimedia.org/r/p/mediawiki/core.git' ) { + + exec { 'add-git-core-ppa': + command => 'add-apt-repository --yes ppa:git-core/ppa && apt-get update', + creates => '/etc/apt/sources.list.d/git-core-ppa-precise.list', + before => Package['git'], + } package { 'git': ensure => latest, + before => Exec['git-clone-mediawiki'], } - file { '/vagrant/mediawiki': - ensure => 'directory', - owner => 'vagrant', - mode => '0770', - group => 'www-data', - } - - # Git < 1.7.10 pulls all branches; 1.7.10 versions added '--single-branch'. - # This difference means having to count and fetch ~3,000 objects / 19 MB or - # ~50,000 objects and >100MB. The workaround here is to initialize an empty - # directory and fetch a remote branch into it. - # - # See https://bugzilla.wikimedia.org/46041 for more information. - - exec { 'initialize-empty-repository': - creates => '/vagrant/mediawiki/.git', - command => 'git init', - cwd => '/vagrant/mediawiki', - } - - exec { 'fetch-mediawiki': + exec { 'git-clone-mediawiki': creates => '/vagrant/mediawiki/.git/refs/remotes', - command => "git fetch --depth=${depth} ${repository} ${branch}:refs/remotes/origin/${branch}", - cwd => '/vagrant/mediawiki', + command => "git clone ${remote} /vagrant/mediawiki", logoutput => true, } - exec { 'checkout-master': - creates => '/vagrant/mediawiki/README', - command => "git checkout ${branch}", - cwd => '/vagrant/mediawiki', + exec { 'install-git-review': + command => 'pip install -U git-review', + unless => 'which git-review', + require => Package['python-pip', 'git'], } - - File['/vagrant/mediawiki'] -> Exec['initialize-empty-repository'] - Package['git'] -> Exec['initialize-empty-repository'] - Package['git'] -> Exec['fetch-mediawiki'] - Exec['initialize-empty-repository'] -> Exec['fetch-mediawiki'] - Exec['fetch-mediawiki'] -> Exec['checkout-master'] } diff --git a/puppet/modules/mediawiki/manifests/init.pp b/puppet/modules/mediawiki/manifests/init.pp index 4bb7451..6284b47 100644 --- a/puppet/modules/mediawiki/manifests/init.pp +++ b/puppet/modules/mediawiki/manifests/init.pp @@ -27,7 +27,7 @@ # delete it. exec { 'check-settings': command => 'rm /vagrant/mediawiki/LocalSettings.php 2>/dev/null || true', - require => [ Package['php5'], Exec['fetch-mediawiki'], Service['mysql'] ], + require => [ Package['php5'], Exec['git-clone-mediawiki'], Service['mysql'] ], unless => 'php /vagrant/mediawiki/maintenance/eval.php <<<"wfGetDB(-1)" &>/dev/null', before => Exec['mediawiki-setup'], } @@ -38,7 +38,7 @@ } exec { 'mediawiki-setup': - require => Exec['set-mysql-password', 'fetch-mediawiki'], + require => Exec['set-mysql-password', 'git-clone-mediawiki'], creates => '/vagrant/mediawiki/LocalSettings.php', cwd => '/vagrant/mediawiki/maintenance/', command => "php install.php ${wiki} ${admin} --pass ${pass} --dbname ${dbname} --dbuser ${dbuser} --dbpass ${dbpass} --server ${server} --scriptpath '/w'", diff --git a/puppet/modules/mediawiki/manifests/phpsh.pp b/puppet/modules/mediawiki/manifests/phpsh.pp index df44808..02ca095 100644 --- a/puppet/modules/mediawiki/manifests/phpsh.pp +++ b/puppet/modules/mediawiki/manifests/phpsh.pp @@ -33,7 +33,7 @@ } exec { 'generate-ctags': - require => [ Package['exuberant-ctags'], Exec['fetch-mediawiki'] ], + require => [ Package['exuberant-ctags'], Exec['git-clone-mediawiki'] ], command => 'ctags --languages=php --recurse -f /vagrant/mediawiki/tags /vagrant/mediawiki', creates => '/vagrant/mediawiki/tags', } -- To view, visit https://gerrit.wikimedia.org/r/56777 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9742facc682bb487a25760a522252e4d44cc59e9 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Ori.livneh <[email protected]> Gerrit-Reviewer: Ori.livneh <[email protected]> Gerrit-Reviewer: Parent5446 <[email protected]> Gerrit-Reviewer: Yurik <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
