GitBucket is a clone you could say of GitHub. However while it looks similar to GitHub it's certainly quite far from being what GitHub is. Sure it allows you to:

  • Public / Private Git repository (http access only)
  • Repository viewer (some advanced features such as online file editing are not implemented)
  • Repository search (Code and Issues)
  • Wiki
  • Issues
  • Fork / Pull request
  • Mail notification
  • Activity timeline
  • User management (for Administrators)
  • Group (like Organization in Github)
  • LDAP integration
  • Gravatar support

but there's a lot missing, most notably the ability to use the Git/SSH protocol. However, with all the features included above I decided to give it a shot.

The first thing to note is this is not written in one of my preferred languages such as PHP, Ruby (on Rails) or even on node.js. It's done in Scala, which means that Java will be involved. I absolutely despise Java. Regardless I still went forth.

For my install I decided to deploy it to Heroku which meant I didn't have to install Tomcat or Glassfish, etc...

I have a CentOS 6.x Linux server which I used. First you'll need to install Java, pretty simple. You'll also need the development tools as well.

This will install Java and any necessary dependencies. One that's finish you'll want to get the GitBucket code. By default GitBucket doesn't come with the necessary configurations for working on Heroku, but someone has kindly updated the latest GitBucket branch with the necessary code and files.

~/gitbucket $ git clone -b heroku-1.9 https://github.com/xuwei-k/gitbucket.git

This tells git to snag the heroku-1.9 branch. From there you'll want to change the name of the branch to 'master'.

~/gitbucket $ git branch -m master

Now, you'll want to run the sbt tool, thankfully this is included in this fork of the GitBucket code. It essentially allows you to compile the code locally on your system. You'll want to run the commands when prompted, clean, compile, and stage.

Once this is completed you can push it out to Heroku. First create the application:

Next push your code to Heroku.

It'll spew forth a lot of text, hopefully you should see something similar to:

Once that's done just visit your Heroku instance, in our case it would be http://sheltered-shelf-3564.herokuapp.com. Hopefully this helps some people trying to install GitBucket and deploy it to Heroku.

GitBucket certainly looks like it could have a lot of potential, probably even more if it wasn't developed in Scala/Java. I did come across one issue so far, I installed GitBucket one night and was too tired to write this up until the morning, when I returned to login to my GitBucket installation it had removed the user account I had created the night before. When I re-logged in with the default root user, it was as if the install had completely reset. The creation timestamp for the root user was today (just now). I will have to submit an issue to takezoe/gitbucket. Other then that, I haven't come across any other issues and I think I'll continue to follow this project.

Update: I guess I was still pretty tired when I wrote this article but the issue with my GitBucket instance "resetting" on Heroku was because they don't have a persistent disk system. Anytime the instance falls asleep or goes idle the disk state resets essentially. One should be using something like Amazon S3 for disk storage or another similar service. I should have known that as well...

Resources