Skip to content

Commit

Permalink
Hide the password output in the template scripts
Browse files Browse the repository at this point in the history
[#152550142]
  • Loading branch information
Warren Fernandes committed Nov 3, 2017
1 parent a07733a commit 6eee869
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jobs/backup-restore-notifications/templates/common.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ API_ENDPOINT="$SCHEME://api.$DOMAIN"
APP_NAME="notifications"
APP_DOMAIN="<%= properties.notifications.app_domain %>"

# Don't print out password
set +e
ADMIN_USER="<%= properties.notifications.cf.admin_user %>"
ADMIN_PASSWORD="<%= properties.notifications.cf.admin_password %>"
set -e

ORG="<%= properties.notifications.organization %>"
SPACE="<%= properties.notifications.space %>"
Expand All @@ -24,7 +27,10 @@ CONFIG_JSON_PATH="${JOB_PATH}/config/backup-restore-notifications-db-config.json
function cf_auth_and_target() {
echo "Authenticate and target..."
cf api $API_ENDPOINT <% if properties.ssl.skip_cert_verify %>--skip-ssl-validation<% end %>
# Don't print out password
set +e
cf auth $ADMIN_USER "$ADMIN_PASSWORD"
set -e
echo -e "********************\n"
cf target -o $ORG -s $SPACE
}

0 comments on commit 6eee869

Please sign in to comment.