rauwekost/release-bundle

Symfony2 gitflow release automation and deployment bundle

Installs: 471

Dependents: 0

Watchers: 1

Open Issues: 2

Language: PHP

1.5.8 2014-07-15 12:19 UTC

README

Symfony gitflow automation and deployment bundle

This bundle allows simple automation for release-ing / hotfix-ing using git flow and simple deployment from configuration.

Installation

Add to composer.json:

"rauwekost/release-bundle": "dev-master"

Update kernel:

public function registerBundles()
{
    $bundles = array(
        // ...,
        new Rauwekost\ReleaseBundle\RauwekostReleaseBundle(),
    );

    // ...
}

Good to go!

Required files

The bundle expects certain files to exist.
in your application root dir:
version.yml
app/confing/deploy.yml
app/config/release.yml

There are dist files in repository as example, copy them to the correct location.

version.yml
This file gets increments automaticly from the command.

{ prefix: v, major: '0', minor: '1', bugfix: '0' }

app/config/release.yml
Define your develop and prod branch names (same as git flow)

branches:  
    development: 'develop'  
    production: 'master'  

app/config/deploy.yml
Default configuration is required the overrides are up to you, add as many as you like.

# Default is required
default:
    application_name: "Your application name"
    release_before: true #run the release command before the deployment
    local:
        temp_dir: "/tmp"
        parameters_file: "app/config/parameters.yml"
    svn:
        repository: "git@github.com:..."
        branch: "master"
    remote:
        host: "servername"
        key: ~
        temp_dir: "/tmp"
        dest_dir: "/remote_application_dir"

# Overides
dev:
    release_before: false

test:
    release_before: true

prod:
    release_before: true

Usage

The bundle will add 2 commands to app/console:

  • application:release [--hotfix]
  • application:deploy [--hotfix] env

application:release

This command wil create a new release based on the version.yml and asks you to type a new (higher) version number. Then it wil do all the neccesarry tasks to finish that release. --hotfix can be added so that a new hotfix is created and finished instead of a normal release.

application:deploy

This command packs the given git repository in a tarball and copies it to the remote host and unpacks in the correct destination folder. The configuration option: release_before allows you to force release before deployment. You can add multiple environments and override every variable in the configuration

example usage:

app/console application:deploy prod
app/console application:deploy dev
app/console application:release
app/console application:release --hotfix
app/console application:deploy --hotfix prod