Connecting Eclipse Che to VSTS
Eclipse Che is an exciting new Integrated Development Environment (IDE) based on the popular Eclipse IDE. Eclipse, which has been around for more than a decade, has most widely been used for development of Java-based applications. The Eclipse IDE is a full-featured development application which is installed and configured on a developers workstation.
Eclipse Che, which was released in early 2016, builds on the success of the Eclipse IDE, wrapping the entire development experience into a Browser-Based Application. The Eclipse Che IDE is hosted within a Docker Container alongside a host OS. This containerization of the development IDE, in effect, makes Eclipse Che a dedicated development workstation.
By using Eclipse Che, a developer no longer needs to configure their local machine to begin working on a project, rather they simply need to point their web browser to a specific address to begin working.
Eclipse Che supports ASP.NET Core natively, opening the door for developers who work in a Microsoft shop to start experimenting with Che on their own. If you are using VSTS as your source code repository, you can quickly connect to your existing repositories using Eclipse Che, provided you are using the Git SCM provider in VSTS.
To connect Eclipse Che to VSTS, we will be using SSH authentication. Eclipse Che does support OAuth authentication, which will be covered in a future article. This article will walk through the configuration of SSH authentication in VSTS.
Connecting Eclipse Che to VSTS
Within Eclipse Che, a developer works in a Workspace.
A Workspace can contain one or more Projects.
The Add Project dialog shows us that we can add a project from multiple sources, including Git or GitHub. Though it appears that you can add a new git-based project from this screen, this functionality does not seem to be working as expected right now.
To add a new git-based project, you will need to launch the Workspace. You can launch a Workspace by either; clicking the Workspace name under Recent Workspaces, clicking the Workspace in the Workspace’s list, or by clicking the Play button under the Actions section.
Once the Workspace is running, you will be presented with the Eclipse Che IDE.
SSH authentication between Che and VSTS
In VSTS, choose the Project you want to work on and click the Code tab. Once on the code tab, click the Clone link to the right to open the Clone Repo panel.
On the Clone Repo panel, Switch to the SSH tab and copy the GIT URL. You will need this address in Che when you generate your new SSH keys.
Next, click the Manage SSH Keys link. This will present you with the SSH Public Keys management screen. We are going to come back to this screen in a few moments after we create our SSH Keys in Che.
Back in Che, click on Profile -> Preferences, to bring up the Preferences Screen.
Under the SSH section, click the VCS item to manage your SSH keys for your VCS\SCM provider.
Click the Generate Key button.
Enter the hostname portion of the repository URL copied earlier and press OK.
Next, click the View button next to the hostname of your SCM provider.
Copy the Public Key presented in the dialog after clicking the View button.
Back in VSTS, on the Manage SSH Keys screen, click the Add button and complete the fields on the following screen pasting the public key copied from Che in the previous step.
Once you click Save, you should be able to go back into Che and Import the project from Git in VSTS.
Importing a Project from VSTS
Back in Eclipse Che, click the Import Project link from either location.
On the resulting Import Project dialog, simply paste the SSH URL you copied from VSTS earlier. Once complete, simply click Import.
If your setup is incorrect, you may receive the following error message.
If your setup is correct, you should see screens similar to the following;
If you close the Workspace and return the Workspaces Admin screen, you will now find your Project is included in the Workspace.
From here, you can reopen an existing project and get right back to work.
While I am still learning more about Eclipse Che, what I have experienced thus far has me very excited about this platform. I had been looking for an IDE which I could use to work on projects from my Chromebook and was very disappointed in the options available. During the course of my research, I had stumbled onto CodeEnvy, which led me to Eclipse Che.
If you haven’t already experimented with Eclipse Che, I hope this article introduces you to this exciting new tool and helps you get up and running that much faster.