#!/usr/bin/env bash

set -e -x


source bosh-cpi-release/ci/tasks/utils.sh

check_param aws_access_key_id
check_param aws_secret_access_key

cd bosh-cpi-release

source /etc/profile.d/chruby-with-ruby-2.1.2.sh

set +x
echo creating config/private.yml with blobstore secrets
cat > config/private.yml << EOF
---
blobstore:
  s3:
    access_key_id: $aws_access_key_id
    secret_access_key: $aws_secret_access_key
EOF
set -x

echo "using bosh CLI version..."
bosh version

echo "finalizing CPI release..."
bosh finalize release ../bosh-cpi-dev-artifacts/*.tgz

rm config/private.yml

version=`git diff releases/*/index.yml | grep -E "^\+.+version" | sed s/[^0-9]*//g`
git diff | cat
git add .

git config --global user.email cf-bosh-eng@pivotal.io
git config --global user.name CI
git commit -m ":airplane: New final release v $version"

#!/usr/bin/env bash

set -e -x


source bosh-cpi-release/ci/tasks/utils.sh

check_param aws_access_key_id
check_param aws_secret_access_key

cd bosh-cpi-release

source /etc/profile.d/chruby.sh
chruby 2.1.2

set +x
echo creating config/private.yml with blobstore secrets
cat > config/private.yml << EOF
---
blobstore:
  s3:
    access_key_id: $aws_access_key_id
    secret_access_key: $aws_secret_access_key
EOF
set -x

echo "using bosh CLI version..."
bosh version

echo "finalizing CPI release..."
bosh finalize release ../bosh-cpi-dev-artifacts/*.tgz

rm config/private.yml

version=`git diff releases/*/index.yml | grep -E "^\+.+version" | sed s/[^0-9]*//g`
git diff | cat
git add .

git config --global user.email cf-bosh-eng@pivotal.io
git config --global user.name CI
git commit -m ":airplane: New final release v $version"

Fix the sourcing of chruby and version selection.
Fix the sourcing of chruby and version selection.

[#73636468](https://www.pivotaltracker.com/story/show/73636468)

Signed-off-by: Aaron Hurley <6c541e38cb40b4360b80e64c308405691f38e38a@pivotal.io>
