Last active
November 13, 2015 06:46
-
-
Save webdevilopers/89d882334db5cfc19674 to your computer and use it in GitHub Desktop.
Switching PHP Deployment from Capifony and Capistrano v2 to MagePHP Magallanes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logger.level = Logger::MAX_LEVEL | |
set :stages, %w(production staging) | |
set :default_stage, "staging" | |
set :stage_dir, "app/config" | |
require 'capistrano/ext/multistage' | |
set :application, "Example App" | |
set :scm, :git | |
set :repository, "http://username:password@git.example.com/example.git" | |
set :use_composer, true | |
set :update_vendors, true | |
set :composer_options, "--verbose --prefer-dist" | |
set :user, "examplessh" | |
set :use_sudo, false | |
set :writable_dirs, ["app/cache", "app/logs"] | |
set :webserver_user, "www-data" | |
set :permission_method, :acl | |
set :use_set_permissions, true | |
set :shared_files, ["app/config/parameters.yml", "web/.htaccess"] | |
set :shared_children, [app_path + "/logs", "vendor"] | |
set :model_manager, "doctrine" | |
set :keep_releases, 4 | |
task :upload_htaccess do | |
origin_file = "web/.htaccess" | |
destination_file = latest_release + "/web/.htaccess" # Notice the latest_release | |
try_sudo "mkdir -p #{File.dirname(destination_file)}" | |
top.upload(origin_file, destination_file) | |
end | |
after "deploy", "upload_htaccess" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# global settings | |
name: Example App | |
email: dev@example.com | |
notifications: true | |
logging: true | |
maxlogs: 30 | |
ssh_needs_tty: false | |
symfony_version: 2 | |
symfony_app_path: php app/console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server 'staging.example.com', :app, :web, :primary => true | |
set :deploy_to, "/var/www/example" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#staging | |
deployment: | |
user: examplessh | |
from: ./ | |
to: /var/www/example | |
excludes: | |
- app/cache/* | |
- app/config/parameters.yml | |
- web/bundles/* | |
- web/uploads | |
releases: | |
enabled: true | |
max: 5 | |
symlink: current | |
directory: releases | |
hosts: | |
- staging.example.com | |
tasks: | |
pre-deploy: | |
on-deploy: | |
- symfony2/cache-warmup: {env: prod} | |
post-release: | |
post-deploy: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parameters discussion on Twitter:
https://twitter.com/webdevilopers/status/664830152342401024 @katalisha @eps90