This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using conf.py (currently in master) | |
# Jenkins config... | |
# Wes Code (e.g. before any help) | |
#!/bin/bash | |
source /home/ubuntu/production/bin/activate | |
cd /srv/ | |
echo "Generating 'doc' folder..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.cache import cache | |
cache_key = 'CM:recent-jobs' | |
cache.delete(cache_key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deploy branch to staging | |
from fabric.api import cd, env, parallel, run, task | |
from fabric.decorators import roles | |
# Define your servers | |
env.roledefs = { | |
'staging-web-servers': ['s-web-01.example.com', | |
's-web-03.example.com', | |
's-web-03.example.com'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# Deploy branches to staging. | |
# | |
# Commands: | |
# hubot deploy <branch> to <environment> | |
# hubot show branches | |
{spawn, exec} = require 'child_process' | |
module.exports = (robot) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:hubot] | |
command=/srv/hubot/bin/hubot --adapter hipchat | |
user=hubot | |
autostart=true | |
autorestart=true | |
directory=/srv/hubot/ | |
environment=HUBOT_AUTH_ADMIN="XYZ",HUBOT_HIPCHAT_PASSWORD="XYZ",HUBOT_HIPCHAT_TOKEN="XYZ",HUBOT_HIPCHAT_JID="XYZ",HUBOT_HIPCHAT_ROOMS="ROOMS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import multiprocessing | |
import os | |
import sys | |
import unittest | |
class RunTests(): | |
""" | |
Test wrapper to allow for local or remote (via saucelabs) tests to be run in | |
parallel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setUp(self): | |
if 'remote_saucelabs' in os.environ: | |
desired_capabilities = [] | |
##--tc=name:Dev-run --tc=browser:firefox | |
browser = copy.copy(webdriver.DesiredCapabilities.FIREFOX) | |
browser['name'] = config['name'] | |
desired_capabilities += [browser] | |
self.driver = webdriver.Remote( | |
desired_capabilities=desired_capabilities, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Crude but does the job | |
from boto.s3.connection import S3Connection | |
conn = XXX | |
rs = conn.get_all_buckets() | |
# Get bucket | |
bucket_name = 'XXX' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pre_staging_restart_services(): | |
""" | |
Restart celery and gunicorn services | |
Used by newer staging environments | |
""" | |
# Install requirements | |
with virtualenv(): | |
run('pip install -r /srv/CustomMade/requirements.txt') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from: http://blog.domenech.org/2012/11/automatically-manage-your-aws-ec2.html | |
# External IPs are not useful internally in AWS. Change to CNAME with public DNS. This ensures you don't pay for extra bandwidth as if will resolve to an internal IP when inside AWS and an external IP when outside in the real world | |
#!/bin/bash | |
logger start-up-name.sh Started | |
#More environment variables than we need but... we always do that | |
export AWS_CREDENTIAL_FILE=/opt/aws/apitools/mon/credential-file-path.template | |
export AWS_CLOUDWATCH_HOME=/opt/aws/apitools/mon |