-
Notifications
You must be signed in to change notification settings - Fork 2
Managing Workflow With Ungit
This tutorial is provided for use of Ungit in the hopstack app repos. Ungit works great with our local sandbox and Codio. Node.js is provided by Codio, so we don't need root access to our Codio Boxes to install and run Ungit in the cloud environment.
$ npm install -g ungit
After that, it works out of the box. Open up the terminal from the Tools->Terminal menu then run it with
$ ungit
Ungit will provide the full URL we have to visit, to access to the Ungit GUI but we should make a couple of tweaks to get it running in Codio most awesomely. By default, it will have this format...
http://medina-didine.codio.io:8448/#/repository?path=/home/codio/workspace
where medina-didine needs to be replaced with the correct Codio Box name, which can be found in the Project->Box Info menu.
To start the Ungit UI easily, we can add it to our .codio file. To allow Ungit to run inside a Codio tab, we will need to access it over https. To do this, we need to use a port between 9500 and 10000 as described here.
The easiest way to do this is to use the following command when you start ungit:
$ ungit --port=9501
Now we just need to open up the .codio file by selecting the Configure option in the Preview menu.
Now add the following line to the Preview section:
"Visit Ungit": "https://{{domain}}:9501/#/repository?path=/home/codio/workspace"
You will now find 'Visit Ungit' available in the Preview menu.
If we want to have Ungit start automatically when our Box starts, then add the command $ ungit --port=9501 to the startup.sh file in the root of our project. More on startup.sh here.
We create an .ungitrc file in our home folder:
cd ~
touch .ungitrc
nano .ungitrc
then, past the following lines to avoid unnecessary logging:
{
"bugtracking": false,
"logRESTRequests": false
}
We can also provide the port number in this file rather than on the command line as suggested above. The JSON entry it "port": 8080.
We can find the full details of available parameters in the Ungit source code.
Ungit provides simple authentication if we would like to limit the access to the GUI. Add the following parameters to our .ungitrc file to add authentication:
{
"authentication": true,
"users": {
"username": "password"
}
}
Replace username and password with your credentials.
Now our .ungitrc file should look something like this...
{
"bugtracking": false,
"logRESTRequests": false,
"authentication": true,
"users": {
"username1": "password1",
"username2": "password2",
"username3": "password3"
}
}
We have to restart Ungit to apply these parameters (close the Terminal, and launch Ungit again).


