#!/bin/bash
set -e
CURL="om --target https://${opsman_url} -k \
  --username $pcf_opsman_admin_username \
  --password $pcf_opsman_admin_password \
  curl"

if [[ -s om-bosh-creds/bosh-ca.pem ]]; then
  bosh -n --ca-cert om-bosh-creds/bosh-ca.pem target `cat om-bosh-creds/director_ip`
else
  bosh -n target `cat om-bosh-creds/director_ip`
fi

BOSH_USERNAME=$(cat om-bosh-creds/bosh-username)
BOSH_PASSWORD=$(cat om-bosh-creds/bosh-pass)

echo "Logging in to BOSH..."
bosh login <<EOF 1>/dev/null
$BOSH_USERNAME
$BOSH_PASSWORD
EOF

echo "Interpolating..."
eval "echo \"$(cat pcf-prometheus-git/pipeline/tasks/etc/local.yml)\"" > local.yml
bosh-cli interpolate pcf-prometheus-git/prometheus.yml -l local.yml > manifest.yml

echo "Deploying..."

bosh -n deployment manifest.yml

bosh -n deploy --no-redact

#!/bin/bash
set -e
CURL="om --target https://${opsman_url} -k \
  --username $pcf_opsman_admin_username \
  --password $pcf_opsman_admin_password \
  curl"

if [[ -s om-bosh-creds/bosh-ca.pem ]]; then
  bosh -n --ca-cert om-bosh-creds/bosh-ca.pem target `cat om-bosh-creds/director_ip`
else
  bosh -n target `cat om-bosh-creds/director_ip`
fi

BOSH_USERNAME=$(cat om-bosh-creds/bosh-username)
BOSH_PASSWORD=$(cat om-bosh-creds/bosh-pass)

echo "Logging in to BOSH..."
bosh login <<EOF 1>/dev/null
$BOSH_USERNAME
$BOSH_PASSWORD
EOF

echo "Interpolating..."
eval "echo \"$(cat pcf-prometheus-git/tasks/etc/local.yml)\"" > local.yml
bosh-cli interpolate pcf-prometheus-git/prometheus.yml -l local.yml > manifest.yml

echo "Deploying..."

bosh -n deployment manifest.yml

bosh -n deploy --no-redact

--- 
+++ 
@@ -21,7 +21,7 @@
 EOF
 
 echo "Interpolating..."
-eval "echo \"$(cat pcf-prometheus-git/pipeline/tasks/etc/local.yml)\"" > local.yml
+eval "echo \"$(cat pcf-prometheus-git/tasks/etc/local.yml)\"" > local.yml
 bosh-cli interpolate pcf-prometheus-git/prometheus.yml -l local.yml > manifest.yml
 
 echo "Deploying..."
Fix path for local.yml in pipeline
