diff options
author | Dan Radez <dradez@redhat.com> | 2015-09-04 14:38:56 -0400 |
---|---|---|
committer | Dan Radez <dradez@redhat.com> | 2015-09-04 14:43:31 -0400 |
commit | 8f49d7a5efc0e847ecffcb05f6aff2186d8cecc9 (patch) | |
tree | 0970daa3d2c30f93fe6aa40cfbfb63549e5182d6 /compass/deploy/prepare.sh | |
parent | ab4950db472c20b57bff533f1f330b5b794aa35b (diff) | |
parent | 591a1c4327c0793b4a15443f9e72b79ffbeaa226 (diff) |
Merge branch 'master' into merge-master-arno
Change-Id: Idbe1d8ba5f1fe44ae5c5e407d5999c28909639c5
Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'compass/deploy/prepare.sh')
-rw-r--r-- | compass/deploy/prepare.sh | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/compass/deploy/prepare.sh b/compass/deploy/prepare.sh index 2086c5d..9ec15f8 100644 --- a/compass/deploy/prepare.sh +++ b/compass/deploy/prepare.sh @@ -1,35 +1,35 @@ -sudo apt-get update -y -sudo apt-get install git python-pip python-dev -y -vagrant --version -if [[ $? != 0 ]]; then - vagrant_pkg_url=https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb - wget ${vagrant_pkg_url} - sudo dpkg -i $(basename ${vagrant_pkg_url}) -else - echo "vagrant is already installed" -fi -sudo apt-get install libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev -y -sudo service libvirt-bin restart +function prepare_env() { + export PYTHONPATH=/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages + sudo apt-get update -y + sudo apt-get install mkisofs bc + sudo apt-get install git python-pip python-dev -y + sudo apt-get install libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev -y + sudo pip install --upgrade pip + sudo pip install --upgrade ansible + sudo pip install --upgrade virtualenv + sudo service libvirt-bin restart + + # prepare work dir + sudo rm -rf $WORK_DIR + mkdir -p $WORK_DIR + mkdir -p $WORK_DIR/installer + mkdir -p $WORK_DIR/vm + mkdir -p $WORK_DIR/network + mkdir -p $WORK_DIR/iso + mkdir -p $WORK_DIR/venv -for plugin in vagrant-libvirt vagrant-mutate; do - vagrant plugin list |grep $plugin - if [[ $? != 0 ]]; then - vagrant plugin install $plugin --plugin-source https://ruby.taobao.org - else - echo "$plugin plugin is already installed" + if [[ ! -f centos.iso ]];then + wget -O $WORK_DIR/iso/centos.iso $ISO_URL fi -done -sudo pip install --upgrade ansible virtualenv -#precise_box_vb_url=https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box -#precise_box_vb_filename=$(basename ${precise_box_vb_url}) -centos65_box_vb_url=https://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140504.box -centos65_box_vb_filename=$(basename ${centos65_box_vb_url}) -#wget ${precise_box_vb_url} -vagrant box list |grep centos65 -if [[ $? != 0 ]]; then - wget ${centos65_box_vb_url} - mv ${centos65_box_vb_filename} centos65.box - vagrant mutate centos65.box libvirt -else - echo "centos65 box already exists" -fi + + # copy compass + mkdir -p $WORK_DIR/mnt + sudo mount -o loop $WORK_DIR/iso/centos.iso $WORK_DIR/mnt + cp -rf $WORK_DIR/mnt/compass/compass-core $WORK_DIR/installer/ + cp -rf $WORK_DIR/mnt/compass/compass-install $WORK_DIR/installer/ + sudo umount $WORK_DIR/mnt + rm -rf $WORK_DIR/mnt + + chmod 755 $WORK_DIR -R + virtualenv $WORK_DIR/venv +} |