Skip to content

Instantly share code, notes, and snippets.

View ashleyblackmore's full-sized avatar

Ashley Blackmore ashleyblackmore

View GitHub Profile
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["master"]
#!/bin/sh
# from http://d.hatena.ne.jp/heavenshell/20121122/1353597292
VENV=$1
echo $VENV
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
MINION_HOME=/home/minion/minion
SUPERVISOR_CONFDIR=/etc/supervisor/conf.d
MINION_CONFDIR=/etc/minion
MINION_FRONTEND_HOST=localhost
MYHOSTNAME=$(hostname)
# nginx
sudo cp ${MINION_HOME:?}/minion-frontend/etc/minion-dev-server.nginx.conf /etc/nginx/conf.d/minion.conf
sudo sed -i "s/minion-dev\.mozillalabs\.com/${MINION_FRONTEND_HOST:?}/g" /etc/nginx/conf.d/minion.conf