Recipes to install Sharetribe Marketplace.
- apt
- build-essential
- database
- mariadb
- mysql2_chef_gem
- nginx_passenger
- nodejs
- sphinx
These are all the attributes we have along with their default values. Their names are pretty self-explanatory, so just read through.
default[:sharetribe] = {
:env => 'development', # used to set RAILS_ENV
:app => {
:path => '/var/www',
:domain => 'localhost',
:user => 'app',
:group => 'www-data'
},
:git => {
:repo => 'https://github.com/sharetribe/sharetribe.git',
:branch => 'master'
},
:db => {
:install_server => true,
:create_db => true,
:create_user => true,
:name => 'sharetribe_' + node.env,
:user => 'sharetribe',
:password => 'secret',
:root_password => 'secret',
:host => 'localhost',
:socket => nil
},
# keys to add to .ssh/authorized_keys for ubuntu and app users
:ssh_keys => []
}
These are the attributes configured by the sharetribe recipes for included recipes.
default[:sphinx][:install_method] = "package"
default[:nginx_passenger][:nginx_workers] = 2
default[:mariadb][:install][:version] = '5.5'
default[:mariadb][:install][:prefer_os_package] = true
default[:mariadb][:use_default_repository] = true
default[:mariadb][:forbid_remote_root] = true
default[:mariadb][:server_root_password] = node[:sharetribe][:db][:root_password]
default[:mariadb][:user][:username] = node[:sharetribe][:db][:user]
default[:mariadb][:user][:password] = node[:sharetribe][:db][:password]
You really, I mean REALLY should set at least node.sharetribe.db.password
and node.sharetribe.db.root_password
both of
which default 'secret';
Other than that, just add it to your Cheffile
, or Berksfile
, or metadata.rb
or whatever...
cookbook 'sharetribe', git: 'git://github.com/theblacksmith/sharetribe-cookbook.git'
If you want a ready to use installation, checkout my Vagrant Sharetribe Box
Runs all the recipes bellow.
Creates the user group defined at node.sharetribe.app.user
and node.sharetribe.app.group
. Sets up the user home directory and adds any ssh keys to it's .ssh/authorized_keys
file.
Installs packages and software required to install and run Sharetribe.
Compiles and install at system level replacing the current ruby
the exact version sharetribe uses which is, as of time of writing, 2.1.2
Installs nginx and passenger and configures a nginx server for the app.
If node.sharetribe.db.install_server
is true
, installs the database server specified in node.sharetribe.db.vendor
.
If node.sharetribe.db.create_db
is true
, creates a new database with the name specified in node.sharetribe.db.name
We are getting close!
- Creates the app dir
- Checkout the code (see
node.sharetribe.git
) - If
node.sharetribe.db.create_user == true
creates a new database user - Configures
database.yml
- Runs
bundle install
- Runs
bundle exec rake db:schema:load
Fun time!
- Fork the repository on Github
- Create a named feature branch (like
feature-x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License: MIT
Authors: The Blacksmith (a.k.a. Saulo Vallory)