2017 © Pedro Peláez
 

symfony-bundle updater-bundle

Symfony2 Bundle that allows updating the git repository, through services hooks (POST data)

image

edwines/updater-bundle

Symfony2 Bundle that allows updating the git repository, through services hooks (POST data)

  • Thursday, September 12, 2013
  • by edwines
  • Repository
  • 1 Watchers
  • 3 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Updater Bundle

Total Downloads Latest Stable Version Latest Unstable Version, (*1)

This bundle allow updating the repository in production; using git service hooks provided by some git hosting system (like GitHub). Currently these providers are supported:, (*2)

  • GitHub
  • Bitbucket

But you can build your custom provider., (*3)

Requirements

The production server needs to have git installed and configured to connect with the provider. Also the repository of the Symfony project need to has write permissions to the web user (usually named www-data)., (*4)

Installation

Step 1: Download EdwinesUpdaterBundle

Add the following dependency in your composer.json, (*5)

{
    "require": {
        "edwines/updater-bundle": "1.0.*",
    }
}

Now tell composer to download the bundle by running the command:, (*6)

$ php composer.phar update edwines/updater-bundle

Step 2: Enable de bundle

Enable the bundle in the kernel:, (*7)

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Edwines\UpdaterBundle\EdwinesUpdaterBundle(),
    );
}

Step 3: Configure the bundle

By default you don't need to set the configuration. But if you want to change the default values, just follow the next instructions:, (*8)

The bundle set the directory of the repository to %kernel.root_dir%/../ to edit it just set the repo_path:, (*9)

# app/config/config.yml

edwines_updater:
    repo_path: /project/repository/path/

By default the provider is GitHub, if you want to use Bitbucket:, (*10)

# app/config/config.yml

edwines_updater:
    provider: Edwines\UpdaterBundle\Provider\Bitbucket

Step 4: Add routes

If you want to have all the routes (the route for update the system, and another one to see the git status), (*11)

# app/config/routing.yml

ed_updater:
    resource: "@EdwinesUpdaterBundle/Resources/config/routing/updater.yml"
    prefix:   /my-updater-prefix

Or if only want the route to update the project:, (*12)

# app/config/routing.yml

ed_updater:
    resource: "@EdwinesUpdaterBundle/Resources/config/routing/hook.yml"
    prefix:   /my-hook-prefix

Step 5: Add POST service to your provider

Now, you need to add a new service hook in your provider (see the [GitHub help][1]). Your hook url will be http://my-domain.com/my-updater-prefix/hook/ or if you configure to only use the hook url: http://my-domain.com/my-hook-prefix/, (*13)

How it works

When the bundle receives the payload of the provider, it compare if the modified branch is the same of the current project.. then automatically run the command git pull origin {current_branch}, and finally erase the cache., (*14)

You can see the git status of your project and the last commits in the url http://my-domain.com/my-updater-prefix/, (*15)

The Versions

12/09 2013

dev-master

9999999-dev http://github.com/edwines

Symfony2 Bundle that allows updating the git repository, through services hooks (POST data)

  Sources   Download

MIT

The Requires

 

by Edwin Ibarra

git update symfony2 bundle

25/07 2013

v1.0.0

1.0.0.0 http://github.com/edwines

Symfony2 Bundle that allows updating the git repository, through services hooks (POST data)

  Sources   Download

MIT

The Requires

 

by Edwin Ibarra

git update symfony2 bundle