mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-29 09:33:26 +00:00
[Vagrant] Update setup with primary VM and optionals.
Add URL of db2cli driver package, download and install automatically without manual intervention. [ci skip]
This commit is contained in:
70
Vagrantfile
vendored
70
Vagrantfile
vendored
@@ -3,50 +3,12 @@
|
||||
|
||||
# Vagrant virtual development environments for SOCI
|
||||
|
||||
# All Vagrant configuration is done below.
|
||||
# The "2" in Vagrant.configure configures the configuration version.
|
||||
# Please don't change it unless you know what you're doing.
|
||||
Vagrant.configure(2) do |config|
|
||||
# The most common configuration options are documented and commented below.
|
||||
# For a complete reference, please see the online documentation at
|
||||
# https://docs.vagrantup.com.
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://atlas.hashicorp.com/search.
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
|
||||
# Enable automatic box update checking.
|
||||
config.vm.box = "bento/ubuntu-14.04"
|
||||
config.vm.box_check_update = true
|
||||
|
||||
# Configure database box with IBM DB2 Express-C
|
||||
config.vm.define "db2" do |db2|
|
||||
db2.vm.hostname = "vmdb2"
|
||||
db2.vm.network "private_network", type: "dhcp"
|
||||
# Access to DB2 instance from host
|
||||
db2.vm.network :forwarded_port, host: 50000, guest: 50000
|
||||
db2.vm.provider :virtualbox do |vb|
|
||||
vb.customize ["modifyvm", :id, "--memory", "1024"]
|
||||
end
|
||||
scripts = [
|
||||
"bootstrap.sh",
|
||||
"db2.sh"
|
||||
]
|
||||
scripts.each { |script|
|
||||
db2.vm.provision :shell, privileged: false, :path => "scripts/vagrant/" << script
|
||||
}
|
||||
end
|
||||
|
||||
# TODO
|
||||
# Configure database box with Oracle XE
|
||||
# config.vm.define "oracle" do |oracle|
|
||||
# oracle.vm.provision "database", type: "shell" do |s|
|
||||
# s.inline = "echo Installing Oracle'"
|
||||
# end
|
||||
# end
|
||||
#
|
||||
|
||||
# Configure main SOCI development box with build essentials, OSS DBs
|
||||
config.vm.define "soci" do |soci|
|
||||
# Main SOCI development box with build essentials, FOSS DBs
|
||||
config.vm.define "soci", primary: true do |soci|
|
||||
soci.vm.hostname = "vmsoci"
|
||||
soci.vm.network "private_network", type: "dhcp"
|
||||
soci.vm.provider :virtualbox do |vb|
|
||||
@@ -65,4 +27,30 @@ Vagrant.configure(2) do |config|
|
||||
soci.vm.provision :shell, privileged: false, :path => "scripts/vagrant/" << script
|
||||
}
|
||||
end
|
||||
|
||||
# Database box with IBM DB2 Express-C
|
||||
config.vm.define "db2", autostart: false do |db2|
|
||||
db2.vm.hostname = "vmdb2"
|
||||
db2.vm.network "private_network", type: "dhcp"
|
||||
# Access to DB2 instance from host
|
||||
db2.vm.network :forwarded_port, host: 50000, guest: 50000
|
||||
db2.vm.provider :virtualbox do |vb|
|
||||
vb.customize ["modifyvm", :id, "--memory", "1024"]
|
||||
end
|
||||
scripts = [
|
||||
"bootstrap.sh",
|
||||
"db2.sh"
|
||||
]
|
||||
scripts.each { |script|
|
||||
db2.vm.provision :shell, privileged: false, :path => "scripts/vagrant/" << script
|
||||
}
|
||||
end
|
||||
|
||||
# Database box with Oracle XE
|
||||
# config.vm.define "oracle", autostart: false do |oracle|
|
||||
# oracle.vm.provision "database", type: "shell" do |s|
|
||||
# s.inline = "echo Installing Oracle'"
|
||||
# end
|
||||
# end
|
||||
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Installs DB2 CLI Driver 10.5 (64-bit and 32-bit) from
|
||||
# IBM Data Server Driver Package (DS Driver)
|
||||
|
||||
# Prerequisities:
|
||||
# Prerequisities (manual download if wget fails):
|
||||
# 1. Go to http://www-01.ibm.com/support/docview.wss?uid=swg21385217
|
||||
# 2. Go to "IBM Data Server Driver Package (DS Driver)"
|
||||
# 3. Download "IBM Data Server Driver Package (Linux AMD64 and Intel EM64T)"
|
||||
@@ -14,13 +14,20 @@ DSPREFIX=/opt/ibm
|
||||
DSDRIVER=${DSPREFIX}/dsdriver
|
||||
SOCITMP=/vagrant/tmp
|
||||
|
||||
# Try to download from known location
|
||||
wget https://raw.githubusercontent.com/rorymckinley/gold_importer/master/3rdparty/ibm_data_server_driver_package_linuxx64_v10.5.tar.gz
|
||||
|
||||
# Check if driver package is available
|
||||
if [ ! -f "${SOCITMP}/${DSPKG}" ]; then
|
||||
if [[ ! -f ${DSPKG} && ! -f ${SOCITMP}/${DSPKG} ]; then
|
||||
echo "DB2CLI: missing ${SOCITMP}/${DSPKG}"
|
||||
echo "DB2CLI: skipping driver installation"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f ${SOCITMP}/${DSPKG} ]; then
|
||||
DSPKG=${SOCITMP}/${DSPKG}
|
||||
fi
|
||||
|
||||
# If the drivers is already installed, skip re-installation
|
||||
# because installDSDriver script does not support it
|
||||
if [[ -d "${DSDRIVER}" && -f ${DSDRIVER}/db2profile ]]; then
|
||||
@@ -33,9 +40,9 @@ fi
|
||||
sudo apt-get -o Dpkg::Options::='--force-confnew' -y -q install \
|
||||
ksh
|
||||
|
||||
echo "DB2CLI: unpacking ${SOCITMP}/${DSPKG} to ${DSPREFIX}"
|
||||
echo "DB2CLI: unpacking ${DSPKG} to ${DSPREFIX}"
|
||||
sudo mkdir -p ${DSPREFIX}
|
||||
sudo tar -zxf ${SOCITMP}/${DSPKG} -C ${DSPREFIX}
|
||||
sudo tar -zxf ${DSPKG} -C ${DSPREFIX}
|
||||
echo "DB2CLI: running ${DSDRIVER}/installDSDriver script"
|
||||
sudo ${DSDRIVER}/installDSDriver
|
||||
echo "DB2CLI: cat ${DSDRIVER}/installDSDriver.log"
|
||||
|
||||
Reference in New Issue
Block a user