Coder Social home page Coder Social logo

chef-ruby_backend's Introduction

Ruby backend server chef cookbook

Requirements

Cookbooks

The following cookbooks are direct dependencies:

  • apt
  • user
  • openssh
  • ruby_build
  • chef-rbenv

Platforms

The following platforms are supported and tested under test kitchen:

  • Ubuntu 14.04

Other Debian family distributions are assumed to work.

Attributes

  • node['ruby_backend']['environment'] - Used for setting the environment in the shell, ssh, database.yml, and thin.yml. Defaults to production
  • node['ruby_backend']['ruby_version'] - Sets the ruby version to be installed to the deploy user. Default value is "2.2.2"
  • node['ruby_backend']['envinronment_variables'] - Hash of environment variables to be set on the deploy user. Default values are { 'RAILS_ENV' => node['ruby_backend']['environment'], 'RACK_ENV' => node['ruby_backend']['environment'] }
  • node['ruby_backend']['deploy_ssh_keys'] - A String or an Array of ssh keys to be placed on the deploy user's ~/.ssh/authorized_keys. Defaults to nil
  • node['ruby_backend']['application_name'] - The name of the application that will be deployed to the server. This attribute is used for creating the deploy directory /var/www/node['ruby_backend']['application_name']. This also happens to be Capistrano 3's default deploy folder convention.

Required Attributes

  • node['ruby_backend']['deploy_user'] - The name of the deploy user that will be created on the server.

Database Configuration Attributes

  • node['ruby_backend']['db_settings'] - If this attribute is present, the cookbook also creates a database.yml file. Accepts a hash of connection settings. Posgresql database is supported by default. If you need to use MySQL, you need to install the necessary libraries on the server manually.
{ adapter: 'postgresql'
  username: 'test_user'
  password: 'password'
  database: 'test_database'
  host: 'host' }

Thin Configuration attributes

  • node['ruby_backend']['configure_thin'] - Tell the recipe to create a thin configuration file for you. Defaults to false

Recipes

This cookbook installs the necessary packages for a Ruby (or Rails) server. Ruby is installed via rbenv.

It also integrates nicely with Capistrano's default configuration. This enables you to deploy right away to servers provisioned by this cookbook. Just make sure to include the capistrano integration for rbenv and you are good to go.

default

Installs the necessary packages for a Ruby or Rails deployment. Rbenv is installed on a deploy user and environment variables are also set. When ssh keys are provided they are also added to the deploy user's ~/.ssh/authorized_keys

It is assumed that the postgresql and rails would be used so the package libpq-dev is also installed. Since the recipe is targeted for rails deployments, the package nodejs is also installed.

This recipe also permits user environments in the sshd_config file and sets the ssh environment variables in ~/.ssh/environment.

License & Authors

  • Author:: Lester Celestial
Copyright 2015, Lester Celestial

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

chef-ruby_backend's People

Contributors

santopuppy avatar

Watchers

 avatar

Forkers

international

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.