Skip to content

Commit

Permalink
Deploy manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
danhigham committed May 12, 2017
1 parent aa85f3d commit 740b75a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deploy-bosh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ az storage container create --account-name $storageAccount --account-key $storag
# create stemcell
az storage table create --account-name $storageAccount --account-key $storageKey -n stemcells

# deploy
# Deploy director

su -l pivotal sh -c "
bosh --tty create-env /tmp/bosh-deployment/bosh.yml \
Expand All @@ -82,9 +82,14 @@ su -l pivotal sh -c "bosh --tty -e 10.2.0.10 --ca-cert <(bosh int azure-bosh-dir
adminPassword=$(ruby -ryaml -e "puts YAML::load(open(ARGV.first).read)['admin_password']" /home/pivotal/azure-bosh-director-creds.yml)
su -l pivotal sh -c "bosh --tty -e bosh-azure login --client=admin --client-secret=$adminPassword"

# Get IPs from public pool
poolIP0=$(az network public-ip list | jq -r "map(select(.resourceGroup == \"$vmResGroup\") | select(.tags == {\"poolIp\": \"True\"}))[0].ipAddress")

# Template cloud config file
storage_account_name=$storageAccount
premium_storage_account_name="premium$storageAccount"
director_uuid=$(bosh -n -e bosh-azure environment --json | jq -r ".Tables[0].Rows[0].uuid")

working_directory=$(pwd)
sed -e 's/{{ *\([^} ]*\) *}}/$\1/g' -e 's/^/echo "/' -e 's/$/" > cloud_config.yml/' $working_directory/cloud_config.template.yml | sh
cp cloud_config.yml $HOME
Expand Down Expand Up @@ -118,6 +123,13 @@ if [ -d "recipes/$recipe" ]; then
i=$(($i + 1))
done

# Template the manifest
sed -e 's/{{ *\([^} ]*\) *}}/$\1/g' -e 's/^/echo "/' -e 's/$/" > manifest.yml/' $working_directory/recipes/$recipe/manifest.yml | sh
cp manifest.yml $HOME

# Deploy
su -l pivotal sh -c "bosh -n --tty -e bosh-azure deploy manifest.yml"

else
echo "Recipe '$recipe' does not exist"
exit 1
Expand Down

0 comments on commit 740b75a

Please sign in to comment.