Skip to content

Commit 6b95311

Browse files
committed
[Vagrant] Update setup with primary VM and optionals.
Add URL of db2cli driver package, download and install automatically without manual intervention. [ci skip]
1 parent 4cb3b63 commit 6b95311

File tree

2 files changed

+37
-42
lines changed

2 files changed

+37
-42
lines changed

Vagrantfile

+26-38
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,33 @@
33

44
# Vagrant virtual development environments for SOCI
55

6-
# All Vagrant configuration is done below.
7-
# The "2" in Vagrant.configure configures the configuration version.
8-
# Please don't change it unless you know what you're doing.
96
Vagrant.configure(2) do |config|
10-
# The most common configuration options are documented and commented below.
11-
# For a complete reference, please see the online documentation at
12-
# https://docs.vagrantup.com.
13-
14-
# Every Vagrant development environment requires a box. You can search for
15-
# boxes at https://atlas.hashicorp.com/search.
16-
config.vm.box = "ubuntu/trusty64"
17-
18-
# Enable automatic box update checking.
7+
config.vm.box = "bento/ubuntu-14.04"
198
config.vm.box_check_update = true
209

21-
# Configure database box with IBM DB2 Express-C
22-
config.vm.define "db2" do |db2|
10+
# Main SOCI development box with build essentials, FOSS DBs
11+
config.vm.define "soci", primary: true do |soci|
12+
soci.vm.hostname = "vmsoci"
13+
soci.vm.network "private_network", type: "dhcp"
14+
soci.vm.provider :virtualbox do |vb|
15+
vb.customize ["modifyvm", :id, "--memory", "1024"]
16+
end
17+
scripts = [
18+
"bootstrap.sh",
19+
"devel.sh",
20+
"db2cli.sh",
21+
"firebird.sh",
22+
"mysql.sh",
23+
"postgresql.sh",
24+
"build.sh"
25+
]
26+
scripts.each { |script|
27+
soci.vm.provision :shell, privileged: false, :path => "scripts/vagrant/" << script
28+
}
29+
end
30+
31+
# Database box with IBM DB2 Express-C
32+
config.vm.define "db2", autostart: false do |db2|
2333
db2.vm.hostname = "vmdb2"
2434
db2.vm.network "private_network", type: "dhcp"
2535
# Access to DB2 instance from host
@@ -36,33 +46,11 @@ Vagrant.configure(2) do |config|
3646
}
3747
end
3848

39-
# TODO
40-
# Configure database box with Oracle XE
41-
# config.vm.define "oracle" do |oracle|
49+
# Database box with Oracle XE
50+
# config.vm.define "oracle", autostart: false do |oracle|
4251
# oracle.vm.provision "database", type: "shell" do |s|
4352
# s.inline = "echo Installing Oracle'"
4453
# end
4554
# end
46-
#
4755

48-
# Configure main SOCI development box with build essentials, OSS DBs
49-
config.vm.define "soci" do |soci|
50-
soci.vm.hostname = "vmsoci"
51-
soci.vm.network "private_network", type: "dhcp"
52-
soci.vm.provider :virtualbox do |vb|
53-
vb.customize ["modifyvm", :id, "--memory", "1024"]
54-
end
55-
scripts = [
56-
"bootstrap.sh",
57-
"devel.sh",
58-
"db2cli.sh",
59-
"firebird.sh",
60-
"mysql.sh",
61-
"postgresql.sh",
62-
"build.sh"
63-
]
64-
scripts.each { |script|
65-
soci.vm.provision :shell, privileged: false, :path => "scripts/vagrant/" << script
66-
}
67-
end
6856
end

scripts/vagrant/db2cli.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Installs DB2 CLI Driver 10.5 (64-bit and 32-bit) from
55
# IBM Data Server Driver Package (DS Driver)
66

7-
# Prerequisities:
7+
# Prerequisities (manual download if wget fails):
88
# 1. Go to http://www-01.ibm.com/support/docview.wss?uid=swg21385217
99
# 2. Go to "IBM Data Server Driver Package (DS Driver)"
1010
# 3. Download "IBM Data Server Driver Package (Linux AMD64 and Intel EM64T)"
@@ -14,13 +14,20 @@ DSPREFIX=/opt/ibm
1414
DSDRIVER=${DSPREFIX}/dsdriver
1515
SOCITMP=/vagrant/tmp
1616

17+
# Try to download from known location
18+
wget https://raw.githubusercontent.com/rorymckinley/gold_importer/master/3rdparty/ibm_data_server_driver_package_linuxx64_v10.5.tar.gz
19+
1720
# Check if driver package is available
18-
if [ ! -f "${SOCITMP}/${DSPKG}" ]; then
21+
if [[ ! -f ${DSPKG} && ! -f ${SOCITMP}/${DSPKG} ]; then
1922
echo "DB2CLI: missing ${SOCITMP}/${DSPKG}"
2023
echo "DB2CLI: skipping driver installation"
2124
exit 0
2225
fi
2326

27+
if [ -f ${SOCITMP}/${DSPKG} ]; then
28+
DSPKG=${SOCITMP}/${DSPKG}
29+
fi
30+
2431
# If the drivers is already installed, skip re-installation
2532
# because installDSDriver script does not support it
2633
if [[ -d "${DSDRIVER}" && -f ${DSDRIVER}/db2profile ]]; then
@@ -33,9 +40,9 @@ fi
3340
sudo apt-get -o Dpkg::Options::='--force-confnew' -y -q install \
3441
ksh
3542

36-
echo "DB2CLI: unpacking ${SOCITMP}/${DSPKG} to ${DSPREFIX}"
43+
echo "DB2CLI: unpacking ${DSPKG} to ${DSPREFIX}"
3744
sudo mkdir -p ${DSPREFIX}
38-
sudo tar -zxf ${SOCITMP}/${DSPKG} -C ${DSPREFIX}
45+
sudo tar -zxf ${DSPKG} -C ${DSPREFIX}
3946
echo "DB2CLI: running ${DSDRIVER}/installDSDriver script"
4047
sudo ${DSDRIVER}/installDSDriver
4148
echo "DB2CLI: cat ${DSDRIVER}/installDSDriver.log"

0 commit comments

Comments
 (0)