[mapguide-commits] r8597 - in trunk/Tools/Vagrant: centos/test_x64 centos/test_x86 scripts ubuntu ubuntu/test_x64 ubuntu/test_x86

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Mar 28 01:44:45 PDT 2015


Author: jng
Date: 2015-03-28 01:44:45 -0700 (Sat, 28 Mar 2015)
New Revision: 8597

Added:
   trunk/Tools/Vagrant/ubuntu/test_x64/
   trunk/Tools/Vagrant/ubuntu/test_x64/Vagrantfile
   trunk/Tools/Vagrant/ubuntu/test_x64/provision.sh
   trunk/Tools/Vagrant/ubuntu/test_x86/
   trunk/Tools/Vagrant/ubuntu/test_x86/Vagrantfile
   trunk/Tools/Vagrant/ubuntu/test_x86/provision.sh
Modified:
   trunk/Tools/Vagrant/centos/test_x64/provision.sh
   trunk/Tools/Vagrant/centos/test_x86/provision.sh
   trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
Log:
#2554: Add headless install option for Ubuntu install script
#2520: Vagrant environment updates
 - Add smoke test vagrantfiles for Ubuntu

Modified: trunk/Tools/Vagrant/centos/test_x64/provision.sh
===================================================================
--- trunk/Tools/Vagrant/centos/test_x64/provision.sh	2015-03-27 17:14:06 UTC (rev 8596)
+++ trunk/Tools/Vagrant/centos/test_x64/provision.sh	2015-03-28 08:44:45 UTC (rev 8597)
@@ -11,4 +11,6 @@
 chmod +x smoke_test.sh
 chmod +x mginstallcentos.sh
 sudo -E ./mginstallcentos.sh
+echo Wait 10s before running smoke test
+sleep 10s
 sudo -E ./smoke_test.sh
\ No newline at end of file

Modified: trunk/Tools/Vagrant/centos/test_x86/provision.sh
===================================================================
--- trunk/Tools/Vagrant/centos/test_x86/provision.sh	2015-03-27 17:14:06 UTC (rev 8596)
+++ trunk/Tools/Vagrant/centos/test_x86/provision.sh	2015-03-28 08:44:45 UTC (rev 8597)
@@ -11,4 +11,6 @@
 chmod +x smoke_test.sh
 chmod +x mginstallcentos.sh
 sudo -E ./mginstallcentos.sh
+echo Wait 10s before running smoke test
+sleep 10s
 sudo -E ./smoke_test.sh
\ No newline at end of file

Modified: trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	2015-03-27 17:14:06 UTC (rev 8596)
+++ trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	2015-03-28 08:44:45 UTC (rev 8597)
@@ -35,25 +35,124 @@
 httpd_port=8008
 tomcat_port=8009
 
+fdo_provider_choice=""
+
 # Must have root
 if [[ $EUID -ne 0 ]]; then
     echo "You must run this script with superuser privileges"
     exit 1
 fi
 
+while [ $# -gt 0 ]; do    # Until you run out of parameters...
+    case "$1" in
+        -headless|--headless)
+	    HEADLESS=1
+            #shift
+	    ;;
+        -with-sdf|--with-sdf)
+            fdo_provider_choice="$fdo_provider_choice sdf"
+            #shift
+            ;;
+        -with-shp|--with-shp)
+            fdo_provider_choice="$fdo_provider_choice shp"
+            #shift
+            ;;
+        -with-sqlite|--with-sqlite)
+            fdo_provider_choice="$fdo_provider_choice sqlite"
+            #shift
+            ;;
+        -with-gdal|--with-gdal)
+            fdo_provider_choice="$fdo_provider_choice gdal"
+            #shift
+            ;;
+        -with-ogr|--with-ogr)
+            fdo_provider_choice="$fdo_provider_choice ogr"
+            #shift
+            ;;
+        -with-kingoracle|--with-kingoracle)
+            fdo_provider_choice="$fdo_provider_choice kingoracle"
+            #shift
+            ;;
+        -with-wfs|--with-wfs)
+            fdo_provider_choice="$fdo_provider_choice wfs"
+            #shift
+            ;;
+        -with-wms|--with-wms)
+            fdo_provider_choice="$fdo_provider_choice wms"
+            #shift
+            ;;
+        -server-ip|--server-ip)
+            server_ip="$2"
+            webtier_server_ip="$2"
+            shift
+            ;;
+        -admin-port|--admin-port)
+            admin_port=$2
+            shift
+            ;;
+        -client-port|--client-port)
+            client_port=$2
+            shift
+            ;;
+        -site-port|--site-port)
+            site_port=$2
+            shift
+            ;;
+        -httpd-port|--httpd-port)
+            httpd_port=$2
+            shift
+            ;;
+        -tomcat-port|--tomcat-port)
+            tomcat_port=$2
+            shift
+            ;;
+        -help|--help)
+            echo "Usage: $0 (options)"
+            echo "Options:"
+            echo "  --headless [Install headlessly (skip UI)]"
+            echo "  --with-sdf [Include SDF Provider]"
+            echo "  --with-shp [Include SHP Provider]"
+            echo "  --with-sqlite [Include SQLite Provider]"
+            echo "  --with-gdal [Include GDAL Provider]"
+            echo "  --with-ogr [Include OGR Provider]"
+            echo "  --with-kingoracle [Include King Oracle Provider]"
+            echo "  --with-wfs [Include WFS Provider]"
+            echo "  --with-wms [Include WMS Provider]"
+            echo "  --server-ip [Server IP, default: 127.0.0.1]"
+            echo "  --admin-port [Admin Server Port, default: 2810]"
+            echo "  --client-port [Client Server Port, default: 2811]"
+            echo "  --site-port [Site Server Port, default: 2812]"
+            echo "  --httpd-port [HTTPD port, default: 8008]"
+            echo "  --tomcat-port [Tomcat Port, default: 8009]"
+            exit
+            ;;
+    esac
+    shift   # Check next set of parameters.
+done
+
+if [ "$HEADLESS" != "1" ]
+then
 # Install required packages 
 apt-get -y install dialog libexpat1 libssl1.0.0 odbcinst unixodbc libcurl3 libxslt1.1
+else
+# Install required packages 
+apt-get -y install libexpat1 libssl1.0.0 odbcinst unixodbc libcurl3 libxslt1.1
+fi
 
 DIALOG=${DIALOG=dialog}
 
 main()
 {
-    dialog_welcome
-    dialog_fdo_provider
-    dialog_server
-    dialog_webtier
-    #dialog_coordsys
-    #dump_configuration
+    if [ "$HEADLESS" != "1" ]
+    then
+        dialog_welcome
+        dialog_fdo_provider
+        dialog_server
+        dialog_webtier
+        #dialog_coordsys
+    else
+        dump_configuration
+    fi
     install_fdo
     install_mapguide_packages
     post_install

Added: trunk/Tools/Vagrant/ubuntu/test_x64/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/test_x64/Vagrantfile	                        (rev 0)
+++ trunk/Tools/Vagrant/ubuntu/test_x64/Vagrantfile	2015-03-28 08:44:45 UTC (rev 8597)
@@ -0,0 +1,123 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  # All Vagrant configuration is done here. The most common configuration
+  # options are documented and commented below. For a complete reference,
+  # please see the online documentation at vagrantup.com.
+
+  # Every Vagrant virtual environment requires a box to build off of.
+  config.vm.box = "ubuntu12-amd64"
+
+  # The url from where the 'config.vm.box' box will be fetched if it
+  # doesn't already exist on the user's system.
+  # config.vm.box_url = "http://domain.com/path/to/above.box"
+
+  # Create a forwarded port mapping which allows access to a specific port
+  # within the machine from a port on the host machine. In the example below,
+  # accessing "localhost:8080" will access port 80 on the guest machine.
+  # config.vm.network :forwarded_port, guest: 80, host: 8080
+
+  # Create a private network, which allows host-only access to the machine
+  # using a specific IP.
+  # config.vm.network :private_network, ip: "192.168.33.10"
+
+  # Create a public network, which generally matched to bridged network.
+  # Bridged networks make the machine appear as another physical device on
+  # your network.
+  # config.vm.network :public_network
+
+  # If true, then any SSH connections made will enable agent forwarding.
+  # Default value: false
+  # config.ssh.forward_agent = true
+
+  # Share an additional folder to the guest VM. The first argument is
+  # the path on the host to the actual folder. The second argument is
+  # the path on the guest to mount the folder. And the optional third
+  # argument is a set of non-required options.
+  config.vm.synced_folder "../../sources", "/mapguide_sources"
+
+  # Provider-specific configuration so you can fine-tune various
+  # backing providers for Vagrant. These expose provider-specific options.
+  # Example for VirtualBox:
+  #
+  # config.vm.provider :virtualbox do |vb|
+  #   # Don't boot with headless mode
+  #   vb.gui = true
+  #
+  #   # Use VBoxManage to customize the VM. For example to change memory:
+  #   vb.customize ["modifyvm", :id, "--memory", "1024"]
+  # end
+  #
+  # View the documentation for the provider you're using for more
+  # information on available options.
+
+  # Enable provisioning with Puppet stand alone.  Puppet manifests
+  # are contained in a directory path relative to this Vagrantfile.
+  # You will need to create the manifests directory and a manifest in
+  # the file vagrant-mapguide-ubuntu-precise32.pp in the manifests_path directory.
+  #
+  # An example Puppet manifest to provision the message of the day:
+  #
+  # # group { "puppet":
+  # #   ensure => "present",
+  # # }
+  # #
+  # # File { owner => 0, group => 0, mode => 0644 }
+  # #
+  # # file { '/etc/motd':
+  # #   content => "Welcome to your Vagrant-built virtual machine!
+  # #               Managed by Puppet.\n"
+  # # }
+  #
+  # config.vm.provision :puppet do |puppet|
+  #   puppet.manifests_path = "manifests"
+  #   puppet.manifest_file  = "site.pp"
+  # end
+
+  # Enable provisioning with chef solo, specifying a cookbooks path, roles
+  # path, and data_bags path (all relative to this Vagrantfile), and adding
+  # some recipes and/or roles.
+  #
+  # config.vm.provision :chef_solo do |chef|
+  #   chef.cookbooks_path = "../my-recipes/cookbooks"
+  #   chef.roles_path = "../my-recipes/roles"
+  #   chef.data_bags_path = "../my-recipes/data_bags"
+  #   chef.add_recipe "mysql"
+  #   chef.add_role "web"
+  #
+  #   # You may also specify custom JSON attributes:
+  #   chef.json = { :mysql_password => "foo" }
+  # end
+
+  # Enable provisioning with chef server, specifying the chef server URL,
+  # and the path to the validation key (relative to this Vagrantfile).
+  #
+  # The Opscode Platform uses HTTPS. Substitute your organization for
+  # ORGNAME in the URL and validation key.
+  #
+  # If you have your own Chef Server, use the appropriate URL, which may be
+  # HTTP instead of HTTPS depending on your configuration. Also change the
+  # validation key to validation.pem.
+  #
+  # config.vm.provision :chef_client do |chef|
+  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
+  #   chef.validation_key_path = "ORGNAME-validator.pem"
+  # end
+  #
+  # If you're using the Opscode platform, your validator client is
+  # ORGNAME-validator, replacing ORGNAME with your organization name.
+  #
+  # If you have your own Chef Server, the default validation client name is
+  # chef-validator, unless you changed the configuration.
+  #
+  #   chef.validation_client_name = "ORGNAME-validator"
+  
+  config.vm.provision "shell",
+    privileged: false,
+    path: "provision.sh",
+    args: "#{ENV['DOWNLOAD_HOST']}"
+end

Added: trunk/Tools/Vagrant/ubuntu/test_x64/provision.sh
===================================================================
--- trunk/Tools/Vagrant/ubuntu/test_x64/provision.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/ubuntu/test_x64/provision.sh	2015-03-28 08:44:45 UTC (rev 8597)
@@ -0,0 +1,15 @@
+#!/bin/bash
+DOWNLOAD_HOST=$1
+echo Download host is: $DOWNLOAD_HOST
+wget "http://$DOWNLOAD_HOST/builds/Sheboygan.mgp"
+wget "http://$DOWNLOAD_HOST/builds/smoke_test.sh"
+sudo mv Sheboygan.mgp /tmp/
+wget "http://$DOWNLOAD_HOST/builds/ubuntu_x64/mginstallubuntu.sh"
+sed -i 's/URL="http:\/\/download/URL_OLD="http:\/\/download/g' mginstallubuntu.sh
+sed -i 's/#URL="http:\/\/192.168.0.5\/downloads\/ubuntu12"/URL="http:\/\/'"$DOWNLOAD_HOST"'\/builds\/ubuntu_x64"/g' mginstallubuntu.sh
+chmod +x smoke_test.sh
+chmod +x mginstallubuntu.sh
+sudo ./mginstallubuntu.sh --headless --with-sdf --with-shp --with-ogr --with-gdal --with-sqlite
+echo Wait 10s before running smoke test
+sleep 10s
+sudo ./smoke_test.sh
\ No newline at end of file

Added: trunk/Tools/Vagrant/ubuntu/test_x86/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/test_x86/Vagrantfile	                        (rev 0)
+++ trunk/Tools/Vagrant/ubuntu/test_x86/Vagrantfile	2015-03-28 08:44:45 UTC (rev 8597)
@@ -0,0 +1,123 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  # All Vagrant configuration is done here. The most common configuration
+  # options are documented and commented below. For a complete reference,
+  # please see the online documentation at vagrantup.com.
+
+  # Every Vagrant virtual environment requires a box to build off of.
+  config.vm.box = "ubuntu12-i386"
+
+  # The url from where the 'config.vm.box' box will be fetched if it
+  # doesn't already exist on the user's system.
+  # config.vm.box_url = "http://domain.com/path/to/above.box"
+
+  # Create a forwarded port mapping which allows access to a specific port
+  # within the machine from a port on the host machine. In the example below,
+  # accessing "localhost:8080" will access port 80 on the guest machine.
+  # config.vm.network :forwarded_port, guest: 80, host: 8080
+
+  # Create a private network, which allows host-only access to the machine
+  # using a specific IP.
+  # config.vm.network :private_network, ip: "192.168.33.10"
+
+  # Create a public network, which generally matched to bridged network.
+  # Bridged networks make the machine appear as another physical device on
+  # your network.
+  # config.vm.network :public_network
+
+  # If true, then any SSH connections made will enable agent forwarding.
+  # Default value: false
+  # config.ssh.forward_agent = true
+
+  # Share an additional folder to the guest VM. The first argument is
+  # the path on the host to the actual folder. The second argument is
+  # the path on the guest to mount the folder. And the optional third
+  # argument is a set of non-required options.
+  config.vm.synced_folder "../../sources", "/mapguide_sources"
+
+  # Provider-specific configuration so you can fine-tune various
+  # backing providers for Vagrant. These expose provider-specific options.
+  # Example for VirtualBox:
+  #
+  # config.vm.provider :virtualbox do |vb|
+  #   # Don't boot with headless mode
+  #   vb.gui = true
+  #
+  #   # Use VBoxManage to customize the VM. For example to change memory:
+  #   vb.customize ["modifyvm", :id, "--memory", "1024"]
+  # end
+  #
+  # View the documentation for the provider you're using for more
+  # information on available options.
+
+  # Enable provisioning with Puppet stand alone.  Puppet manifests
+  # are contained in a directory path relative to this Vagrantfile.
+  # You will need to create the manifests directory and a manifest in
+  # the file vagrant-mapguide-ubuntu-precise32.pp in the manifests_path directory.
+  #
+  # An example Puppet manifest to provision the message of the day:
+  #
+  # # group { "puppet":
+  # #   ensure => "present",
+  # # }
+  # #
+  # # File { owner => 0, group => 0, mode => 0644 }
+  # #
+  # # file { '/etc/motd':
+  # #   content => "Welcome to your Vagrant-built virtual machine!
+  # #               Managed by Puppet.\n"
+  # # }
+  #
+  # config.vm.provision :puppet do |puppet|
+  #   puppet.manifests_path = "manifests"
+  #   puppet.manifest_file  = "site.pp"
+  # end
+
+  # Enable provisioning with chef solo, specifying a cookbooks path, roles
+  # path, and data_bags path (all relative to this Vagrantfile), and adding
+  # some recipes and/or roles.
+  #
+  # config.vm.provision :chef_solo do |chef|
+  #   chef.cookbooks_path = "../my-recipes/cookbooks"
+  #   chef.roles_path = "../my-recipes/roles"
+  #   chef.data_bags_path = "../my-recipes/data_bags"
+  #   chef.add_recipe "mysql"
+  #   chef.add_role "web"
+  #
+  #   # You may also specify custom JSON attributes:
+  #   chef.json = { :mysql_password => "foo" }
+  # end
+
+  # Enable provisioning with chef server, specifying the chef server URL,
+  # and the path to the validation key (relative to this Vagrantfile).
+  #
+  # The Opscode Platform uses HTTPS. Substitute your organization for
+  # ORGNAME in the URL and validation key.
+  #
+  # If you have your own Chef Server, use the appropriate URL, which may be
+  # HTTP instead of HTTPS depending on your configuration. Also change the
+  # validation key to validation.pem.
+  #
+  # config.vm.provision :chef_client do |chef|
+  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
+  #   chef.validation_key_path = "ORGNAME-validator.pem"
+  # end
+  #
+  # If you're using the Opscode platform, your validator client is
+  # ORGNAME-validator, replacing ORGNAME with your organization name.
+  #
+  # If you have your own Chef Server, the default validation client name is
+  # chef-validator, unless you changed the configuration.
+  #
+  #   chef.validation_client_name = "ORGNAME-validator"
+  
+  config.vm.provision "shell",
+    privileged: false,
+    path: "provision.sh",
+    args: "#{ENV['DOWNLOAD_HOST']}"
+end

Added: trunk/Tools/Vagrant/ubuntu/test_x86/provision.sh
===================================================================
--- trunk/Tools/Vagrant/ubuntu/test_x86/provision.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/ubuntu/test_x86/provision.sh	2015-03-28 08:44:45 UTC (rev 8597)
@@ -0,0 +1,15 @@
+#!/bin/bash
+DOWNLOAD_HOST=$1
+echo Download host is: $DOWNLOAD_HOST
+wget "http://$DOWNLOAD_HOST/builds/Sheboygan.mgp"
+wget "http://$DOWNLOAD_HOST/builds/smoke_test.sh"
+sudo mv Sheboygan.mgp /tmp/
+wget "http://$DOWNLOAD_HOST/builds/ubuntu_x86/mginstallubuntu.sh"
+sed -i 's/URL="http:\/\/download/URL_OLD="http:\/\/download/g' mginstallubuntu.sh
+sed -i 's/#URL="http:\/\/192.168.0.5\/downloads\/ubuntu12"/URL="http:\/\/'"$DOWNLOAD_HOST"'\/builds\/ubuntu_x86"/g' mginstallubuntu.sh
+chmod +x smoke_test.sh
+chmod +x mginstallubuntu.sh
+sudo ./mginstallubuntu.sh --headless --with-sdf --with-shp --with-ogr --with-gdal --with-sqlite
+echo Wait 10s before running smoke test
+sleep 10s
+sudo ./smoke_test.sh
\ No newline at end of file



More information about the mapguide-commits mailing list