martes, 30 de marzo de 2010

How to start publishing your project in sourceforge

How to start publishing your project in sourceforge

This article is a step/by/step guide to those who want to maintain their development projects in sourceforge.net, with svn support for sharing their source code and a project web site.

First of all I suppose you have already created a new project in sourceforge.net. The important thing to remember is the project's unix name. In the following examples, my sourceforge.net user name is cancerbero_sgx and my project unix name is yui4java. As an administrator of your new project, using a linux shell, you can do the following activities:

copy files and directories with rsync:

# rsync -avP -e ssh foo.txt cancerbero_sgx,yui4java@web.sourceforge.net:htdocs/
# rsync -avP -e ssh /home/sgurin/dir1 cancerbero_sgx,yui4java@web.sourceforge.net:htdocs/

those will copy (synchronize) the file foo.txt and the directory /home/sgurin/dir1 to project's htdocs directory.

conecting using sftp:

sftp cancerbero_sgx,yui4java@web.sourceforge.net

Getting a web shell with ssh

with this option you will have access to a remote terminal in sf.net and there execute commands, access files ,etc
for connecting I use:

ssh -t cancerbero_sgx,yui4java@shell.sourceforge.net create


Publish your source code using svn

This will create a svn repository from a local source directory. Be carefull when typing commands when creating a new repository! Once this is done, you can svn checkout your own source files. Then you can work with svn (svn update, svn commit) in your own local working copy.

first you need to create a repository. for this you have to:

1)
connect via ssh as explained beore

2)
type the command :
adminrepo --checkout svn
(this will create a clone copy of your repository in /svnroot/yui4java.
* Use adminrepo --help for further information.)

3)
type the following commands (be carefull!)
rm -rf /svnroot/yui4java/*
# (Remove the clone copy of your repo)
create /svnroot/PROJECT
# (Create a new repository)

4)
type the following commands
cd
adminrepo --save svn


that operation can take some seconds... Once it is done, you can use your new svn repository. With the following command we will import a local source code directory into the svn repository:

svn import /home/sgurin/my/local/src/folder https://yui4java.svn.sourceforge.net/svnroot/yui4java/trunk

web page

The last thing we will create for our new project is its web page in sourceforge.net. In our project's main folder, we have the directory htdocs and this is the directory that is exposed to the web. In my example, this diretory is located at /home/groups/y/yu/yui4java/htdocs. This means that a file there, for example, /home/groups/y/yu/yui4java/htdocs/example.html can be navigated from http://yui4java.sourceforge.net/example.html.

it is important that all directory accesible from the web (for example, directories with javascript, css, images, etc), to contain a file .htaccess with the following content:

Options +Indexes
that's all. I hope this can be usefull to new sourceforge users.

1 comentario:

Anónimo dijo...

Hello, yup this ρaragгaph is in fаct good and I have learned lot of things fгom it cοnсеrning blogging.
thanks.

my web blog: ultrasound tech schools in michigan