This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
- Introduction
- Installing Node.js
- Installing MySQL
- Setting-up the project
This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
# https://www.varnish-cache.org/trac/wiki/VCLExamples | |
# Summary | |
# 1. Varnish will poll the backend at /health_check to make sure it is | |
# healthy. If the backend goes down, varnish will server stale content | |
# from the cache for up to 1 hour. | |
# 2. Varnish will pass X-Forwarded-For headers through to the backend | |
# 3. Varnish will remove cookies from urls that match static content file | |
# extensions (jpg, gif, ...) |
# This goes in vcl_recv | |
# It gives you: | |
# curl -X PURGE http://some.example.com/.* | |
# curl -X PURGE http://some.example.com/blog/.* | |
# curl -X PURGE http://some.example.com/blog/2011/bar.html | |
# curl -X PURGE http://another.example.com/.* | |
# | |
if (req.request == "PURGE") { | |
# Wildcard, per-domain purging | |
purge("req.http.host == " req.http.host " && req.url ~ " req.url "$"); |
ENV["PATH"] = "/opt/ruby/bin:#{ENV['PATH']}" | |
ENV["RAILS_ENV"] = "production" | |
ENV["QUEUE"] = "*" | |
Bluepill.application("nichelator") do |app| | |
app.working_dir = "/var/apps/nichelator/current" | |
app.uid = "app" | |
app.gid = "app" | |
2.times do |i| | |
app.process("resque-#{i}") do |process| |
# note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup | |
desc "Hot-reload God configuration for the Resque worker" | |
deploy.task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}" | |
sudo "god start resque" | |
end | |
after 'deploy:update_code', 'deploy:update_shared_symlinks' |