capistrano

Git Workflow With Capistrano

江枫思渺然 提交于 2019-12-20 14:41:11
问题 I'm trying to get my head around a good git workflow using capistrano. I've found a few good articles, but I'm either not grasping completely what they're suggesting (likely) or they're somewhat lacking. Here's kind of what I had in mind so far, but I get caught up when to merge back into the master branch (i.e. before moving to stage? after?) and trying to hook it into capistrano for deployments: Make sure you’re up to date with all the changes made on the remote master branch by other

Non-privileged, non-root, user to start or restart webserver server such as nginx without root or sudo

早过忘川 提交于 2019-12-20 14:06:33
问题 I'm using capistrano to deploy a rails web app. I want to give the deploy user on the webserver as few privileges as I can. I was able to do everything I need to do as a non-privileged user except restart the webserver. I'm doing this on an ubuntu server, but this problem is not specific to my use case (rails, capistrano, deployment), and I've seen a lot of approaches to this problem that seem to involve poor security practices. Wondering whether others can vet my solution and advise whether

Unicorn unable to write pid file

左心房为你撑大大i 提交于 2019-12-20 10:11:50
问题 I am using deploying a Ruby on Rails app to a Linode VPS using Capistrano. I am using Unicorn as the application server and Nginx as the proxy. My problem is that I am not able to start Unicorn because of an apparent permissions issue, but I'm having a hard time tracking it down. Unicorn is started using this Capistrano task: task :start, :roles => :app, :except => { :no_release => true } do run <<-CMD cd #{current_path} && #{unicorn_bin} -c #{unicorn_config} -E #{rails_env} -D CMD end I get

Problems deploying code with Capistrano since upgrading to macOS 10.12 (Sierra), “Permission denied (publickey).”

天大地大妈咪最大 提交于 2019-12-20 09:18:19
问题 So I just upgraded my Mac mini (Late 2012) to macOS 10.12 (Sierra) and everything seems fine, but I’m running into one odd problem deploying code with Capistrano. I get the following error: Permission denied (publickey). Never had this problem before in Mac OS X 10.11 (El Capitan) or any version prior to it. Why is this suddenly happening now? Full output of the failed Capistrano deployment below: jakes_mac:SomeCode jake$ cap staging deploy INFO [hkdgad21] Running /usr/bin/env mkdir -p /tmp

Passing parameters to Capistrano

↘锁芯ラ 提交于 2019-12-20 08:57:06
问题 I'm looking into the possibility of using Capistrano as a generic deploy solution. By "generic", I mean not-rails. I'm not happy with the quality of the documentation I'm finding, though, granted, I'm not looking at the ones that presume you are deploying rails. So I'll just try to hack up something based on a few examples, but there are a couple of problems I'm facing right from the start. My problem is that cap deploy doesn't have enough information to do anything. Importantly, it is

Restart nginx without sudo?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 08:39:21
问题 So I want to be able to cap:deploy without having to type any passwords. I have setup all private keys so I can get to the remote servers fine, and am now using svn over ssh, so no passwords there. I have one last problem, I need to be able to restart nginx. Right now I have sudo /etc/init.d/nginx reload. That is a problem b/c it uses the capistrano password, the one I just removed b/c I am using keys. Any ideas on how to restart nginx w\out a password? 回答1: I just spent a good hour looking

How to find the Vagrant IP?

自闭症网瘾萝莉.ら 提交于 2019-12-20 08:26:28
问题 I have been developing an automated deployment using Capistrano and using Vagrant as my test virtual server. The thing is, I need the IP of Vagrant to " ssh into it". I tried ifconfig and got the IP but it looks like it is not the exact vagrant IP. Can anybody help me to get the Vagrant IP? 回答1: run: vagrant ssh-config > .ssh.config and then in config/deploy.rb role :web, "default" role :app, "default" set :use_sudo, true set :user, 'root' set :run_method, :sudo # Must be set for the password

How to fix “cannot lock ref” error while deploying on server using capistrano?

房东的猫 提交于 2019-12-20 07:27:42
问题 I was trying to deploy a hotfix to my staging server (DigitalOcean) but got a "cannot lock ref" error. I stumbled on this error before. I had a branch 'hotfix' and then I created 'hotfix/some-hotfix' branch and when I tried to push it to origin I got the error. I fixed it by deleting branch 'hotfix' in my repository (BitBucket). But now I am getting it while deploying on staging server. Stack trace: SSHKit::Command::Failed: git exit status: 1 git stdout: Fetching origin error: cannot lock ref

cap deploy + rbenv: bundle: command not found

╄→尐↘猪︶ㄣ 提交于 2019-12-20 04:57:06
问题 I am following https://gorails.com/deploy/ubuntu/16.04 I am running : "bundle exec cap production deploy" and getting the following error: ✔ 10 deploy@107.170.84.18 0.289s 00:21 bundler:install 01 $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --q… 01 rbenv: bundle: command not found 01 01 The `bundle' command exists in these Ruby versions: 01 2.4.0 01 (Backtrace restricted to imported tasks) cap aborted!

Environment variables on production

痴心易碎 提交于 2019-12-19 09:00:27
问题 I’m currently deploying my Rails application on Amazon and I’m facing a problem with environment variables. I'm using the dotenv gem on development and testing and it works just fine while trying to access my environment variables, but in production it does not seem to work. I read that the dotenv gem isn't meant to work on production. I have to set almost 20 different environment variables including API keys, etc., I'm deploying with rubber/capistrano. How can I get this working in a clean