Storing and Deploying Apps via Gitblit

Gitblit is one of the most popular tools for managing, viewing and serving your repositories within Git - a widely spread VCS (version control system) for software elaboration. Mainly, Gitblit is designed for small workgroups, which work with centralized repositories, and supports the variety of remarkable features, such as access control, repository’s content displayment via web, multiple repositories management, ability to be integrated with other Git-management solutions etc.

So, let’s find out how to host Gitblit at Jelastic Cloud and, subsequently, simplify your apps management with its help. You can automatically get a preconfigured ready-to-work Gitblit instance up and running within minutes using our one-click installation widget:

Just click Get it hosted now and type your email address in order to launch Gitblit and get the ability to proceed directly to the repository creation guide section, skipping the steps of manual installation.

The full list of applications, available for one-click installation, can be found at our Marketplace page or within the corresponding section at the dashboard.

Or, if your prefer to take the complete control over the process, you can deploy it manually by following the step-by-step instruction below.

Create an Environment

1. Log in to the Jelastic dashboard with your credentials and click the New Environment button to open the Environment Wizard frame.

2. Choose the Java language tab and select Tomcat 7 as an application server.

Set the rest of configurations according to your requirements, name your environment (e.g. gitblit) and click Create to initiate the process.

After a while, the designated environment will appear at the dashboard.

Deploy Gitblit

1. Now, navigate to the Gitblit official website and download its latest release in a view of a wrapped .war archive (the appropriate link is circled on the image below).

2. Go back to the Jelastic dashboard and use the Deployment Manager to upload the archive you’ve just downloaded - i.e. choose the Local file tab, click Browse and select the Gitblit .war file within your local machine.

Click on the Upload button to proceed.

3. After the package appears at manager, deploy it to your environment using the corresponding Deploy to option.

Within the opened frame, you may specify the desired custom context within the input field or just leave it blank to deploy your application to the default ROOT context.

4. Once the process is completed, you can click the Open in browser button to ensure the application is actually working fine.

Create a Gitblit Repository

1. To start working with Gitblit, you need to login within its main page with the default admin/admin credentials

Tip: We recommend to change the password to your custom one as soon as possible for the security ensurance

2. Once inside, switch to the repositories tab at the top pane. Here, you will see the list of your repos (if there are any) and will have the ability to manage them.

Let’s create a new repository by clicking the same-named button to the right.

3. Set the name for your new repo (for example, GitBlitRepo) are adjust all the rest configurations according to your preferences (or just leave the default values).

Click create at the bottom of a page when ready.

3. The specified empty repository will be shown in a moment.

4. Now you should push (add) your project to this repo. The simple steps below will help you with this:
  • first, initialize your local repository (i.e. create a folder to store your projects’ files locally):
    git init
  • define the files your project should consists of (just as an example, we’ll add the README file to it)
    git add
  • save these changes at the local repo with a commit message (e.g. mark it as a first commit)
    git commit -m "first commit"
  • specify the previously created GitBlit repository as a remote one for your local Git repo
    git remote add {name} {repo_url}
    • {name} - appellation for your remote repository
    • {repo_url} - link to your GItblit repository, which can be found within the drop-down list on the top of the page from the previous step. The appropriate http:// link can be copied with the button to the right, as it is shown below:

  • finally, push your local project to the Gitblit repository:
    git push -u {name} {branch}
    • {name} - name of the remote Gitblit repository your project should be copied to (state it the same as above)
    • {branch} - projects’ branch, that should be updated with this new data

After this is done, refresh the Gitblit page to view your repository with a full data on it (here, you can also switch to the commits section to see the information on the latter changes applied, such as author, time and date of a commit, list of changed files, etc).

Deploy Project via Gitblit

Now, let’s discover how to deploy your project from a Gitblit repository into the Jelastic Cloud.

1. At first, create a separate environment for your application hosting. Let’s consider a case with a Java project, where, in addition to the application server node, you’ll need to use a build tool (i.e. Maven).

Note that the extra Maven node is required for Java projects only, while for the rest of engines build is performed automatically, while adding a project to application server.
Refer to the appropriate document below in case you need details on how to accomplish this:

2. Click the Add project button next to the Maven node after your environment is successfully created.

3. In the appeared Add project frame, choose the Git tab and fill in the required fields:
  • enter the Name of project (for Maven only)
  • specify URL and Branch of the the repository you’ve previously created
  • in the Use authentication block, fill in the following fields:
    • Login used to enter your repo
    • Password for the above specified login
  • choose your Environment Name from the drop-down menu
  • type the Context you would like to deploy your project to

Confirm the project addition with the Add button.

4. Next, click the Build and deploy option next to the just added project.

5. Once your application is deployed, you can open it (by pressing the Open in browser button for the environment) and ensure everything works fine.

Tip: Subsequently, all the newly performed at the remote repository changes can be easily applied to your hosted app with just a single click - simply select the same Build and deploy button (or Update from GIT in case of working with another engine) next to your project and wait for the redeployment to be completed.

That’s it! Now, your own Gitblit repository and project within it are both hosted hand by hand at Jelastic Cloud. Enjoy!