2017 © Pedro Pelรกez
 

project codeigniter-deployer

A Deployment Tool for CodeIgniter 3.0

image

stef686/codeigniter-deployer

A Deployment Tool for CodeIgniter 3.0

  • Thursday, April 12, 2018
  • by stef686
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CodeIgniter Deployer

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

This is a fork of Kenjis original package, updated for Deployer 6.1.0, (*2)

A Deployment Tool for CodeIgniter 3.1.*, (*3)

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

This is based on Deployer 6.1.0, (*5)

Folder Structure

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

Requirements

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

Installation

Install this project with Composer:, (*6)

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

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

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

Configuration

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

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., (*9)

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., (*10)

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., (*11)

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

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

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

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

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

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

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., (*16)

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

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., (*18)

set('writable_use_sudo', false);

How to Deploy

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

The Versions

12/04 2018

dev-master

9999999-dev

A Deployment Tool for CodeIgniter 3.0

  Sources   Download

MIT

The Requires

 

codeigniter deployment deploy