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 | |
# frozen_string_literal: true | |
require 'json' | |
require 'yaml' | |
$stdout.puts YAML.dump(JSON.parse($stdin.read)) |
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 | |
# frozen_string_literal: true | |
require 'erb' | |
require 'json' | |
require 'yaml' | |
$stdout.puts JSON.pretty_generate(YAML.safe_load(ERB.new($stdin.read).result)) |
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 | |
# | |
# Short header explaining what the script does | |
# | |
# exit on error, error on unbound variables, disable glob expansion, fail within pipes | |
set -eufo pipefail | |
[[ -n "${DEBUG:-}" ]] && set -x | |
: "${VAR_A=default_value_a}" |
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
#!/bin/bash | |
set -euo pipefail | |
HEADER='# All lines below managed by chef_hostfile.sh' | |
backup_hostsfile() { | |
sudo cp /etc/hosts{,.$(date +%s)} | |
} |
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
for file in $(find ./tasks -type f -name '*.sh' | sort -n); do | |
current_functions="$(declare -F)" | |
echo "Sourcing task file: ${file}" | |
# shellcheck source=/dev/null | |
source "$file" | |
new_functions="$(diff <(echo "$current_functions") <($(declare -F))) | awk '$NF ~ /.*::main/ {print $NF}')" || true | |
for main in "$new_functions"; do | |
log debug "Executing function ${main} from ${file}:" | |
$main | |
done |
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
services: | |
deck: | |
host: spinnaker.mydomain.com | |
baseUrl: ${services.default.protocol}://${services.deck.host} | |
gateUrl: ${services.deck.baseUrl}/gate | |
bakeryUrl: ${services.deck.baseUrl}/rosco |
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
# If you just change the port or add more ports here, you will likely also | |
# have to change the VirtualHost statement in | |
# /etc/apache2/sites-enabled/000-default.conf | |
Listen 80 | |
<IfModule ssl_module> | |
Listen 443 | |
</IfModule> |
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
<VirtualHost _default_:80> | |
DocumentRoot /opt/deck/html | |
ProxyPass "/gate" "http://localhost:8084" retry=0 | |
ProxyPassReverse "/gate" "http://localhost:8084" | |
ProxyPass "/rosco" "http://localhost:8087" retry=0 | |
ProxyPassReverse "/rosco" "http://localhost:8087" | |
<Directory "/opt/deck/html/"> |
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
require 'net/http' | |
require 'uri' | |
require 'base64' | |
require 'json' | |
Ohai.plugin(:Consul) do | |
provides 'consul' | |
## | |
# Insert a value into a hash with a '/' delimited path |
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
### Keybase proof | |
I hereby claim: | |
* I am heph on github. | |
* I am heph (https://keybase.io/heph) on keybase. | |
* I have a public key ASCr40PeHVymBfKyLcK5V_7j42sjUGTFIe8pAMYhaMkSYAo | |
To claim this, I am signing this object: |
NewerOlder