Skip to content

Development server used for local development, staging sites and hosting trainings.

Notifications You must be signed in to change notification settings

fourkitchens/kitchen-sink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Four Kitchens: Ubuntu 14.04 Development Server

The Four Kitchens development server uses ansible for using our bespoke development environment as a VM or in the cloud. You have a great amount of configuration options available to you via yml files but by default, after installing the latest VirtualBox and the latest version of Vagrant you should be only a few steps away from a robust and comprehensive environment.

Requirements

Installation

Local (OS X)

Start by installing Homebrew, a package manager for OS X. Additional instructions can be found in the Homebrew documentation.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Next install the Homebrew extension Cask, an application package manager that deals with prebuilt binaries for desktop applications. Additional instructions can be found in the documentation.

brew install caskroom/cask/brew-cask

Next, install VirtualBox.

brew cask install virtualbox

Then, install Vagrant.

brew cask install vagrant

Optionally, install Vagrant Manager to manage your VMs.

brew cask install vagrant-manager

You'll need to install Ansible.

brew install ansible

Continue to Local (All) to complete installation.

Local (Linux)

Install VirtualBox; see the Linux Downloads page and follow the instructions that match your environment.

Then, install Vagrant; see the download page and download the package that matches your environment. Note: Must be version 1.5.* or greater. Do not use the version provided by apt-get as it is not supported.

Next, install Ansible; see their installation page and follow the instructions that match your environment.

Continue to Local (All) to complete installation.

Local (All)

Two Ansible Galaxy roles are required.

ansible-galaxy install nodesource.node
ansible-galaxy install zzet.rbenv

Change directory to where you want to store your project configuration and clone this repository.

cd ~/projects
PROJECT_NAME=dev2-playbooks
git clone git@github.com:fourkitchens/dev2-playbooks.git $PROJECT_NAME
cd $PROJECT_NAME

Within the project, run a single, magical command:

vagrant up

The virtual machine will be created and configured for you.

Pro Tip: If you have trouble mounting shared folders with NFS, which is a known issue for directories encrypted with ecryptfs, see the VagrantFile at the root of this repository for alternative options.

Usage

To access the shell, run:

vagrant ssh

To update your machine, pull the latest within the repository, then run:

vagrant provision

If you want to customize any of the settings within the playbooks, create a host_vars/vagrant file, with any settings overrides you need.

Ansible Scripts

Ansible deployment scripts, located in the deploy directory can be used for common deployment tasks. Deployment commands can be run on a development server using the following syntax, however to use them in a Vagrant virtual machine you'll need to use the bash script located below.

ansible-playbook -i hosts deploy/user-add.yml

Fill out the prompts or include them in the extra-vars -e argument

ansible-playbook -i hosts -e="user_name=bender github=fkbender" deploy/user-add.yml

A special bash script is available that makes it possible to run deployment scripts locally.

./vagrant-playook deploy/user-add.yml

The following commands will work on the vagrant machine and on the dev server:

Databases

Create MySQL Database

./vagrant-playbook deploy/database/mysql-db-create.yml

Import MySQL Database

./vagrant-playbook deploy/database/mysql-db-import.yml

Solr Cores

Add Solr Core

./vagrant-playbook deploy/solr-cores/solr-core-add.yml

Delete Solr Core

./vagrant-playbook deploy/solr-cores/solr-core-delete.yml

Users

Add User

./vagrant-playbook deploy/users/user-add.yml

Delete User

./vagrant-playbook deploy/users/user-delete.yml

Drupal Sites

The following commands only work on a remote dev server:

Deploy Drupal dev site

deploy/drupal-sites/drupal-dev-site-deploy.yml

Remove Drupal dev site

deploy/drupal-sites/drupal-dev-site-remove.yml

Deploy Drupal trunk site

deploy/drupal-sites/drupal-trunk-site-deploy.yml

Remove Drupal trunk site

deploy/drupal-sites/drupal-trunk-site-remove.yml

Dev Server Features

In addition to the easy execution of common tasks and parity between our Development and local environments, the playbooks provide a number of features.

Standard Stuff

Multiple Webservers

The dev2 playbooks now install both apache and nginx. This will allow us to more closely emulate Pantheon (nginx+php-fpm), or more common (apache) application server environments. You can switch between the two by sending either a GET argument (varnish_backend by default) or by setting a request header (X-varnish-backend by default).

For example, the following requests would hit the respective servers:

The default webserver can be set from your settings file before running the playbooks but will be set to apache by default.

Protip: you can use the Chrome extension ModHeader to send custom headers and avoid needing to use GET arguments on every request.

XHProf

You can utilize XHProf with mongodb xhprof which will provide you with a Drupal interface to view the XHProf results without using devel.

Remote

  • Create a hosts file
  • ansible-playbooks -i hosts playbook.yml
  • Magic.

About

Development server used for local development, staging sites and hosting trainings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages