You can easily host your own git of otrunk-examples with any new files or changes to existing files on github. When you do this not only is it a public git clone but all the content is web accessible which means you can use it as sources for new activities, reports, or report templates in a DIY instance.
In addition if you make changes which should be integrated back into otrunk-examples proper having working examples in a public git clone makes this operation very easy.
The current version of these instructions assume you have a Mac OS X system and you are using Github. With a few changes in the details all of this can also be done on Windows and Linux and also using other public git hosting sites (examples: repo.or.cz and Gitorious).
- Keeping a git fork in sync with the forked repo
- A guide to using git with Eclipse
The instructions below assume you are using the C version of git from the command line. JGit is a BSD-licensed version of git written in Java that comes with EGit, an EPL-licensed Eclipse plugin. I think the EGit Eclipse plugin is probably far enough along to accomplish the same tasks.
- The jgit/egit Eclipse plugin is now quite functional. The update site is: http://www.jgit.org/update-site/
- Install git using macports: https://confluence.concord.org/display/CCTR/Installing+git+with+macports
- Get a copy of gitx (macos app for visualizing a local git repository: http://gitx.frim.nl/
- Register for an free account on github, login, and follow the Setting Up instructions here:
Specifically make sure you upload a copy of the public version of your ssh key.
I'll assume your github username in the instructions below is newgithubuser.
- Browse to the public otrunk-examples clone and click "fork" http://github.com/stepheneb/otrunk-examples/tree/master
- In a shell on your local computer clone your fork of otrunk-examples and cd into the directory:
You now have a clone of your fork of otrunk-examples in the local directory otrunk-eamples/.git. In addition the clone command checked out a copy of the master branch in this repository in your github fork to the local dir otrunk-examples/. If you list the dir ls otrunk-examples you will see all the files and directories in otrunk-examples.
In addition you have created one remote reference in your local git repository for otrunk-examples named origin.
- Add a second remote reference to the CC official public git clone of otrunk-examples and fetch a copy into your git repository.
This will allow you to also keep track of changes made at CC.
Using git fetch just copies the data into your local repository, otrunk-examples/.git, but does not check out a branch into your working directory otrunk-examples/.
The git fetch did create an additional remote reference. Listing remotes will show you the protocols and paths for each remote repository and the names you can use to refer to them:
The origin repository is your fork and because you can write to it you use an ssh form of connection email@example.com. The cc-otrunk-examples repository uses an anonymous protocol which means you can only read from git://github.com/stepheneb/otrunk-examples.git.
- Create a local branch named ccmaster and checkout the master branch from your local copy of the CC otrunk-examples repository into it:
- Switch back to your "master" branch and merge into your master branch any new changes from ccmaster:
- Make some new files in your master branch by copying existing files already in otrunk-examples:
To make this work for this example change hanging-with-friends-2-mw-jruby.otml so it references the new script file hanging-with-friends2-logging-mw.rb.
- Commit these files to your master branch in your local git repository:
- Push your local master branch to the master branch in your public github repository:
- Create a new External OTrunk Activity in a DIY instance and set the External otml url to:
Note: If you had created a second branch on github named "experimental" and pushed additional changes to hanging-with-friends-2-mw-jruby.otml there you can access the raw form of that document using this url:
The general form for getting http access to a raw presentation of the resources in a repository branch hosted at github:
The development DIY at http://rails.dev.concord.org/diy is a good place to conduct experiments. Register at the DIY and send an email to the otrunk-dev list requesting a developer role. Take a look at this activity in the dev DIY: Hanging with Friends (mw-jruby) (from github clone) for an example. In this case it is running from the CC public git clone of otrunk-examples so it operates just like the original otml activity would but it demonstrates the form of the url to access the raw otml resources in the master branch and running the activity confirms that it all still works.