Run:
chmod +x pre-push.sh
ln -s ../../pre-push.sh .git/hooks/pre-push
and the script will be executed before each git push. You can skip the hook by adding --no-verify
to your git push
.
class DashboardMiddleware | |
def call(worker_instance, queue, sqs_msg, body) | |
# send before process information | |
yield | |
# send after process information | |
rescue Exception => e | |
# send exception information | |
end | |
end |
# rescue... | |
data = { | |
id: sqs_msg.attributes['SentTimestamp'].to_i, | |
worker: worker_instance.class.to_s, | |
queue: queue, | |
arguments: body, | |
enqueued_at: Time.at(sqs_msg.attributes['SentTimestamp'].to_i / 1000) | |
} | |
REDIS.lpush("sqs-dashboard-failures", data) | |
# end |
Run:
chmod +x pre-push.sh
ln -s ../../pre-push.sh .git/hooks/pre-push
and the script will be executed before each git push. You can skip the hook by adding --no-verify
to your git push
.
FROM ruby:2.2.2 | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
# Install RMagick | |
# RUN apt-get install -y libmagickwand-dev imagemagick | |
# Install Nokogiri | |
# RUN apt-get install -y zlib1g-dev | |
RUN mkdir /myapp |
development: &default | |
adapter: postgresql | |
encoding: unicode | |
database: your-project_development | |
pool: 5 | |
username: <%= ENV.fetch('DB_USERNAME', 'your-project') %> | |
password: <%= ENV.fetch('DB_PASSWORD', 'your-project') %> | |
host: <%= ENV.fetch('DB_1_PORT_5432_TCP_ADDR', 'localhost') %> | |
port: <%= ENV.fetch('DB_1_PORT_5432_TCP_PORT', '5432') %> | |
cat >config/mongoid.yml <<EOF | |
test: | |
sessions: | |
default: | |
database: ${JOB_NAME}_test | |
hosts: | |
- <%= "#{ENV['DB_1_PORT_27017_TCP_ADDR']}:#{ENV['DB_1_PORT_27017_TCP_PORT']}" %> | |
EOF |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage unicorn server | |
# Description: Start, stop, restart unicorn server for a specific application. | |
### END INIT INFO |
set :stage, :production | |
role :app, %w(user@url) | |
role :web, %w(user@url) | |
role :db, %w(user@url) | |
set :bundle_binstubs, -> { shared_path.join('bin') } | |
set :ssh_options, keys: %w(~/.ssh/your-project-production.pem), forward_agent: true |
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/rbenv' | |
require 'capistrano/rbenv_install' | |
require 'capistrano/bundler' | |
require 'capistrano/rails/assets' | |
require 'capistrano/rails/migrations' | |
require 'capistrano/nginx_unicorn' | |
require 'capistrano/sidekiq' | |
require 'whenever/capistrano' |
# Config valid only for Capistrano 3.2.1 | |
lock '3.2.1' | |
set :application, 'your-project' | |
set :repo_url, 'git@github.com:organization/your-repository.git' | |
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call | |
set :scm, :git | |
set :deploy_to, "/home/ubuntu/apps/#{fetch(:application)}" |