Line 1: |
Line 1: |
| + | Deprecated. Unavailable from 31st July 2022. --[[User:Quozl|Quozl]] ([[User talk:Quozl|talk]]) 19:21, 4 February 2023 (EST) |
| + | |
| == Hostnames == | | == Hostnames == |
| | | |
− | * http://git.sugarlabs.org | + | * [http://git.sugarlabs.org git.sugarlabs.org], Gitorious main site. |
| + | * [http://src.sugarlabs.org/ src.sugarlabs.org], Git repositories capable for HTTP cloning. |
| + | * Gitorious diagnostic page (only for admins) [http://git.sugarlabs.org/admin/diagnostics]. |
| + | * Gitorious diagnostic summary page [http://git.sugarlabs.org/admin/diagnostics/summary]. |
| | | |
| == Hardware == | | == Hardware == |
| | | |
− | [[Machine/housetree/jita]] | + | [[Machine/jita]] |
| | | |
| == Administrative contact == | | == Administrative contact == |
Line 110: |
Line 115: |
| sudo -u gitorious RAILS_ENV=production script/console | | sudo -u gitorious RAILS_ENV=production script/console |
| | | |
− | It is regular Ruby console and all feature like {{Code|TAB}} completion work. To tweak Gitorious data, just use its [http://gitorious.org/gitorious/mainline/trees/master/app/models model classes], e.g.: | + | It is regular Ruby console and all features, like {{Code|TAB}} completion, work. To tweak Gitorious data, just use its [http://gitorious.org/gitorious/mainline/trees/master/app/models model classes], e.g.: |
| | | |
| # search of particular object by its attributes | | # search of particular object by its attributes |
Line 156: |
Line 161: |
| repo.name = "sat-solver" | | repo.name = "sat-solver" |
| repo.save! | | repo.save! |
| + | |
| + | # check users permissions for particular repository |
| + | repo = Repository::find_by_path("pukllanapac/mainline") |
| + | repo.committerships.each {|i| puts "#{User.find(i.committer_id).login} review=#{i.permissions & Committership::CAN_REVIEW > 0}"} |
| + | repo.committerships.each {|i| puts "#{User.find(i.committer_id).login} commit=#{i.permissions & Committership::CAN_COMMIT > 0}"} |
| + | repo.committerships.each {|i| puts "#{User.find(i.committer_id).login} admin=#{i.permissions & Committership::CAN_ADMIN > 0}"} |
| | | |
| === TODO === | | === TODO === |
Line 176: |
Line 187: |
| cd /srv/gitorious/app/ | | cd /srv/gitorious/app/ |
| sudo -u gitorious RAILS_ENV=production rake db:migrate | | sudo -u gitorious RAILS_ENV=production rake db:migrate |
| + | |
| + | To restart only Web application, instead of restarting the daemon, call: |
| + | |
| + | touch /srv/gitorious/app/tmp/restart.txt |
| + | |
| + | === Hardware migration === |
| + | |
| + | '''Disable servers of both hosts.''' |
| + | |
| + | mv /srv/gitorious/ssh/.ssh/authorized_keys{,.bak} |
| + | |
| + | a2dissite git.sugarlabs.org |
| + | a2dissite cgit.sugarlabs.org |
| + | /etc/init.d/apache2 reload |
| + | |
| + | /etc/init.d/gitorious-git stop |
| + | /etc/init.d/gitorious-poller stop |
| + | /etc/init.d/gitorious-sphinx stop |
| + | /etc/init.d/gitorious-stomp stop |
| + | |
| + | '''On old server.''' |
| + | |
| + | * Dump MySQL database: |
| + | |
| + | mysqldump -u root -h localhost -p gitorious | xz > dump.slq.xz |
| + | |
| + | '''On new server.''' |
| + | |
| + | * Create MySQL user and database for Gitorious: |
| + | |
| + | GRANT ALL PRIVILEGES ON *.* TO 'gitorious'@'localhost' IDENTIFIED BY '<insert password>' WITH GRANT OPTION; |
| + | FLUSH PRIVILEGES; |
| + | CREATE DATABASE gitorious; |
| + | |
| + | * Make preparations from root user: |
| + | |
| + | useradd gitorious -d /srv/gitorious/ssh -m |
| + | cat >> /srv/gitorious/ssh/.profile <<EOF |
| + | export RAILS_ENV=production |
| + | cd /srv/gitorious/app |
| + | EOF |
| + | xzcat dump.slq.xz | mysql -u root -p -D gitorious |
| + | |
| + | * Make preparations from gitorious user: |
| + | |
| + | su - gitorious |
| + | |
| + | mkdir /srv/gitorious/repositories-mirror |
| + | mkdir /srv/gitorious/repositories-mirror |
| + | mkdir /srv/gitorious/tmp |
| + | |
| + | git clone git://git.sugarlabs.org/sl-tweaks/gitorious.git /srv/gitorious/app |
| + | |
| + | rsync --delete-after -PHAXhaxv $OLD_HOST:/srv/gitorious/repositories/ /srv/gitorious/repositories/ |
| + | rsync --delete-after -PHAXhaxv $OLD_HOST:/srv/gitorious/app/public/system/ /srv/gitorious/app/public/system/ |
| + | rsync --delete-after -PHAXhaxv $OLD_HOST:/srv/gitorious/ssh/.ssh/authorized_keys.bak /srv/gitorious/ssh/.ssh/authorized_keys |
| + | |
| + | cd /srv/gitorious/app |
| + | rake db:migrate |
| + | rake ts:rebuild |
| + | rake mirror:symlinkedrepos |
| + | rake assets:clear |
| + | |
| + | * Start up Gitorious. |
| + | |
| + | a2ensite git.sugarlabs.org |
| + | a2ensite cgit.sugarlabs.org |
| + | /etc/init.d/apache2 reload |
| + | |
| + | /etc/init.d/gitorious-git start |
| + | /etc/init.d/gitorious-poller start |
| + | /etc/init.d/gitorious-sphinx start |
| + | /etc/init.d/gitorious-stomp start |
| + | |
| + | == Sources == |
| + | |
| + | * [https://gitorious.org/~alsroot/gitorious/sugarlabs-org Downstream repository]. |
| + | * [https://gitorious.org/gitorious/mainline Upstream repository]. |