Coder Social home page Coder Social logo

bedrock-capistrano's Introduction

bedrock-capistrano

These are the Capistrano configs for deploying Bedrock projects.

Capistrano is a remote server automation and deployment tool. It will let you deploy or rollback your application in one command:

Screencast (:moneybag:): Deploying WordPress with Capistrano

Status: This project is stable, feature complete, and production ready. This means that we won't be adding new features. Only fixing existing bugs and ensuring that base functionality works.

Requirements

  • Ruby >= 1.9

Required Gems:

  • capistrano (> 3.1.0)
  • capistrano-composer

These can be installed manually with gem install <gem name> but it's highly suggested you use Bundler to manage them. Bundler is basically the Ruby equivalent to PHP's Composer. Just as Composer manages your PHP packages/dependencies, Bundler manages your Ruby gems/dependencies. Bundler itself is a Gem and can be installed via gem install bundler (sudo may be required).

The Gemfile in the root of this repo specifies the required Gems (just like composer.json). Once you have Bundler installed, run bundle install to install the Gems in the Gemfile. When using Bundler, you'll need to prefix the cap command with bundle exec as seen below (this ensures you're not using system Gems which can cause conflicts).

See http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/ for the best way to set up SSH key authentication to your servers for password-less (and secure) deploys.

Installation/configuration

  1. Copy the following files into the root of your Bedrock project:
  • Capfile
  • Gemfile
  • Gemfile.lock
  1. Copy the following files/folders into your config directory:
  • config/deploy/*
  • config/deploy.rb
  1. Edit your config/deploy/ stage/environment configs to set the roles/servers and connection options.
  2. Before your first deploy, run bundle exec cap <stage> deploy:check to create the necessary folders/symlinks.
  3. Add your .env file to shared/ in your deploy_to path on the remote server for all the stages you use (ex: /srv/www/example.com/shared/.env)
  4. Run the normal deploy command: bundle exec cap <stage> deploy
  5. Enjoy one-command deploys!

Usage

  • Deploy: cap production deploy
  • Rollback: cap production deploy:rollback

Composer support is built-in so when you run a deploy, composer install is automatically run. Capistrano has a great deploy flow that you can hook into and extend it.

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Support

Use the Roots Discourse forum to ask questions and get support.

bedrock-capistrano's People

Contributors

austinpray avatar jwhayman avatar swalkinshaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bedrock-capistrano's Issues

Configuration steps problem

First of all, sorry for my english.

As describe in this issue -> #2

I had the same problem because the readme said to before run the bundle exec cap deploy:check and after add the .env on the server.

Making the opposite (so creating the .env file before and then execute the bundle exec cap deploy:check ) the things go Okay.

Maybe it's better to change the readme file?

Anyway, after that, executing the last command ( bundle exec cap deploy)

i got this error:
fatal: destination path '/var/www/vhosts/fondazionemorgani.boom.ink/repo' already exists and is not an empty directory.

( obvsiouly, the directory is empty when I start the process, the only thing that it has is the shared/.env file, and the releases directory (and it is empty) )

Googling online, i tried to delete the repo folder after this and re-run bundle exec cap deploy but then the message is:
failed to create symbolic link '#{deploy_path}/releases/20160106135547/.env': File exists

Again, obviously, the .env file isn't in my repo.

From now on, I can't continue because i really doesn't know what to do.

I really can't figure out what I'm forgetting... 5 months ago I already installed the capistrano bedrock deploy and everything went ok...

Can you guys help me?

deployment needs scm git plugin

I always need to add these lines to get cap deploy to work:

require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

502 Errors when opcache enabled?

Love what you guys are doing. Quick question regarding an issue we're getting... apologies if this is the wrong repo to post the issue.

Whenever we do a deploy, we noticed we'll started getting some 502 errors when attempting to save settings within WP or visiting certain pages on the frontend. It also seems that our caching plugin (w3totalcache) stops working (the cache directory is in the old release folder). It seems that opcache doesn't like when we've symlinked to the new release folder. Have you experienced this? Is there a better workaround than simply disabling opcache? Is it expected to restart nginx upon deploy, or something else I'm missing?

Thanks for any help you can lend!

/usr/bin/env: No such file or directory

I am getting deploy errors..

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 87.***.1**.2**: mkdir exit status: 127
mkdir stdout: Nothing written
mkdir stderr: -: /usr/bin/env: No such file or directory

I have no idea why it uses /usr/bin/env. On My server it is/bin/env ....
No idea how to change it :(

.env does not exist on the remote

Hello,

I might be still confused about the configuration, but when I execute
bundle exec cap <stage> deploy:check, I get the following error

ERRORlinked file /srv/www/cpkg/shared/.env does not exist on (my_remote_host)

Then the 5th point of your installation instruction says:

Add your .env file to shared/ in your deploy_to path on the remote server for all the stages you use (ex: /srv/www/example.com/shared/.env)

Does that mean that I first have to manually copy .env to a remote server where I want to deploy to?

I will be grateful for a word of explanation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.