This file contains 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
# A Basic API Controller for Rails | |
# Handles authentication via Headers, params, and HTTP Auth | |
# Automatically makes all requests JSON format | |
# | |
# Written for production code | |
# Made public for: http://broadcastingadam.com/2012/03/state_of_rails_apis | |
# | |
# Enjoy! | |
class ApiController < ApplicationController |
This file contains 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
assert::var() { | |
if [ -z "${1:-}" ]; then | |
log::error "Argument required" | |
return 1 | |
fi | |
set +u | |
if [ -z "${!1}" ]; then | |
log::error "${1} required, nothing given" | |
return 1 |
This file contains 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 ruby | |
# vim: set expandtab sts=2 tw=2 sw=2: | |
$stdout.sync = true | |
$stderr.sync = true | |
require 'octokit' | |
require 'dalli' | |
require 'json' | |
require 'time' |
This file contains 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 ruby | |
# This is a basic deploy script for Heroku apps. | |
# It provides a structure you can use to expand on | |
# and add your own prereqs and deploy tasks. | |
# | |
# It basically ensures that: | |
# 1. There are no uncommited files | |
# 2. You can ssh to github | |
# 3. You can connect to heroku |
This file contains 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 | |
set -xeuo pipefail | |
main() { | |
# TODO: add all your desired regions here | |
local -a regions=(ap-south-1) | |
for region in "${regions[@]}"; do | |
aws --region "${region}" cloudwatch put-metric-alarm \ |
This file contains 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
RUBY_IMAGE:=$(shell grep FROM Dockerfile | cut -f2 -d' ') | |
DYNAMODB_IMAGE:=dynamodb:latest # original value ommitted | |
APP_IMAGE:=inventory_service/app | |
TAG:=$(shell git rev-parse --short HEAD) | |
REGISTRY:=example.registry.com # original value omitted | |
.DEFAULT_GOAL:= build |
This file contains 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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: scylla | |
data: | |
readiness-probe: | | |
#!/usr/bin/env bash | |
set -euo pipefail |
This file contains 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
let AWS = require('aws-sdk'); | |
let DB = require('./db'); | |
class Configuration { | |
constructor() { | |
this.bucket = process.env.S3_BUCKET; | |
} | |
get dynamoDBclient() { | |
return new AWS.DynamoDB({ |
This file contains 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
{{- $stage := .Values.stage }} | |
{{- range $pod := .Values.topology.pods }} | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: '{{ template "fullname" $ }}-{{ $pod.name | replace "_" "-" }}-{{ $pod.tier }}' | |
labels: | |
release: "{{ $.Release.Name }}" | |
chart: '{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "-" }}' |
This file contains 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 | |
# This script is a workaround for https://github.com/kubernetes/helm/issues/2288. | |
# helm install --wait should do everything this script does. It should be deleted | |
# when the bug is fixed. | |
set -euo pipefail | |
main() { | |
local counter=0 release timeout pods |
NewerOlder