capistrano3

How to set a default shell or sudo to a user in capistrano 3

天涯浪子 提交于 2019-12-11 19:23:38
问题 I'm currently in the process of moving from Capistrano 2.x to 3.x for a rails application and running into the following issue. The general setup on the server contains a deploy user that should be the one responsible for deploying, however when a user goes to deploy, they connect to the server with their own user name. In Capistrano 2.x, I was able to accomplish this using the default_shell option. set :default_shell, "sudo -u deploy /bin/sh" This does not work in Capistrano 3.x. Is there

Capistrano doesn't set RAILS_ENV for bundler

隐身守侯 提交于 2019-12-11 11:08:02
问题 In my Gemfile I specify what branch to use on a git repository based on RAILS_ENV. However when Capistrano deploys, it runs the bundle install command - and since it's run through a shell, the proper environment (staging) isn't set. It defaults to development and gives me an error stating that there's a mismatch between Gemfile.lock and what is installed. You are trying to install in deployment mode after changing your Gemfile. Run bundle install elsewhere and add the updated Gemfile.lock to

Capistrano 3 deploy failed messages - exit status 1 (failed)

穿精又带淫゛_ 提交于 2019-12-11 10:22:17
问题 When I deploy my Symfony2 app using Capistrano with symfony gem I get various errors such as Running /usr/bin/env [ -L /var/www/releases/20151014090151/app/config/parameters.yml ] as ubuntu@ec2-00-000-000-000.eu-west-1.compute.amazonaws.com Command: [ -L /var/www/releases/20151014090151/app/config/parameters.yml ] Finished in 0.038 seconds with exit status 1 (failed) and I get the same for -f /var/www/releases/20151014120425/app/config/parameters.yml -L /var/www/releases/20151014090151/web/

How to store secret variables in capistrano

一笑奈何 提交于 2019-12-11 07:28:14
问题 I am writing a Rails app with automated deployment using Capistrano. In the deploy.rb script I have: set :deploy_to, '/my/deploy/path/' And in production.rb I have: server 'example.com', user: 'secret_user_name', roles: %w{web app db} Currently the app is private. But assume I wanted an open source app like this. Then I wouldn't want secret_user_name and /my/deploy/path to be stored in the repo. In the Rails project if I encountered an issue like this I would store the secret values in

Capistrano can not create symlinks: file exist

两盒软妹~` 提交于 2019-12-11 02:41:47
问题 I have Rails 4 app with Capistrano 3. # deploy.rb set :application, '<DELETED>' set :user, '<DELETED>' set :repo_url, '<DELETED>' set :branch, 'master' ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } set :deploy_to, "/home/#{fetch :user}/apps/#{fetch :application}" set :scm, :git set :format, :pretty set :log_level, :debug set :pty, true set :linked_files, %w{config/application.yml} set :linked_dirs, %w{bin log tmp vendor/bundle public/system public/deploy} # set :default_env, {

Capistrano deploy configuration

♀尐吖头ヾ 提交于 2019-12-11 02:17:02
问题 Help please to configure capistrano for deployment. I have ssh: user: User host: 8.8.8.8:6554 pass: 123 Then i have bitbucket repository git@bitbucket.org:somerepo/code.git user: Repouser@gmail.com pass: repopass I am just need to deploy code from default branch to User@8.8.8.8:8888:/public_html/test/ . On local machine i have ssh key, that allows me to connect without password. But capistrano didn't connect. There is my config: lock '3.3.5' set :application, 'App' set :scm, :git set :repo

In capistrano 3, is it possible to bundle & asset precompile locally and copy the results to application server?

喜夏-厌秋 提交于 2019-12-10 23:47:04
问题 At present, I have it setup so that capistrano git pulls the latest code on production servers, bundle installs and asset precompiles it individually on each web server. The problem that I am running into is that occationally it will take a long time and take up a lot of resources that impacts the performance on the production servers. I am looking for guidelines on how best to do this. If anyone has experience with this and can share their opinions, I would really appreciate it. I am looking

Unable to start my Unicorn on Port 80 on Capistrano 3

若如初见. 提交于 2019-12-10 21:49:56
问题 I get the following error while trying to run "cap production unicorn:start" DEBUG [29ec5890] Command: cd /home/ec2-user/apps/current && ( RAILS_ENV=production BUNDLE_GEMFILE=/home/ec2-user/apps/current/Gemfile ~/.rvm/bin/rvm default do bundle exec unicorn -c /home/ec2-user/apps/current/config/unicorn/production.rb -E deployment -D ) DEBUG [29ec5890] RVM is not a function, selecting rubies with 'rvm use ...' will not work. DEBUG [29ec5890] DEBUG [29ec5890] You need to change your terminal

Can capistrano v3 specify HOSTS in command line like v2 does?

天涯浪子 提交于 2019-12-10 19:09:51
问题 In Capistrano v2, I can run deploy on the server specified in the command-line. cap staging HOSTS="host1,host2" deploy How can I do the same thing in the Capistrano v3? example scenario I have to scale my app, but I don't want to deploy all of my app servers. So I just want to run deploy on the new one. 回答1: Not sure if you found this or not but the documentation says you can just list it in the command line like this: cap --hosts=server1,server2 production deploy See documentation here: Host

capistrano - git ls-remote -h doesn't have the git url

吃可爱长大的小学妹 提交于 2019-12-10 10:48:50
问题 I'm new to using Capistrano. I set it up correctly, but when I run cap staging deploy I get this - DEBUG [b678d5eb] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/myproj/git-ssh.sh /usr/bin/env git ls-remote -h ) DEBUG [b678d5eb] usage: git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>] <repository> <refs>... DEBUG [b678d5eb] Finished in 0.325 seconds with exit status 129 (failed). I think the git clone url should follow after the -h, but I'm not sure. I'm using Capistrano 3.2