allomov
6/4/2014 - 7:32 AM

How to install CF with Juju charms from zero.

How to install CF with Juju charms from zero.

# Install stable juju
sudo add-apt-repository ppa:juju/devel
sudo add-apt-repository ppa:ahasenack/juju-deployer-daily
sudo apt-get update 
sudo apt-get install qemu-kvm libvirt-bin juju-core juju-local juju-deployer virt-manager -y

# (optional) sudo usermod -a -G libvirtd ubuntu 
# (optional) Reconnect to your account or reboot computer 
 
# Add Google DNS to fix problems with xip.io
sudo sh -c 'echo "nameserver 8.8.8.8" >> /etc/resolvconf/resolv.conf.d/head'
sudo restart resolvconf
 
# Get bundle project 
mkdir ~/launchpad && cd ~/launchpad
bzr branch lp:~cf-charmers/charms/bundles/cloudfoundry/bundle
cd bundle 

# [IMPORTANT]: set network-bridge option to virbr0 in ~/.juju/environments.yaml


# Bootstrap juju
juju init
juju switch local
juju bootstrap


 
# Install CF
juju deployer -Wdvc bundles.yaml base

# Install CF CLI tool
wget -Ocf.deb https://cli.run.pivotal.io/stable?release=debian64
sudo dpkg -i cf.deb

# Test CF
router_ip=$(juju status router | grep public-address | awk '{print $2}')
cf api http://api.${router_ip}.xip.io
cf login -u admin -p admin
cf create-space -o my-org my-space
cf target -o my-org -s my-space
 
# Download application 
cd ~ && git clone https://github.com/allomov/super-simple-sintara-app.git
cd ~/super-simple-sintara-app 
cf push sinatratest -p .