Rockstor development workflow using Eclipse and Egit.

At Rockstor, we use Fork and Pull collaborative development model of GitHub for smooth and efficient coordination between developers. For more information on how this model works, see Using Pull Requests.

As a contributing developer, you have plenty of choice with respect to text editors and IDEs. In our community, developers use Emacs, Vim and Eclipse. In this post, we will show you how to setup Rockstor development workflow using Eclipse and Egit.

Install Eclipse:

We assume that you are familiar with Eclipse a little. Read the newcomers’ FAQ if you need a refresher. Eclipse installation is super easy no matter which OS you are running. In this post, Ubuntu is our OS. Install Eclipse by running the following command in your terminal.

sudo apt-get install eclipse

Install EGit:

We use a Eclipse plug-in called EGit which nicely integrates git operations with Eclipse. This post describes the configuration and workflow in the context of Rockstor development. For a more comprehensive tutorial, read Lars Vogel’s post here

The plug-in can be installed from the Eclipse installation manager by clicking on Install new Software menu under Help. Use the following URL for install: http://download.eclipse.org/egit/updates as shown below.

EgitSoftwareInstall

Configure Git:

Navigate to configuration from Window -> Preferences -> Team -> Git -> configuration and add your name and email

image2

Clone rockstor-core repository:

The main repository for Rockstor is called rockstor-core. No matter which repository, you’ll need to fork the repo on GitHub before proceeding further. Once your personal fork is ready, go to the project import window by navigating File → Import → Git → Project from Git. Eclipse allows you to clone a Git repository and import it into your workspace using this import wizard.

importProject

Select URI and press Next button.

importProjectsFromGit

In the next screen, you need to provide your fork’s clone url from GitHub and select the master branch. Optionally, you can also select more branches as shown below.

image4

In the next screen, specify where the project should be copied to and select master for the initial branch and click Finish.

localDest

Your repository will be cloned and after completion of cloning, EGit opens an additional import dialog which allows you to select a wizard for importing projects, select ‘Import as general project’ and Working directory listen and click Finish.

importP

Adding rockstor-core remote:

After the last step, you’ll see the new rockstor-core project in Eclipse. This project already has one remote called origin, which refers to your fork on GitHub. You’ll be pulling and pushing to this remote. But you also need to add another remote called rockstor-core to pull upstream changes. To do this, right click on the project and navigate to Team–> show in repositories view as shown below.

showRepo

Expand the rockstor-core and right click on the Remotes –> select create remote. Enter rockstor-core for the remote’s name and check the radio button Configure fetch and click OK.

image8

A pop-up box appears where you need to configure fetch for the new remote that’s just added. Click Save.

image9

For the URI, use git@github.com.rockstor/rockstor-core.git and click Finish Button as shown below.

imagelast

That’s it! You are ready to carry on your development activities using Eclipse and Egit. If you haven’t already, read the contribution guidelines on rockstor.com website. The development and contribution process is clearly explained there.

 

Read More