Difference between revisions of "Service/git"

From Sugar Labs
Jump to navigation Jump to search
Line 1: Line 1:
<noinclude>{{TOCright}}</noinclude>
 
 
== Hostnames ==
 
== Hostnames ==
 +
 
* http://git.sugarlabs.org
 
* http://git.sugarlabs.org
* http://cgit.sugarlabs.org
 
  
 
== Hardware ==
 
== Hardware ==
* XEN VM
 
  
= Location =
+
[[Machine/jita]]
Hosted by the [http://www.osuosl.org/ Open Source Lab]
+
 
 +
== Administrative contact ==
 +
 
 +
git AT sugarlabs DOT org
 +
 
 +
== Sysadmins ==
 +
 
 +
For non-emergency calls, preferably send email to the administrative contact.
  
== Admins ==
+
* [[User:alsroot|Aleksey Lim]]
* OSL Support <support AT osuosl.org> (ask here for anything that requires root access)
+
* ''puppet related stuff is still in progress of settling down''
* Lance Albertson <lance AT osuosl.org>, Ramereth on #osuosl Freenode
 
* [[User:Bernie|Bernie Innocenti]], bernie on #sugar Freenode
 
* [[User:LFaraone|Luke Faraone]], lfaraone on #sugar Freenode
 
* [[User:sascha_silbe|Sascha Silbe]], silbe on #sugar Freenode
 
  
 
== Notes ==
 
== Notes ==
  
=== Web interface ===
+
[http://gitorious.org/ Gitorious] hosting.
http://admin.osuosl.org/phpmyadmin
+
 
 +
{| class="wikitable"
 +
|-
 +
!scope="row" | Home
 +
|{{Code|/srv/gitorious}}
 +
|-
 +
|}
  
 
=== Gitorious environments ===
 
=== Gitorious environments ===
Line 76: Line 83:
 
=== Restart gitorious after code/config changes ===
 
=== Restart gitorious after code/config changes ===
 
  touch tmp/restart.txt
 
  touch tmp/restart.txt
 +
 +
== Upgrade notes ==
 +
 +
Upgrade will be triggered on every puppet session, vcs repository will be rebased to the HEAD commit.

Revision as of 11:11, 9 November 2010

Hostnames

Hardware

Machine/jita

Administrative contact

git AT sugarlabs DOT org

Sysadmins

For non-emergency calls, preferably send email to the administrative contact.

  • Aleksey Lim
  • puppet related stuff is still in progress of settling down

Notes

Gitorious hosting.

Home /srv/gitorious

Gitorious environments

We do not have root on git.sugarlabs.org. Put the following aliases in your ~/.bashrc to quickly switch to the Gitorious production, test and development environments:

alias gitorious='sudo su - gitorious'
alias gittest='sudo su - gittest'
alias gitdev='sudo su - gitdev'
alias db='mysql -h db1.osuosl.org -u sugarlabs_git -p  sugarlabs_git_dev'

Get a MySQL prompt

type "db" at the prompt, then give the db password from ~gitorious/config/database.yml

Change project owner

UPDATE projects SET user_id=(SELECT id FROM users WHERE login='jasg') WHERE slug='labyrinth';

Change repo owner

UPDATE repositories SET user_id=(SELECT id FROM users WHERE login='jasg') WHERE name='mainline' AND project_id=(SELECT id FROM projects WHERE title='poll');

Add committer

INSERT INTO committerships SET
       user_id=(select id from users where login='bernie'),
       repository_id=(SELECT id FROM repositories where
               project_id=(SELECT id FROM projects WHERE title='sugar') AND name='mainline'),
       kind=2, created_at=NOW(), updated_at=NOW();

Hijack account to reset password

update users set email='YOUREMAIL' where login='USER';

Then make Gitorious send you a password reset email.

update users set email='OLDEMAIL' where login='USER';

Zapping a user account

WARNING: to kill a user account, make sure you also remove *ALL* its associated records from all tables, or Gitorious will break in non-obvious ways.

SELECT id FROM users WHERE login='demian';
DELETE FROM committers WHERE user_id=666;
DELETE FROM events WHERE user_id=666;
DELETE FROM comments WHERE user_id=666;
DELETE FROM merge_requests WHERE user_id=666;
DELETE FROM repositories WHERE user_id=666;
DELETE FROM projects WHERE user_id=666;

NOTE: tch pointed out that Rails applications often provide a higher-level method in class User which deletes the record and its associated entries. However, our deployed version of Gitorious does not seem to provide it.

Restart gitorious after code/config changes

touch tmp/restart.txt

Upgrade notes

Upgrade will be triggered on every puppet session, vcs repository will be rebased to the HEAD commit.