deployment - Capistrano deploy from local machine -


im trying create new user deploy application local machine external server.

i've got working using root understand it's not secure use root, therefore want create user called 'deployer'. i've added user external server , copied local is_rsa.pub key /.ssh/authorized_keys on server, when run cap development deploy keep getting following error:

failed: "sh -c 'if [ -d /var/www/vhosts/xyz.co.uk/shared/cached-copy ]; cd   /var/www/vhosts/xyz.co.uk/shared/cached-copy && git fetch -q origin && git fetch -- tags -q origin && git reset -q --hard 2b738f4ca8008dcf9e84c4be5d63d906a7bfd760 && git clean  -q -d -x -f; else git clone -q git@github.com:xyz/xyz.co.uk.git  /var/www/vhosts/xyz.co.uk/shared/cached-copy && cd /var/www/vhosts/xyz.co.uk/shared/cached- copy && git checkout -q -b deploy 2b738f4ca8008dcf9e84c4be5d63d906a7bfd760; fi'" on  x.xx.xx.xxx 

if run ssh -t git@github.com on external server says:

hi username! you've authenticated, github not provide shell access. 

this username not deployer though, assume username of github account.

any ideas need do? need create deployer user on local machine too?

here deploy.rb file:

set :stage_dir, 'app/config/deploy' # needed symfony2 set :stages, %w(production staging development) require 'capistrano/ext/multistage'  set :application,           "xyz.co.uk" set :user,                  "deployer"  # server's user deploys  set :normalize_asset_timestamps, false  set :repository,            "git@github.xyz/xyz.co.uk.git" set :scm,                   :git set :keep_releases,         3 after "deploy:update",      "deploy:cleanup" set :use_sudo,              false set :web_path,              "web" set :shared_files,          ["app/config/parameters.yml"] set :shared_children,       [app_path + "/logs", web_path + "/uploads"] set :use_composer,          true set :update_vendors,        true set :dump_assetic_assets,   true set :deploy_via,            :remote_cache  #logger.level = logger::max_level  after "deploy:update_code"   capifony_pretty_print "--> ensuring cache directory permissions"   run "setfacl -r -m u:www-data:rwx -m u:`whoami`:rwx #{latest_release}/#{cache_path}"   run "setfacl -dr -m u:www-data:rwx -m u:`whoami`:rwx #{latest_release}/#{cache_path}"   capifony_puts_ok end 

deveopment.rb file:

server 'x.xx.xx.xxx', :app, :web, :db, :primary => true ssh_options[:port] = 1234 ssh_options[:forward_agent] = true default_run_options[:pty] = true set :deploy_to, "/var/www/vhosts/xyz.co.uk" set :symfony_env_prod, "dev" set :branch, "develop"  # need clear *_dev controllers set :clear_controllers,     false 

thanks

you want have target machine use local ssh credentials authenticate github. putting following 2 entries deploy.rb

ssh_options[:forward_agent] = true default_run_options[:pty] = true 

or, way go github repo , add public ssh key of target server deploy key

https://github.com/your_github/your_repo/settings/keys 

this gives target server checkout access specified repository without having use personal ssh key.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -