Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
474 B
1
Indexable
Never
#!/bin/bash

profile=$1
[[ ! -z "$profile" ]] && profile=,$profile

host=http://consul-dev.mmt.com:8500

find flights-gi-backend/cb-config -type f -name '**.yml' | while read file; do
    key=$(echo $file | sed 's#/cb-config/#/cb-config'$profile'/#')
    # echo http://my-consul-server:8500/v1/kv/FLIGHTS/$key
    curl -v --request PUT --data-binary @$file "$host/v1/kv/FLIGHTS/$key"
done


# to upload consul file for GI backend run `sh upload-gi-backend.sh {profile_name}`