- the
develop
branch is where ALL development starts from and merges to. - the
master
branch ALWAYS matches production - typical workflow would be branch a feature branch from
develop
, code and commit often. When code is readt for review & merge, open a Pull Request from the branch todevelop
. - a typical deploy to production will take the
develop
branch and merge tomaster
. Themaster
branch will then be deployed to production machines. - a
hotfix
is defined as a mission critical change that must be deployed to production with expediency.- the proper way to handle a
hotfix
is to branch frommaster
and open a Pull Request from the branch tomaster
- the proper way to handle a
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
# /etc/cron.d/app-cron | |
0 0 * * * root bash -l -c '/usr/bin/rake.sh rake:task1 >> /dev/console 2>&1' | |
*/5 * * * * root bash -l -c '/usr/bin/rake.sh rake:task2 >> /dev/console 2>&1' | |
*/10 * * * * root bash -l -c '/usr/bin/rake.sh rake:task3 >> /dev/console 2>&1' |
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
# https://wdullaer.com/blog/2016/02/28/pass-credentials-to-the-awslogs-docker-logging-driver-on-ubuntu/ | |
root@ip-10-0-4-212:~# cat /etc/default/docker | |
# Docker Upstart and SysVinit configuration file | |
# | |
# THIS FILE DOES NOT APPLY TO SYSTEMD | |
# | |
# Please see the documentation for "systemd drop-ins": | |
# https://docs.docker.com/engine/articles/systemd/ |
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
[Unit] | |
Description=Netuitive | |
Requires=docker.socket | |
After=docker.socket | |
[Service] | |
ExecStartPre=-/usr/bin/docker stop netuitive-agent | |
ExecStartPre=-/usr/bin/docker rm netuitive-agent | |
ExecStartPre=/bin/sh -c "docker history netuitive/docker-agent:latest >/dev/null || docker pull netuitive/docker-agent:latest" | |
ExecStart=/usr/bin/docker run --privileged --name netuitive-agent -h %H -v /proc:/host_proc:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -e DOCKER_HOSTNAME=%H -e APIKEY=efbda858cbadc958ccbb62c675180412 netuitive/docker-agent |
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
require 'optparse' | |
require 'ostruct' | |
require 'json' | |
require 'date' | |
def opts | |
@opts ||= OpenStruct.new( | |
verbose: false, | |
region: 'us-east-1', | |
aws_profile: 'default', |
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
[Unit] | |
Description=Datadog | |
Requires=docker.socket | |
After=docker.socket | |
[Service] | |
ExecStartPre=-/usr/bin/docker stop dd-agent | |
ExecStartPre=-/usr/bin/docker rm dd-agent | |
ExecStartPre=/bin/sh -c "docker history datadog/docker-dd-agent:latest >/dev/null || docker pull datadog/docker-dd-agent:latest" | |
ExecStart=/usr/bin/docker run --privileged --name dd-agent -h %H -v /var/run/docker.sock:/var/run/docker.sock -v /proc/mounts:/host/proc/mounts:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e API_KEY=DATADOG_API_KEY datadog/docker-dd-agent |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream app { | |
server 127.0.0.1:3838 fail_timeout=0; | |
} | |
server { |
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
# Show all EB Deployed versions | |
aws --profile eb-cli elasticbeanstalk describe-environments | jq -r '.Environments[] | .EnvironmentName + ": " + .Status + "/" + .Health + "\t (" + .VersionLabel + ")"' | sort | |
# Show EB envs that are NOT Ready | |
aws --profile eb-cli elasticbeanstalk describe-environments | jq -r '.Environments[] | .EnvironmentName + ": " + .Status + "/" + .Health + "\t (" + .VersionLabel + ")"' | sort | grep -v Ready |
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
cat VARSFILE.env | awk -F '=' 'BEGIN {ORS=" "} {print $1"=\""$2"\""}' |
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
#!/usr/bin/env bash | |
# | |
# Rails console script that can be run on AWS Elastic Beanstalk. | |
# | |
# Run this script from the app dir (/var/app/current) as root (sudo script/rails-console) | |
# | |
set -xe | |
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |