2017 © Pedro Pelรกez
 

project codeigniter-deployer

A Deployment Tool for CodeIgniter 3.0

image

kenjis/codeigniter-deployer

A Deployment Tool for CodeIgniter 3.0

  • Monday, July 13, 2015
  • by kenjis
  • Repository
  • 8 Watchers
  • 41 Stars
  • 5,286 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 13 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

CodeIgniter Deployer

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

A Deployment Tool for CodeIgniter 3.0., (*2)

You can deploy CodeIgniter with one command., (*3)

This is based on Deployer 3.0., (*4)

Folder Structure

codeigniter/
โ””โ”€โ”€ deploy/
     โ”œโ”€โ”€ deploy.php ... config file for Deployer
     โ”œโ”€โ”€ deploy.sh  ... script to deploy
     โ””โ”€โ”€ logs/

Requirements

  • PHP 5.4.0 or later
  • Composer
  • Git
  • SSH
  • Shell

Installation

Install this project with Composer:, (*5)

$ cd /path/to/codeigniter/
$ composer require kenjis/codeigniter-deployer:1.0.x@dev --dev

Install deploy folder to your CodeIgniter application folder:, (*6)

$ php vendor/kenjis/codeigniter-deployer/install.php
  • Above command always overwrites exisiting files.
  • You must run it at CodeIgniter project root folder.

Configuration

Configure deploy/deployer.php., (*7)

Servers

// Your production server
server('prod', 'your.server.example.com', 22)
    ->user('username')
    ->forwardAgent()
    ->stage('production')
    ->env('branch', 'master')
    ->env('deploy_path', '/var/www/your-codeigniter-app');

See https://github.com/deployphp/docs/blob/master/servers.md for details., (*8)

Repository

// Your Git repository
set('repository', 'git@github.com:org/your-codeigniter-app.git');

You need git command on your servers, and make sure you can git clone on the servers., (*9)

Reference

  • https://github.com/deployphp/docs

Configure Your Servers

Apache

See the sample below. In this case, /var/www/your-codeigniter-app is a base folder., (*10)

your-codeigniter-app/
โ”œโ”€โ”€ current -> /var/www/your-codeigniter-app/releases/20150529181638
โ””โ”€โ”€ releases/
ย ย ย ย  โ”œโ”€โ”€ 20150529180505/
ย ย ย ย  โ”œโ”€โ”€ 20150529181203/
ย ย ย ย  โ””โ”€โ”€ 20150529181638/

Each deployment is installed in releases/YYYYMMDDHHMMSS folder., (*11)

The current release is your-codeigniter-app/current folder, and it is a symbolic link to releases/20150529181638 folder., (*12)

So if you use codeigniter-composer-installer's folder structure, your Apache configuratoin is like this:, (*13)

DocumentRoot /var/www/your-codeigniter-app/current/public

If you use CodeIgniter as the default folder structure, your Apache configuratoin is like this:, (*14)

DocumentRoot /var/www/your-codeigniter-app/current

sudo

Deployer will try to get write permission with the sudo command, so this command has to be running without prompt password and without tty., (*15)

Here is an example of configuration:, (*16)

Defaults:username !requiretty

username   ALL=(ALL) NOPASSWD: /usr/bin/setfacl

If you don't need sudo for your deployment, you can set in deploy/deployer.php., (*17)

set('writable_use_sudo', false);

How to Deploy

$ cd /path/to/codeigniter/
$ cd deploy/
$ sh deploy.sh

The Versions

13/07 2015

dev-master

9999999-dev

A Deployment Tool for CodeIgniter 3.0

  Sources   Download

MIT

The Requires

 

codeigniter deployment deploy