Permalink
Browse files

Add octo config:export command.

  • Loading branch information...
darron committed Jun 7, 2014
1 parent 7afd14a commit 7849e530cc80149d05b004c94bcc49bec49ecd47
Showing with 16 additions and 0 deletions.
  1. +16 −0 bin/octo
View
@@ -183,6 +183,21 @@ case "$1" in
fi
;;
config:export)
RESULTS=$(curl -s -L http://$ETCD_SERVER/v2/keys/?recursive=true | jq '[.node.nodes[] | {nodes}]' | jq -r .[] | jq '.nodes[] .key, .value' | sort | uniq)
for key in $RESULTS
do
if [ "$key" != "null" ]
then
KEY=$(echo $key | cut -d '"' -f 2)
VALUE=$(octo config:get $KEY)
echo "octo config:set $KEY '$VALUE'"
fi
done
;;
config)
if [ $2 ]; then
for conf in `/usr/local/bin/etcdctl -C $ETCD_SERVER ls $2 | grep -v "Error: 100: Key not found"`;
@@ -326,6 +341,7 @@ case "$1" in
octo config:set {container/key} {var} Set an ENV variable for {container}.
octo config:get {container/key} Get an ENV variable for {container}.
octo config:rm {container/key} Remove an ENV variable for {container}.
octo config:export Get all config variables for all containers.
octo tentacles {pull|start|stop} Pull/start/stop octohost/tentacles image.

0 comments on commit 7849e53

Please sign in to comment.