-
-
Save robert-bryson/34ef80a8b5aff4eb75318cfcd4f44e24 to your computer and use it in GitHub Desktop.
Quick and dirty scripts for https://github.com/gsa/data.gov/issues/3755
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 -e | |
set -o pipefail | |
set -o xtrace | |
replace_hostname () { | |
local replace="-$1" | |
sed -i "s/((hostname)).*.apps/((hostname))$replace.apps/" manifest.yml | |
} | |
main () { | |
declare apps=(catalog-gather catalog-harvest dashboard) | |
declare SPACE="staging" | |
declare EGRESS_SPACE="$SPACE-egress" | |
replace_hostname "$SPACE" | |
for app in ${apps[@]}; do | |
local egress_app="$app-egress" | |
cf target -s "$EGRESS_SPACE" | |
if ! cf app "$egress_app" > /dev/null; then | |
cf push --vars-file vars."$egress_app".yml | |
fi | |
bin/cf-deployproxy "$egress_app" "$EGRESS_SPACE" | |
cf target -s "$SPACE" | |
cf add-network-policy "$app" "$egress_app" -s "$EGRESS_SPACE" | |
done | |
replace_hostname "" | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment