Mirror OW2 Gitorious repositories to Github.com organization
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install ow2mirror-gem
For now, this module clones public source repositories and push to authenticated repositories. It has been initially developed to clone repositories from a gitorious instance running on OW2.org and push these repositories to Github.
As a limitation, user have to configure its system and git credentials according to the target system (github in the example).
Ow2mirror comes with a binary used to create required resources and update repositories.
- 'ow2mirror install' : Creates all the required resources in the local folder
- 'ow2mirror create' : Creates a new mirror (clone the source). This will ask you to give sources and destination informations
- 'ow2mirror mirror' : Launches a mirror task which will get changes (fetch) from sources and put them (push) to destinations
Create a workspace
Workspaces aggregates several mirrors which are potentially coming from different sources. The workspace stores project information, reports, logs, ... You can create as many reports as needed acording to your usage. For example, the mirror command will got through all the projects, so creating multiple workspaces can be useful...
Command : 'ow2mirror new'
Create a new mirror
Command : 'ow2mirror create'
This will get the projects and repositories from the source instance ask several questions:
- is the project name from the source instance
- a list of available repositories from the selected project
- is the target repository prefix name i.e. to differentiate the repositories in the organisation we need to prefix them. Short names are better as prefix...
The create task will create a folder in the mirror folder and will clone all the required stuff. Add git remote and push things. It also creates a JSON report file in this folder to keep traces: .json
The create operation does the following git operations:
- Clone the source repository: 'git clone --bare --mirror REPO.git'
- Add the destination repository as remote 'git remote add github firstname.lastname@example.org:USER/REPO.git'
Update a mirror
Command : 'ow2mirror mirror'
Will retrieve all the projects from the current runtime and call all the required git operation to pull from sources and push to destination. It internally does the following git operations:
- Fetch from source repository : git fetch --quiet origin
- Push to destination repository : git push --quiet github
The mirror engine stores git data and additional configuration files into folders. In order to run several mirrors on the same host, the structure is organized as:
- mirror.conf _ project A _ project.json _ repos.json _ repository 1 _ repository 2 _ project B _ project.json _ repos.json _ repository 1 _ repository 2 _ repository 3
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request