From Fedora Project Wiki

m (1 revision(s))
(Replaced content with "{{header|infra}} This SOP has moved to the fedora Infrastructure SOP git repo. Please see the current document at: http://infrastructure.fedoraproject.org/infra/docs/fedorah...")
 
(24 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<!-- Do not remove
+
{{header|infra}}
-->
 
<!-- StartHeader
 
-->
 
<pre>#!html
 
<div style="height:66px; width:100%; background-color:#002867;">
 
<a href = "http://fedoraproject.org/wiki/Infrastructure"> <img style="float:right;padding-top:3px;" src="http://fedoraproject.org/wiki/Infrastructure?action=AttachFile&do=get&target=InfrastructureTeamN1.png" /></a>
 
</div>
 
  
<HR style="height:2px; background-color:#00578E;" />
+
This SOP has moved to the fedora Infrastructure SOP git repo. Please see the current document at: http://infrastructure.fedoraproject.org/infra/docs/fedorahosted-repo-setup.txt
</pre>
 
<!-- EndHeader
 
-->
 
  
<!-- page was renamed from Infrastructure/ProjectHosting/Infrastructure/ProjectHosting/RepositorySetup
+
For changes, questions or comments, please contact anyone in the Fedora Infrastructure team.
-->
 
= Setup a New Mercurial, GIT, Bazaar, or SVN Repository =
 
  
Since Fedora already has public git and mercurial servers it's pretty easy to add a new project to them.
+
[[Category:Infrastructure]] [[Category:Hosted Projects]]
 
 
 
 
 
 
== Mercurial Repository ==
 
You'll need to know three things in order to start the mercurial repository.
 
1. PROJECTNAME -- what the project wants to be called.
 
1. OLDURL -- how to access the project's current sourcecode in their mercurial repository.
 
1. PROJECTGROUP -- the group setup in the account system for readwrite access to the repository.
 
 
 
The Mercurial repository lives on the hosted server.  Access it by logging into hosted1  Then follow these steps:
 
 
 
<pre>
 
$ cd /hg
 
$ sudo hg clone -U $OLDURL $PROJECTNAME (or sudo mkdir $PROJECTNAME; cd $PROJECTNAME; sudo hg init)
 
$ sudo find $PROJECTNAME -type d -exec chmod g+s \{\} \;
 
$ sudo chmod -R g+w $PROJECTNAME
 
$ sudo chown -R root:$PROJECTGROUP $PROJECTNAME
 
</pre>
 
 
 
This should setup all the files needed for the repository.
 
 
 
=== Commit Mail ===
 
 
 
The Mercurial [http://www.selenic.com/mercurial/wiki/index.cgi/NotifyExtension Notify extension]  can be used to send out email when commits are pushed to a Mecurial repository.  To enable notifications, create the file ''/hg/$PROJECTNAME/.hg/hgrc'':
 
 
 
<pre>
 
[extensions]
 
hgext.notify =
 
 
 
[hooks]
 
changegroup.notify = python:hgext.notify.hook
 
 
 
[email]
 
from = admin@fedoraproject.org
 
 
 
[smtp]
 
host = localhost
 
 
 
[web]
 
baseurl = http://hg.fedoraproject.org/hg
 
 
 
[notify]
 
sources = serve push pull bundle
 
test = False
 
config = /hg/$PROJECTNAME/.hg/subscriptions
 
maxdiff = -1
 
</pre>
 
 
 
And the file ''/hg/$PROJECTNAME/.hg/subscriptions'':
 
<pre>
 
[usersubs]  
 
 
 
user@host = *
 
 
 
[reposubs]  
 
</pre>
 
 
 
== Git Repository ==
 
You'll need to know three things in order to start the git repository.
 
1. PROJECTNAME -- what the project wants to be called.
 
1. OLDURL -- how to access the project's current source code in their git repository.
 
1. PROJECTGROUP -- the group setup in the account system for write access to the repository.
 
1. COMMITLIST -- comma-separated list of email addresses for commits (optional)
 
1. DESCRIPTION -- description of the project (optional)
 
 
 
The git repository lives on the hosted server.  Access it by logging into hosted1 Then follow these steps:
 
 
 
<pre>
 
$ cd /git
 
$ sudo git clone --bare $OLDURL $PROJECTNAME.git (or sudo mkdir $PROJECTNAME.git; pushd $PROJECTNAME.git; GIT_DIR=. sudo git init-db --shared=true; add a file; popd)
 
$ sudo chmod +x $PROJECTNAME.git/hooks/post-update
 
$ cd $PROJECTNAME.git; GIT_DIR=. sudo git-update-server-info; cd ../
 
$ sudo find $PROJECTNAME.git -type d -exec chmod g+s \{\} \;
 
$ sudo chmod -R g+w $PROJECTNAME.git
 
$ sudo chown -R root:$PROJECTGROUP $PROJECTNAME.git
 
</pre>
 
 
 
If you don't have any files in the repository then git will balk about it. Do this on hosted1 to make your repo work:
 
 
 
<pre>
 
$ cd
 
$ git clone /git/$PROJECTNAME.git
 
$ cd $PROJECTNAME
 
$ touch file
 
$ git add file
 
$ git commit
 
$ git push /git/$PROJECTNAME.git/ master
 
</pre>
 
 
 
This should setup all the files needed for the repository.
 
 
 
=== Commit Mail ===
 
If they want commit mail, then there are a couple of additional steps.
 
<pre>
 
$ echo $COMMITLIST > commit-list
 
$ echo $DESCRIPTION > description
 
$ ln -s /usr/bin/fedora-git-commit-mail-hook hooks/update
 
</pre>
 
 
 
== Bazaar Repository ==
 
You'll need to know three things in order to start a bazaar repository.
 
1. PROJECTNAME -- what the project wants to be called.
 
1. OLDBRANCHURL -- how to access the project's current sourcecode in their previous bazaar repository.  Note that a project may have multiple branches that they want to import.  Each branch will have a separate URL.  (The project can import the new branches after the repository is created if they want.)
 
1. PROJECTGROUP -- the group setup in the account system for readwrite access to the repository.
 
 
 
The bzr repository lives on the hosted server.  Access it by logging into hosted1 then follow these steps:
 
 
 
The first stage is to create the Bazaar repository.
 
<pre>
 
$ cd /srv/bzr/
 
$ # This creates a Bazaar repository which has shared storage between branches
 
$ sudo bzr init-repo $PROJECTNAME --no-trees
 
$ cd $PROJECTNAME
 
$ sudo bzr branch $OLDURL
 
$ sudo bzr branch $OLDURL2
 
$ # [...]
 
$ sudo bzr branch $OLDURLN
 
$ cd ..
 
$ sudo find $PROJECTNAME -type d -exec chmod g+s \{\} \;
 
$ sudo chmod -R g+w $PROJECTNAME
 
$ sudo chown -R root:$PROJECTGROUP $PROJECTNAME
 
</pre>
 
 
 
This should be all that is needed.  To checkout run:
 
<pre>
 
bzr init-repo $MYLOCALPROJECTREPO
 
cd $MYLOCALPROJECTREPO
 
bzr branch bzr+ssh://bzr.fedorahosted.org/bzr/$PROJECTNAME/$BRANCHNAME
 
bzr branch bzr://bzr.fedorahosted.org/bzr/$PROJECTNAME/$BRANCHNAME/
 
</pre>
 
Note: If the end user checks out a branch without creating their own repository they will need to create a local working tree by doing the following:
 
<pre>
 
cd $BRANCHNAME
 
bzr checkout --lightweight
 
</pre>
 
 
 
== SVN Repository ==
 
You'll need to know two things in order to start a svn repository.
 
1. PROJECTNAME -- what the project wants to be called.
 
2. PROJECTGROUP -- The Fedora account system group with read-write access.
 
 
 
SVN lives on the hosted server.  Access it by logging into hosted1.  Then run the following steps:
 
 
 
<pre>
 
$ cd /svn/
 
$ sudo svnadmin create $PROJECTNAME
 
$ sudo chgrp -R $GROUPNAME $PROJECTNAME
 
$ sudo chmod -R g+w $PROJECTNAME
 
$ find $PROJECTNAME -type d | sudo xargs chmod g+s
 
</pre>
 
 
 
This should be all that is needed.  To checkout run:
 
<pre>
 
svn co svn+ssh://svn.fedorahosted.org/svn/$PROJECTNAME
 
</pre>
 
 
 
 
 
== Monotone Repository *UNFINISHED DRAFT* ==
 
You'll need to know these things in order to start the Monotone repository:
 
1. PROJECTNAME -- what the project wants to be called.
 
1. PROJECTGROUP -- the group setup in the account system for write access to the repository.
 
 
 
The Monotone repository lives on the hosted server.
 
Access it by logging into hosted1.
 
Then follow these steps:
 
 
 
<pre>
 
$ cd /mtn/
 
$ sudo mkdir -m a=rx,g+ws,u+w $PROJECTNAME
 
$ sudo mtn --db $PROJECTNAME/db.mtn db init
 
$ sudo chgrp -R $PROJECTGROUP $PROJECTNAME
 
$ sudo chmod -R g+w $PROJECTNAME
 
</pre>
 
 
 
This should be all that is needed.  Now you have an empty database.
 
Anyone in the $PROJECTGROUP group can populate it using:
 
<pre>
 
mtn sync ssh://mtn.fedorahosted.org/mtn/hosted/$PROJECTNAME/db.mtn
 
</pre>
 
 
 
----
 
[[Category:Infrastructure]]
 

Latest revision as of 14:52, 20 January 2012

Infrastructure InfrastructureTeamN1.png


This SOP has moved to the fedora Infrastructure SOP git repo. Please see the current document at: http://infrastructure.fedoraproject.org/infra/docs/fedorahosted-repo-setup.txt

For changes, questions or comments, please contact anyone in the Fedora Infrastructure team.