Boss – Git Deployment Tool

I have used this deployment script for all my own projects in last couple of years. Deployment means, doing same things again and again. Using jenkis or Hudson could not be good idea sometimes if you working on small multiple projects. They are huge applications. You should write your own deployment scripts to trigger tests, update database schema, set up permissions and manage deployment process. I just wrote an installation interface and removed project specific scripts inside of it. Now it is released

Parameters / Features

  • Show help: boss help
  • Trigger test script: boss test <local | stage | live> <project>
  • Start deployment : boss deploy <local | stage | live> <project> <version>
  • Rollback latest deployment: boss rollback <local | stage | live> <project>
  • Add, list or remove a project: boss project <add | list> | <remove> <project>

Version and development

Dependencies
: Git installed *nix system like Mac OS X, Linux or BSD
Latest Version
: 1.0.2

Download

Github
: Boss on Github
Download as package
: Download current version
All versions
: Check current or old versions

Before Installation

Actually installation is easy but firstly ensure that you already done the following steps before installation. I suppose you have;

  • A git installed *nix machine like Mac OS X
  • Git server, may you would prefer use github or another free service
  • You have already able to pull and push to the repository
  • A stage server. If you dont have different server you can create another directory on your live server that you can define a subdomain like stage.example.com. I have used /var/www/stage/irfandurmus directory for stage and /var/www/live/irfandurmus directory for live.
  • Ensure that you’ve blocked http requests which coming to the system file like .gitignore .htaccess, .git/ .boss/
  • All of your repositories should be clean.
  • You should already added .boss/* line to your .gitignore files and it should be exists all of the repos.
  • You should have ssh root key login to your stage and live server if you’re using such as /var/www directory.
  • I suppose you have a bash script in your project directory that it triggers all of your tests. That you will give the script path to boss while installing.
  • Installation directory is ~/.boss.
  • You can edit the config file after installation. The config files storing under ~/.boss/etc/ directory.
  • System log files and uploaded files via web interface should be seperate from git repository or added to .gitignore. In other case deployment will fail because your repository wont be clear.

Installation

After ensure the above list just type the following commands.

$ git clone git@github.com:irfan/boss.git boss
$ cd boss
$ sh install.sh

After finish installation you can remove the source directory.

How to Use

boss help

Shows help.

$ boss help

boss project

Add, remove or list projects.
Adding a project

$ boss project add

List all projects

$ boss project list

Remove a project

$ boss project remove myproject

boss test

Trigger test script. Server should be local, stage or live.

$ boss test stage myblog

boss deploy

Deploy a new version to given server. Server should be local, stage or live and tag should be a git tag.

$ boss deploy live myblog 3.2.1

boss rollback

Take back the latest deployment. For example, your version 3.2.1 that you deployed 3.2.2 but you see some issues on new version. boss rollback will load 3.2.1 version from main git repository.

$ boss rollback stage myblog

Screenshots

Change Logs

1.0.2

  • Bugfix for repositories which using packed-refs

1.0.1

  • Documentation update in Readme.me file.

1.0.0

  • Project released with some features.

To do

  • Cache module: User should able to invalidate distinguished cache servers like apc, memcache.
  • Boss should be running server-client mode that it able to deploy multiple live or stage server.
  • After deployment checkout the master branch and merge the version to master.