Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
#!/bin/bash
# AWS CodePipeline execution status
#
# by Darren Hodges (http://github.com/hodglim)
#
# <bitbar.title>AWS CodePipeline execution status</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Darren Hodges</bitbar.author>
# <bitbar.author.github>hodglim</bitbar.author.github>
@StevenACoffman
StevenACoffman / rotate-github-personal-access-keys.sh
Created September 27, 2018 21:48
Rotate Github Personal Access Keys
#!/bin/bash
TOKEN_UUID=$(uuidgen)
if [ -z ${GITHUB_USERID+x} ]; then
echo "GITHUB_USERID is unset, exitting";
exit 1
else
echo "GITHUB_USERID is set to '$GITHUB_USERID'"
fi
@StevenACoffman
StevenACoffman / codedeploy-to-slack.js
Created September 11, 2018 14:06 — forked from teeli/codedeploy-to-slack.js
CodeDeploy notifications to Slack (AWS Lambda via SNS)
var https = require('https');
var util = require('util');
exports.handler = function (event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var severity = "good";
var message = event.Records[0].Sns.Message;
var messageJSON = JSON.parse(message);
@StevenACoffman
StevenACoffman / notify_slack.py
Created September 11, 2018 14:06 — forked from richardnbanks/notify_slack.py
AWS Lambda function to send notifications from CodeDeploy to Slack
from __future__ import print_function
import json, urllib, urllib2
def send_slack(message):
"""
Send Slack Message to Deployments Channel
"""
slack_token = ''
slack_channel = ''
slack_user = 'Deployment Bot'
@StevenACoffman
StevenACoffman / cloudformationVSTerraform.md
Created September 6, 2018 10:23
CloudFormation vs. Terraform

You want to avoid CloudFormation because it’s slow, you don’t have much insight to what it’s doing while it’s running (the interface really sucks), it’s hard to stop it, and there are cases where it will get stuck for 4 hours (if certain internal components hang, it will retry twice with a 2 hr timeout and not even AWS premium support can unblock you). Terraform puts all of the control about what’s going on in your hands, the syntax is much simpler (CF’s json format is way too much syntax), and the “modules” feature allows for way simpler reusability.

From https://medium.com/@blockjon/scaling-jenkins-bad7a4ea046f

@StevenACoffman
StevenACoffman / Continuous Delivery Ideas.md
Last active December 28, 2019 23:49
Continuous Delivery Ideas

Hackathon Requirements

In order to organize a hackathon, we have to describe:

  • What the hackathon is about
  • What the benefits are
  • How the results/benefits will be reported
  • then talk to the resource managers and product managers with that stuff

General Requirements

We want per-branch automatic k8s deploys in our staging environment. Each github branch of a repo has an instance of - running. Deployments self-destruct after 4 hours if the branch is not master. Anyone can trigger a new build with a comment on a pull request (or new commit).

@StevenACoffman
StevenACoffman / job_submit.py
Created July 25, 2018 01:22 — forked from kozikow/job_submit.py
Submiting job to kubernetes
import os
import re
import kubernetes
import logging
import math
from kubernetes.client import V1Container
from kubernetes.client import V1EnvVar
from kubernetes.client import V1Job
@StevenACoffman
StevenACoffman / cascade_delete.py
Created July 25, 2018 01:21 — forked from nomastmas/cascade_delete.py
script to reproduce pods not being deleted on job delete through python api client
from __future__ import unicode_literals
from time import sleep
import yaml
from kubernetes import client, config
from kubernetes.client.rest import ApiException
job_template = """
apiVersion: batch/v1