How To CSDMS Subversion: Difference between revisions

From CSDMS
Huttone (talk | contribs)
Create how to page for creating a new CSDMS subversion user
 
m Text replacement - "http://csdms.colorado.edu" to "https://csdms.colorado.edu"
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==== Create a CSDMS subversion repository ====
= Create a CSDMS subversion repository =


First of all, our subversion repository is located on mysticplum at: /mysticplum/data/subversion.  To add a new user:
First of all, our subversion repository is located on river at: /data/svn.  To add a new user:
<geshi>
<syntaxhighlight lang="bash" lines="0">
> /usr/local/apache/bin/htdigest /mysticplum/data/subversion/conf/svn-auth-file Subversion <username>
> /usr/bin/htdigest /data/svn/conf/svn-auth-file Subversion <username>
</geshi>
</syntaxhighlight>
This of course must be done as root.  The username needn't be a mysticplum username (although it can be).
This of course must be done as root.  The username needn't be a mysticplum username (although it can be).


Create the new repository (again as root):
Create the new repository (again as root):
<geshi>
<syntaxhighlight lang="bash" lines="0">
> svnadmin create /mysticplum/data/subversion/newrepos
> svnadmin create /data/svn/newrepos
</geshi>
</syntaxhighlight>
Create a project group that contains members that are allowed to view and commit changes to the project.  In addition, allow anyone to be able to browse the contents of the repository.  This is done by editing <tt>subversion/conf/svn-access-file</tt>.  To create a new group, define it and its members under the <tt>[groups]</tt> section:
Create a project group that contains members that are allowed to view and commit changes to the project.  In addition, allow anyone to be able to browse the contents of the repository.  This is done by editing <tt>subversion/conf/svn-access-file</tt>.  To create a new group, define it and its members under the <tt>[groups]</tt> section:
<geshi>
<syntaxhighlight lang="bash" lines="0">
[groups]
[groups]
newgroup = huttone
newgroup = huttone
</geshi>
</syntaxhighlight>
In this case, the group is called <tt>newgroup</tt> (it doesn't have to match a repository name) and the only member of the group is huttone.  Now specify the access privileges of the repository:
In this case, the group is called <tt>newgroup</tt> (it doesn't have to match a repository name) and the only member of the group is huttone.  Now specify the access privileges of the repository:
<geshi>
<syntaxhighlight lang="bash" lines="0">
[newgroup:/]
[newgroup:/]
* = r
* = r
@newrepos = rw
@newrepos = rw
</geshi>
</syntaxhighlight>
The first line indicates the repository, the second allows viewing of the repository by anyone, and the third limits commits to only group members.  Change ownership of the directory to be nobody:
The first line indicates the repository, the second allows viewing of the repository by anyone, and the third limits commits to only group members.  Change ownership of the directory to be nobody:
<geshi lang=bash>
<syntaxhighlight lang="bash" lines="0">
> sudo chown -R nobody /mysticplum/data/subversion/newrepos
> sudo chown -R nobody /data/svn/newrepos
</geshi>
</syntaxhighlight>
The new repository can now be viewed with a browser at https://csdms.colorado.edu/svn/newrepos.
The new repository can now be viewed with a browser at https://csdms.colorado.edu/svn/newrepos.  Alternatively, repositories can be browsed at https://csdms.colorado.edu/viewvc.


==== The Initial Import ====
==== The Initial Import ====


To get you unversioned files into the svn repository, use svn import. For example:
To get you unversioned files into the svn repository, use svn import. For example:
<geshi>
<syntaxhighlight lang="bash" lines="0">
> svn import mydir https://csdms.colorado.edu/svn/newrepos -m "Inital import"
> svn import mydir https://csdms.colorado.edu/svn/newrepos -m "Inital import"
Adding        newrepos/file1.f
Adding        newrepos/file1.f
Line 37: Line 37:


Committed revision 1.
Committed revision 1.
</geshi>
</syntaxhighlight>


This copied the contents of the directory mydir into newrepos.
This copied the contents of the directory mydir into newrepos.
<geshi>
<syntaxhighlight lang="bash" lines="0">
> svn list https://csdms.colorado.edu/svn/newrepos
> svn list https://csdms.colorado.edu/svn/newrepos
file1.f
file1.f
file2.f
file2.f
</geshi>
</syntaxhighlight>
You can now use svn checkout to get a working copy of your files.
You can now use svn checkout to get a working copy of your files.


Line 50: Line 50:


Users are free to use whatever repository layout they wish however there we recommend that you store the main development line of your code in a trunk directory, branches in a branches directory, and tags in a tags directory.  Thus:
Users are free to use whatever repository layout they wish however there we recommend that you store the main development line of your code in a trunk directory, branches in a branches directory, and tags in a tags directory.  Thus:
<geshi lang=bash>
<syntaxhighlight lang="bash" lines="0">
> svn list https://csdms.colorado.edu/svn/newrepos
> svn list https://csdms.colorado.edu/svn/newrepos
branches/
branches/
Line 59: Line 59:
file1.f
file1.f
file2.f
file2.f
</geshi>
</syntaxhighlight>

Latest revision as of 17:26, 19 February 2018

Create a CSDMS subversion repository

First of all, our subversion repository is located on river at: /data/svn. To add a new user:

> /usr/bin/htdigest /data/svn/conf/svn-auth-file Subversion <username>

This of course must be done as root. The username needn't be a mysticplum username (although it can be).

Create the new repository (again as root):

> svnadmin create /data/svn/newrepos

Create a project group that contains members that are allowed to view and commit changes to the project. In addition, allow anyone to be able to browse the contents of the repository. This is done by editing subversion/conf/svn-access-file. To create a new group, define it and its members under the [groups] section:

[groups]
newgroup = huttone

In this case, the group is called newgroup (it doesn't have to match a repository name) and the only member of the group is huttone. Now specify the access privileges of the repository:

[newgroup:/]
* = r
@newrepos = rw

The first line indicates the repository, the second allows viewing of the repository by anyone, and the third limits commits to only group members. Change ownership of the directory to be nobody:

> sudo chown -R nobody /data/svn/newrepos

The new repository can now be viewed with a browser at https://csdms.colorado.edu/svn/newrepos. Alternatively, repositories can be browsed at https://csdms.colorado.edu/viewvc.

The Initial Import

To get you unversioned files into the svn repository, use svn import. For example:

> svn import mydir https://csdms.colorado.edu/svn/newrepos -m "Inital import"
Adding         newrepos/file1.f
Adding         newrepos/file2.f

Committed revision 1.

This copied the contents of the directory mydir into newrepos.

> svn list https://csdms.colorado.edu/svn/newrepos
file1.f
file2.f

You can now use svn checkout to get a working copy of your files.

Repository Layout

Users are free to use whatever repository layout they wish however there we recommend that you store the main development line of your code in a trunk directory, branches in a branches directory, and tags in a tags directory. Thus:

> svn list https://csdms.colorado.edu/svn/newrepos
branches/
tags/
trunk/

> svn list https://csdms.colorado.edu/svn/newrepos/trunk
file1.f
file2.f