allomov
7/15/2015 - 5:26 AM

bootstrap-jumpbox.sh

# Create a workspace
git clone https://github.com/Altoros/ibm-power-bosh-workspace.git /home/ubuntu/workspace

# Build stemcell
sudo /home/ubuntu/stemcell-builder/bin/build-stemcell
cp ~/stemcell-builder/bosh-stemcell-ppc64-2915-openstack-kvm-ubuntu-trusty-go_agent.tgz /home/ubuntu/workspace/stemcells/stemcell.tgz

# Prepare
mkdir /home/ubuntu/releases
cd /home/ubuntu/releases
sudo gem uninstall bundler
sudo gem install bundler -v 1.7.4

# Build CPI release
git clone --branch power https://github.com/Altoros/bosh-openstack-cpi-release.git
cd bosh-openstack-cpi-release
bosh create release --force --with-tarball --name bosh-openstack-cpi
cp /home/ubuntu/releases/bosh-openstack-cpi-release/dev_releases/bosh-openstack-cpi/bosh-openstack-cpi-5+dev.1.tgz /home/ubuntu/workspace/releases/cpi-release.tgz

# Build BOSH release
cd /home/ubuntu/releases
git clone --recursive --branch power-2915 https://github.com/Altoros/bosh.git
cd ./bosh/release
mkdir blobs
cp -r /home/ubuntu/binary_builder/binaries/bosh/* blobs
sudo chown -R ubuntu /tmp/
bundle exec rake release:create_dev_release
bundle exec bosh create release --force --with-tarball --name bosh
cp /home/ubuntu/releases/bosh/release/dev_releases/bosh/bosh-156+dev.1.tgz /home/ubuntu/workspace/releases/bosh-release.tgz

# Build CF release
cd /home/ubuntu/releases
git clone --recursive --branch power-207 https://github.com/Altoros/cf-release.git
cd cf-release
mkdir blobs
./update
cp -r /home/ubuntu/binary_builder/binaries/cf/* blobs
bundle exec bosh create release --force --with-tarball --name cf

# Deploy MicroBOSH
cd ~/workspace
cp config/secret.yml{.example,}
vi config/secret.yml           # enter your credentials
cp config/micro-bosh-stub.yml{.example,}
vi config/micro-bosh-stub.yml  # put floating and private IP of the MicroBOSH instance
./generate_manifest micro-bosh
# be sure that you have you default SSH key for OpenStack in ~/.ssh/id_rsa.pem
bosh-init deploy manifests/micro-bosh.yml
# Build CF release
cd /home/ubuntu/releases
git clone --recursive --branch power-207 https://github.com/Altoros/cf-release.git
cd cf-release
mkdir blobs
./update
cp -r /home/ubuntu/binary_builder/binaries/cf/* blobs
rvm gemset use global
gem uninstall bundler 
gem install bundler -v 1.7.4 --no-ri --no-rdoc
bundle exec bosh create release --force --with-tarball --name cf

cd /home/ubuntu/workspace  # this folder is created in deploy-microbosh.sh
cp config/cf-stub.yml{.example,}
vi config/cf-stub.yml      # fill in floating ip values
./generate_manifest cf
bosh deployment manifest/cf.yml
bosh -n deploy
# Prepare environment
sudo apt-get install python-pip python-dev build-essential
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install -y git tmux python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install ansible
sudo ansible-galaxy install rvm_io.rvm1-ruby

# Bootstrap "jumpbox" VM
export jumpbox_ip=<ENTER-JUMPBOX-IP-HERE>
mkdir work
cd work
git clone git@github.com:Altoros/power-bosh-jumpbox-bootstrap.git
cd power-bosh-jumpbox-bootstrap/
cp hosts{.example,}
# Substitute x.x.x.x with jumpbox IP
vi hosts
# gsub /x.x.x.x|$jumpbox_ip/i > hosts
ansible-playbook all-in-one-playbook.yml