Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Capistrano deployment with TYPO3 CMS
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/capistrano/typo3
spec
test
.coveralls.yml
.gitignore
.ruby-version
.simplecov
.travis.yml
Gemfile
Guardfile
LICENSE.txt
README.md
Rakefile
capistrano-typo3-cms.gemspec

README.md

capistrano-typo3-cms

This is an extension for the deployment tool Capistrano. This extension facilitates the deploy of TYPO3 CMS projects. This tool ist only testet on Unix based systems. A German introduction can be reached here.

It includeds follows additional packages:

  1. capistrano
  2. capistrano-ext
  3. railsless-deploy

Thank you!


Build Status Gem Version Dependency Status Code Climate Coverage Status Inline docs

Codeship Status for programmerqeu/capistrano-typo3-cms

Installation

Install it yourself wit rubygems package manager:

gem install capistrano-typo3-cms

Need help to install ruby? Or easer and better with RVM

Usage

Configuration

Capify your project

$ cd /path/to/your/project
$ capify ./

Edit your ./Capfile in your project root to include capistrano-typo3-cms

load 'deploy' if respond_to?(:namespace)
require 'capistrano'
require 'capistrano-typo3-cms'
load 'config/deploy' # remove this line to skip loading any of the default 

Edit your ./config/deploy.rb in enable multistage support:

set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
set :application,       "your-prject-name"
set :user,              "www-data"
set :group,             "www-data"

Enviroments

  • Development: Your local maschine. In best case with a simular operation system to staging and production. On this maschine you run you unit tests. Do you have one? ;o)
  • Staging: System to run unit and integration test on system. This is a system that is almost equal to the production system in configuration, data and installed software. Also this instance of your TYPO3 CMS can be a place to present your customer new features befor you deploy it on production.
  • Production: Some guys call it also live system. Maybe it's also a life system, if your life depends on everything here works well. It's the last step in our basic deployment process. The place where the client can sea your website. Mybe you can run additional Capistrano task after deploy such a minimize and optimize CSS, Images and Javascript to improve the performance.

It's possible to extend this process with addition steps but theese are the default settings that come with this extension.

set :env_development,   "development"
set :env_staging,       "staging"
set :env_production,    "production"

You will need this, to targeting your deployments.

deploy strategy

set :deploy_via,            :rsync_with_remote_cache
set :scm, :git
set :copy_exclude,          ".DS_Store", ".git/*", ".git", ".gitignore", ".gitmodules"]

ssh & shell settings

set :use_sudo,              false
set :ssh_options,           { :keys => %w(~/.ssh/id_dsa ~/.ssh/id_rsa) }
set :ssh_options,           { :forward_agent => true }
set :ssh_local,             'ssh'
default_run_options[:shell]     = '/bin/bash'
set :php_cli,               "php"

rsync (rsync_with_remote_cache)

set :local_cache,           "cache/rsync"
set :rsync_options,         "-avz --delete --chmod=u=rwx,g=rx,o=r --exclude=*.svn* "
set :copy_exclude,          ["REVERSION", ".svn", ".svn/*", ".git/*", ".git", ".gitignore", ".gitmodules"]
set :rsync_local,           "rsync"

repository

set :repository,            "git@bitbucket.org:vergissberlin/#{application}.git"
set :git_enable_submodules,     1
set :branch,                            "#{rails_env}"
set :branch,                "master"

remote

set :keep_releases,         10
set(:deploy_to)             { "/var/www/#{application}/#{rails_env}/deploy" }
set :deploy_via,            :remote_cache
set :rails_env,             "production"

Add your enviroments settings file at ./config/deploy/staging.rb (for example)

server 'staging.server.eu', :app, :web, :primary => true
set :rails_env, 'staging'

In case of using multistage create config files for every enviroment (deploy/staging.rb):

Deploy

cap <enviroment> deploy:setup
cap <enviroment> deploy

Project roadmap

Version 0.0.1

  • Documentation "Deploying with Capistrano and TYPO3 CMS
  • Resolving dependencies for PHP projects

Version 1.0.0

Additional TYPO3:CMS tasks

typo3:cms:setup
typo3:cms:cc
typo3:cms:check
typo3:cms:data:push
typo3:cms:data:pull
typo3:cms:data:backup

Version 2.0.0

Including new package "capistrano-mysql" to manage database data.

mysql:push
mysql:pull
mysql:backup
mysql:sync <source_env> <target_env>
mysql:migrate

Version 3.0.0

Scaffolding

CLI command support to create a new TYPO3 CMS project from the scratch.

$ typo3 init ./
Add progress bar to follow tasks:
  • typo3:cms
    • :backup
    • :sync
  • mysql
    • :backup
    • :pull
    • :push

Dear PHP Developers

I did not want that this tool may grow to a meta package, so I have refrained from creating unnecessary dependencies. But I want to recommend you some very useful extensions of Capistrano.

Useful Capistrano Extensions

Here is a list of ''Capistrano extension'' you should install:

  1. Capistrano Confirm

Installation and activation

sudo gem install capistrano-confirm

After installation, you can add the script to your Capfile:

require 'capistrano-confirm'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Install locally

$ cd /path/to/capistrano-typo3-cms/
$ rake build
$ sudo gem install --local pkg/capistrano-typo3-cms-1.0.0.gem

Thanks to

  1. A special thanks to Jamis Buck and Lee Hambley, the developers of Capistrano.
  2. Thank you to developers of capistrano-ext and railess-deploy.
  3. Further thanks JetBrains for a free license for RubyMine.

Sponsored by RubyMine from JetBrains

Something went wrong with that request. Please try again.