Project

General

Profile

Creating Repositories and Projects

This site is running a slightly modified version of Redmine, to allow Admin users to select what sort of repository they
want to create. (see here and here for details.)

Create a project by
  • go to the Fermi Redmine Project Page, or any existing project you manage.
  • clicking on "New SubProject" to create the project
  • Filling out the form -- some notes:
    • you probably want to pick a different parent project than Fermi Redmine, you can make it a top-level project by picking the blank entry
    • The "identifier" on the project is used for several things:
      • the username for the repository account will be p-project_identifier
      • the directory names for the repository directories will be
        /cvs/projects/project_identifier-repo_identifier
      • This means you must keep it under 30 characters so the username will be valid, and generally if you choose a really long one it makes your repository paths annoyingly long.
  • Hitting save
Once you have a project created,
  • pick it from the projects page, and
  • click on the "Settings" tab, then
  • click on the "Repositories" sub-tab
  • click on "New repository"
  • Choose a repository type next to "SCM" (CVS, Git, Subversion)
  • For the first repository:
    • check the "Main Repository" checkbox
    • leave Identifier blank -- otherwise it will be appended to the project name to make the directory name of the repository
  • Or for later repositories:
    • do not check "Main Repository"
    • fill in an identifier to refer to this repository within your project -- this will be appended to the project name to make the repository directory name, so keep it short.
  • Fill in the input box(es) depending on repository type:
    • put "create_me" (without quotes, with an underscore) in the "Path to repository" input box for Git
    • put "file:///create_me" in the "URL" box for Subversion (without quotes, with an underscore)
    • put "create_me" in the module box and "file:///create_me" in the CVSROOT box (without quotes, with an underscore) for CVS
  • pick "UTF-8" in the Commit messages encoding (or some other encoding if approprate).
  • hit Create.

Soon thereafter a cron job will wake up (promptly at :00, :15, :30, or :45 after the hour)
and make your repository along with a local project account, etc. When that happens
the location of the repository will be updated, usually to /cvs/projects/your-project-name.
So wait for the 15 minute boundary, and go back to your Settings tab, and pick the
Repository sub-tab, and you should see the repository path has been updated.

Oh, and don't forget to add yourself (and other interested parties) as members
of the project in the Settings/Members tab. This also will take effect at :00, :15, :30 or :45
after the hour.

Read/Write access to the repositories

There are two cases here: you have an existing directory of source code you want to add,
or you're starting from an empty directory.

Existing repositories

Then to push existing code into the repository:
  • Git: from a local repository (if you don't have one, git init in a directory with sources, and git add the sources and do a git commit) , pushing all branches do:
    git push --all --force  ssh://p-project-name@cdcvs.fnal.gov/cvs/projects/project-name
    
  • Git: from a local repository, pushing only the master branch:
    >git push ssh://p-project-name@cdcvs.fnal.gov/cvs/projects/project-name master
    
  • Subversion: build a top level hierarchy, and import your source under "trunk":
    cd directory
    svn mkdir -m "setup" svn+ssh://p-project@cdcvs.fnal.gov/cvs/projects/project/tags
    svn mkdir -m "setup" svn+ssh://p-project@cdcvs.fnal.gov/cvs/projects/project/branches
    svn import -m "initial import"  svn+ssh://p-project@cdcvs.fnal.gov/cvs/projects/project/trunk
    
  • CVS: with directory of files do
    cd directory 
    cvs -d :ext:p-project-name@cdcvs.fnal.gov/cvs projects/project-name import modulename tag1 tag2
    

    Where "project-name" above is replaced by your project's internal name you set when you created it.
    Note the account name part is "p-" in front of your project name.

Empty directory

If you want to start from an empty repository:
  • Git:
    git clone   ssh://p-project-name@cdcvs.fnal.gov/cvs/projects/project-name
  • Subversion:
    svn checkout svn+ssh://p-project-name@cdcvs.fnal.gov/cvs/projects/project-name/trunk
  • CVS: with directory of files do
    mkdir empty; cd empty ; cvs -d :ext:p-project-name@cdcvs.fnal.gov/cvs/projects/project-name import project-name tag1 tag2
    cd ..
    cvs -d :ext:p-project-name@cdcvs.fnal.gov/cvs/projects/project-name checkout project-name
    

    Where "project-name" above is replaced by your project's internal name you set when you created it.
    Note the account name part is "p-" in front of your project name.

For example, if your projects's
short name is global-domination, your commands would be:

  • Git: git clone ssh://p-global-domination@cdcvs.fnal.gov/cvs/projects/global-dominaton
  • Subversion: svn checkout svn+ssh://p-global-domination@cdcvs.fnal.gov/cvs/projects/global-domination/trunk
  • CVS: cvs -d :ext:p-global-domination@cdcvs.fnal.gov/cvs/projects/global-domination checkout global-domination

Then you can use ssh to access your repository, and if you add members to the projectin the Settings/Members tab, they will be added to the .k5login for the
account. This also will take effect at :00, :15, :30 or :45 after the hour.

Public access to repositories

If your project is "public" in redmine, it should also be available (readonly) as
  • http://cdcvs.fnal.gov/projects/project-name for Git or
  • http://cdcvs.fnal.gov/subversion/project-name for Subversion or
  • :pserver:anonymous@cdcvs.fnal.gov:/cvs/projects/project-name for CVS (by request)