• This repository has been archived on 14/May/2021
  • Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created over 12 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Development repository for Opscode Cookbook application_ruby

Application_Ruby Cookbook

Build Status Gem Version Cookbook Version Coverage Gemnasium License

A Chef cookbook to deploy Ruby applications.

Quick Start

To deploy a Rails application from git:

application '/srv/myapp' do
  git 'https://github.com/example/myapp.git'
  bundle_install do
    deployment true
    without %w{development test}
  end
  rails do
    database 'sqlite3:///db.sqlite3'
    secret_token 'd78fe08df56c9'
    migrate true
  end
  unicorn do
    port 8000
  end
end

Requirements

Chef 12.1 or newer is required.

Resources

application_bundle_install

The application_bundle_install resource installs gems using Bundler for a deployment.

application '/srv/myapp' do
  bundle_install do
    deployment true
    without %w{development test}
  end
end

All actions and properties are the same as the bundle_install resource.

application_puma

The application_puma resource creates a service for puma.

application '/srv/myapp' do
  puma do
    port 8000
  end
end

Actions

  • :enable – Create, enable and start the service. (default)
  • :disable – Stop, disable, and destroy the service.
  • :start – Start the service.
  • :stop – Stop the service.
  • :restart – Stop and then start the service.
  • :reload – Send the configured reload signal to the service.

Properties

  • path – Base path for the application. (name attribute)
  • port – Port to listen on. (default: 80)
  • service_name – Name of the service to create. (default: auto-detect)
  • user – User to run the service as. (default: application owner)

application_rackup

The application_rackup resource creates a service for rackup.

application '/srv/myapp' do
  rackup do
    port 8000
  end
end

Actions

  • :enable – Create, enable and start the service. (default)
  • :disable – Stop, disable, and destroy the service.
  • :start – Start the service.
  • :stop – Stop the service.
  • :restart – Stop and then start the service.
  • :reload – Send the configured reload signal to the service.

Properties

  • path – Base path for the application. (name attribute)
  • port – Port to listen on. (default: 80)
  • service_name – Name of the service to create. (default: auto-detect)

user – User to run the service as. (default: application owner)

application_rails

The application_rails resource

application '/srv/myapp' do
  rails do
    database 'sqlite3:///db.sqlite3'
    secret_token 'd78fe08df56c9'
    migrate true
  end
end

Actions

  • :deploy – Create config files and run required deployments steps. (default)

Properties

  • path – Base path for the application. (name attribute)
  • app_module – Top-level application module. Only needed for the :initializer style of secret token configuration. (default: auto-detect)
  • database – Database settings for Rails. See the database section below for more information. (option collector)
  • migrate – Run database migrations. (default: false)
  • precompile_assets – Run rake assets:precompile. *(default: auto-detect)()
  • rails_env – Rails environment name. (default: node.chef_environment)
  • secret_token – Secret token for Rails session verification et al.
  • secrets_mode – Secrets configuration mode. Set to :yaml to generate a Rails 4.2 secrets.yml. Set to :initializer to update config/initializers/secret_token.rb. (default: auto-detect)

NOTE: At this time secrets_mode :initializer is not implemented.

Database Parameters

The database parameters can be set in three ways: URL, hash, and block.

If you have a single URL for the parameters, you can pass it directly to database:

rails do
  database 'mysql2://myuser@dbhost/myapp'
end

Passing a single URL will also set the $DATABASE_URL environment variable automatically for compatibility with Heroku-based applications.

As with other option collector resources, you can pass individual settings as either a hash or block:

rails do
  database do
    adapter 'mysql2'
    username 'myuser'
    host 'dbhost'
    database 'myapp'
  end
end

rails do
  database({
    adapter: 'mysql2',
    username: 'myuser',
    host: 'dbhost',
    database: 'myapp',
  })
end

application_ruby

The application_ruby resource installs a Ruby runtime for the deployment.

application '/srv/myapp' do
  ruby '2.2'
end

All actions and properties are the same as the ruby_runtime resource.

application_ruby_gem

The application_ruby_gem resource installs Ruby gems for the deployment.

application '/srv/myapp' do
  ruby_gem 'rake'
end

All actions and properties are the same as the ruby_gem resource.

application_ruby_execute

The application_ruby_execute resource runs Ruby commands for the deployment.

application '/srv/myapp' do
  ruby_execute 'rake'
end

All actions and properties are the same as the ruby_execute resource, except that the cwd, environment, group, and user properties default to the application-level data if not specified.

application_thin

The application_thin resource creates a service for thin.

application '/srv/myapp' do
  thin do
    port 8000
  end
end

Actions

  • :enable – Create, enable and start the service. (default)
  • :disable – Stop, disable, and destroy the service.
  • :start – Start the service.
  • :stop – Stop the service.
  • :restart – Stop and then start the service.
  • :reload – Send the configured reload signal to the service.

Properties

  • path – Base path for the application. (name attribute)
  • config_path – Path to a Thin configuration file.
  • port – Port to listen on. (default: 80)
  • service_name – Name of the service to create. (default: auto-detect)
  • user – User to run the service as. (default: application owner)

application_unicorn

The application_unicorn resource creates a service for unicorn.

application '/srv/myapp' do
  unicorn do
    port 8000
  end
end

Actions

  • :enable – Create, enable and start the service. (default)
  • :disable – Stop, disable, and destroy the service.
  • :start – Start the service.
  • :stop – Stop the service.
  • :restart – Stop and then start the service.
  • :reload – Send the configured reload signal to the service.

Properties

  • path – Base path for the application. (name attribute)
  • port – Port to listen on. (default: 80)
  • service_name – Name of the service to create. (default: auto-detect)
  • user – User to run the service as. (default: application owner)

Sponsors

Development sponsored by Chef Software, Symonds & Son, and Orion.

The Poise test server infrastructure is sponsored by Rackspace.

License

Copyright 2015-2017, Noah Kantrowitz

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.

More Repositories

1

python

THIS COOKBOOK IS DEPRECATED – Chef cookbook to install Python and related tools
Python
571
star
2

application

A Chef cookbook to deploy applications.
Ruby
144
star
3

poise-python

A Chef cookbook to provide a unified interface for installing Python, managing Python packages, and creating virtualenvs.
Ruby
124
star
4

citadel

Chef cookbook to help store secrets in S3 in a secure fashion
Ruby
119
star
5

poise

A set of libraries for writing reusable Chef cookbooks
Ruby
106
star
6

application_python

A Chef cookbook to deploy Python applications.
Ruby
73
star
7

supervisor

Development repository for Opscode Cookbook supervisor
Ruby
64
star
8

poise-service

A Chef cookbook to provide a unified interface for services.
Ruby
43
star
9

halite

Write as a gem, release as a cookbook.
Ruby
42
star
10

application_nginx

Development repository for Opscode Cookbook application_nginx
Ruby
34
star
11

poise-ruby

A Chef cookbook to provide a unified interface for installing Ruby and running things with it.
Ruby
27
star
12

poise-derived

A Chef cookbook for defining lazily evaluated node attributes.
Ruby
22
star
13

application_php

Development repository for Opscode Cookbook application_php
Ruby
21
star
14

application_java

Development repository for Opscode Cookbook application_java
Ruby
21
star
15

yolover-example

YoloVer example repository
Ruby
14
star
16

poise-hoist

A cookbook to help automate "attribute hoisting" when using Chef with Policyfiles.
Ruby
13
star
17

berkshelf-api

A Chef cookbook to install a Berkshelf API server
Ruby
13
star
18

application_git

A Chef cookbook to handle deploying code from git when using the application cookbook.
Ruby
11
star
19

poise-profiler

A Chef cookbook to display profiling information at the end of the run.
Ruby
11
star
20

poise-archive

A Chef cookbook to unpack file archives like TAR and ZIP files.
Ruby
10
star
21

poise-monit

A Chef cookbook to manage Monit.
Ruby
9
star
22

mercurial

Development repository for Opscode Cookbook mercurial
Ruby
9
star
23

jenkins

Ruby
8
star
24

application_javascript

A Chef cookbook to deploy server-side JavaScript applications using Node.js or io.js.
Ruby
7
star
25

poise-javascript

A Chef cookbook to provide a unified interface for installing server-side JavaScript runtimes like Node.js and io.js.
Ruby
7
star
26

poise-file

A Chef cookbook for advanced file management.
Ruby
6
star
27

poise-ruby-build

A ruby-build provider for the poise-ruby cookbook.
Ruby
5
star
28

poise-boiler

Poise-boiler is a set of helpers to reduce boilerplate in Poise/Halite style gems.
Ruby
5
star
29

poise-appenv

Helpers for application-specific envronment settings in Chef
Ruby
4
star
30

yolover

Using Policyfiles: YoloVer as a Workflow
HTML
4
star
31

rubocop-chef

Ruby
4
star
32

ci

A cookbook to configure a Jenkins CI environment
Ruby
3
star
33

poise-proxy

Generic HTTP proxy resource
Ruby
3
star
34

poise-dsl

A Chef cookbook for declaring DSL helper methods.
Ruby
2
star
35

poise-dash-prototype

CoffeeScript
2
star
36

application_examples

Examples for using the Application cookbooks.
Ruby
2
star
37

poise-supervisor

A Chef cookbook to manage Supervisor.
Ruby
2
star
38

poise-languages

Shared support code for Poise's language cookbooks.
Ruby
2
star
39

poise-service-runit

Ruby
2
star
40

poise-monit-compat

A deprecated Chef cookbook to manage Monit.
Ruby
1
star
41

test_django

An example Django application for testing cookbooks.
Python
1
star
42

poise-service-monit

Ruby
1
star
43

cookiecutter-cookbook

Cookiecutter template for a Poise-enabled Chef cookbook
Ruby
1
star
44

poise.io

Poise website and documentation.
Ruby
1
star
45

kitchen-zone

Ruby
1
star