Skip to content

Instantly share code, notes, and snippets.

View crsimmons's full-sized avatar
🇨🇦
Probably writing YAML

Colin Simmons crsimmons

🇨🇦
Probably writing YAML
  • London, UK
View GitHub Profile
@crsimmons
crsimmons / credhub_backup.rb
Created May 17, 2018 16:52
Extract all credhub parameters into a yaml file in a format compatible with credhub import
require 'json'
require 'yaml'
json = JSON.parse(`credhub find -j`)
output = {
'credentials' => json['credentials'].map do |cred|
name = cred['name']
credential = JSON.parse(`credhub get -n #{name} -j`)