[mapguide-commits] r8946 - trunk/Tools/Vagrant

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 10 05:11:10 PDT 2016


Author: jng
Date: 2016-05-10 05:11:09 -0700 (Tue, 10 May 2016)
New Revision: 8946

Added:
   trunk/Tools/Vagrant/update_sources.bat
Removed:
   trunk/Tools/Vagrant/build.bat
Modified:
   trunk/Tools/Vagrant/README.txt
Log:
Rename build.bat to update_sources.bat. This file now only contains the source tarball updating part of the original file, as the build VM provisioning logic has been moved to build_target.bat, which now also has the nice side-effect of being able to run multiple build_target.bat instances in parallel for different distro/target configurations given sufficient computing grunt to pull it off, whereas the old build.bat had to do this sequentially.

Also update README.txt to reflect these changes.

Modified: trunk/Tools/Vagrant/README.txt
===================================================================
--- trunk/Tools/Vagrant/README.txt	2016-05-10 11:49:21 UTC (rev 8945)
+++ trunk/Tools/Vagrant/README.txt	2016-05-10 12:11:09 UTC (rev 8946)
@@ -23,6 +23,8 @@
  * CentOS 6.5 64-bit
  * Ubuntu 12.04 32-bit
  * Ubuntu 12.04 64-bit
+ * Ubuntu 14.04 32-bit
+ * Ubuntu 14.04 64-bit
 
 These boxes will also be registered in vagrant as:
 
@@ -30,37 +32,68 @@
  * centos6-amd64
  * ubuntu12-i386
  * ubuntu12-amd64
+ * ubuntu14-i386
+ * ubuntu14-amd64
 
+Which you can confirm by running 'vagrant box list' from the command line
+
 Building MapGuide and FDO
 =========================
 
-Run build.bat, this will build MapGuide and FDO for:
+Building MapGuide and FDO requires you have source tarballs for MapGuide/FDO under the sources directory. See sources\README.txt for
+more information about the expected layout and naming conventions of the tarballs.
 
- * CentOS 6.5 32-bit
- * CentOS 6.5 64-bit
- * Ubuntu 12.04 32-bit
- * Ubuntu 12.04 64-bit
+Run build_target.bat with the following parameters:
 
-If MG_SVN_UPDATE_SOURCES is set to 1 before running build.bat, a special CentOS VM will be spun up to svn update the MapGuide and FDO source
-tarballs to the latest revisions. Otherwise, the existing source tarballs will be built at their last updated svn revision.
+ * -distro
+   * Build MapGuide/FDO for the given distro
+   * Valid values include:
+     * centos6
+     * ubuntu12
+     * ubuntu14
+ * -target
+   * Build MapGuide/FDO for the given distro using the given CPU configuration
+   * Valid values include:
+     * x86
+     * x64
+ * -ext
+   * The file extension of the build artifacts to collect from the vagrant VM's build output directory
+   * Valid values include"
+     * deb (for Ubuntu-based builds)
+     * tar.xz (for non-Ubuntu builds)
+ * -teardown
+   * Indicates whether to automatically tear down the VM once the build has completed.
+   * Set to 1 or 0
 
+For the rest of this section:
+ * $distro refers to the parameter you supplied for -distro
+ * $target refers to the parameter you supplied for -target 
+
+This will build MapGuide/FDO with the existing source tarballs at their last updated svn revision. It will spin up a build VM 
+using the vagrantfile located under the $distro\$target directory.
+
+If you have the computing grunt, you can run multiple build_target.bat instances for different distro/target configurations in parallel. 
+
 When each build completes, the build artifacts and assorted log files and unit test result XML files will be copied to these directories:
 
- * builds/centos_x86
- * builds/centos_x86/logs
- * builds/centos_x64
- * builds/centos_x64/logs
- * builds/ubuntu_x86
- * builds/ubuntu_x86/logs
- * builds/ubuntu_x64
- * builds/ubuntu_x64/logs
+ * builds/$distro_$target
+ * builds/$distro_$target/logs
 
-For CentOS, the build will produce tarballs of FDO and MapGuide along with the necessary install scripts
-For Ubuntu, the build will produce debian package files of FDO and MapGuide along with the necessary install scripts
+For Ubuntu builds, the build will produce debian package files (*.deb) of FDO and MapGuide along with the necessary install scripts
+For non-Ubuntu builds, the build will produce xz-compressed tarballs (*.tar.xz) of FDO and MapGuide along with the necessary install scripts
 
-At the end of the run, updated MapGuide and FDO source tarballs will be in sources/updated. You can move these tarballs up one level and
-overwrite the existing copies to ensure you have the most updated checkouts for the next build run.
+Updating MapGuide/FDO sources
+=============================
 
+Run update_sources.bat to update the MapGuide/FDO tarballs under the sources directory to the HEAD revisions of their respective branches.
+
+This will spin up a special centos6 VM to:
+
+ 1. Extract the MapGuide/FDO tarballs
+ 2. svn update the extracted working directories
+ 3. Re-package the working directories into new tarballs
+ 4. Overwrite the old tarballs under sources directories with the updated copies 
+
 Troubleshooting
 ===============
 
@@ -71,9 +104,6 @@
 
 When doing branched releases, the following files have to be modified and their respective MapGuide and FDO versions and branch names updated to match:
 
- - centos\x64\Vagrantfile
- - centos\x86\Vagrantfile
- - ubuntu\x64\Vagrantfile
- - ubuntu\x86\Vagrantfile
+ - $distro\$arch\Vagrantfile
  - scripts\mapguidecommon_excludes.txt
  - scripts\platformbase_excludes.txt

Deleted: trunk/Tools/Vagrant/build.bat
===================================================================
--- trunk/Tools/Vagrant/build.bat	2016-05-10 11:49:21 UTC (rev 8945)
+++ trunk/Tools/Vagrant/build.bat	2016-05-10 12:11:09 UTC (rev 8946)
@@ -1,209 +0,0 @@
- at echo off
-
-rem build.bat
-rem
-rem Builds MapGuide/FDO in CentOS and Ubuntu VMs all driven by vagrant
-rem
-rem NOTE: CentOS builds must *always* precede the Ubuntu builds as Ubuntu builds may depend
-rem on the package FDO SDK tarball produced by the CentOS build
-rem
-rem Requires the tee utility, which is part of GNU on Windows (https://github.com/bmatzelle/gow)
-
-IF "%MG_SVN_UPDATE_SOURCES%"=="" SET MG_SVN_UPDATE_SOURCES=1
-IF "%BUILD_UBUNTU_32%"=="" SET BUILD_UBUNTU_32=1
-IF "%BUILD_UBUNTU_64%"=="" SET BUILD_UBUNTU_64=1
-IF "%BUILD_CENTOS_32%"=="" SET BUILD_CENTOS_32=1
-IF "%BUILD_CENTOS_64%"=="" SET BUILD_CENTOS_64=1
-IF "%TEARDOWN_UBUNTU_32%"=="" SET TEARDOWN_UBUNTU_32=1
-IF "%TEARDOWN_UBUNTU_64%"=="" SET TEARDOWN_UBUNTU_64=1
-IF "%TEARDOWN_CENTOS_32%"=="" SET TEARDOWN_CENTOS_32=1
-IF "%TEARDOWN_CENTOS_64%"=="" SET TEARDOWN_CENTOS_64=1
-SET ROOT=%CD%
-SET COMPONENT=
-echo **************** Build Summary *********************
-echo Update Sources: %MG_SVN_UPDATE_SOURCES%
-echo Building Ubuntu (32-bit): %BUILD_UBUNTU_32% (teardown=%TEARDOWN_UBUNTU_32%)
-echo Building Ubuntu (64-bit): %BUILD_UBUNTU_64% (teardown=%TEARDOWN_UBUNTU_64%)
-echo Building CentOS (32-bit): %BUILD_CENTOS_32% (teardown=%TEARDOWN_CENTOS_32%)
-echo Building CentOS (64-bit): %BUILD_CENTOS_64% (teardown=%TEARDOWN_CENTOS_64%)
-echo ****************************************************
-:prepare
-echo [build]: Prepare scripts for provisioning
-copy /Y scripts\svn_update.sh %ROOT%\centos\src_update
-if %BUILD_CENTOS_32% == 1 xcopy /S /Y /I scripts\* %ROOT%\centos\x86
-if %BUILD_UBUNTU_32% == 1 xcopy /S /Y /I scripts\* %ROOT%\ubuntu\x86
-if %BUILD_CENTOS_64% == 1 xcopy /S /Y /I scripts\* %ROOT%\centos\x64
-if %BUILD_UBUNTU_64% == 1 xcopy /S /Y /I scripts\* %ROOT%\ubuntu\x64
-echo [build]: Prepare build artifact location
-if not exist builds mkdir builds
-if not exist builds\centos_x86 mkdir builds\centos_x86
-if not exist builds\centos_x64 mkdir builds\centos_x64
-if not exist builds\ubuntu_x86 mkdir builds\ubuntu_x86
-if not exist builds\ubuntu_x64 mkdir builds\ubuntu_x64
-if not exist builds\centos_x86\logs mkdir builds\centos_x86\logs
-if not exist builds\centos_x64\logs mkdir builds\centos_x64\logs
-if not exist builds\ubuntu_x86\logs mkdir builds\ubuntu_x86\logs
-if not exist builds\ubuntu_x64\logs mkdir builds\ubuntu_x64\logs
-echo [build]: Checking if we're updating sources
-if %MG_SVN_UPDATE_SOURCES% == 1 goto update_sources
-goto check_centos_32
-:update_sources
-SET COMPONENT=Update MapGuide and FDO tarballs
-pushd sources
-if exist updated rd /S /Q updated
-popd
-pushd centos\src_update
-call vagrant up 2>&1 | tee up.log
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-call vagrant destroy -f
-popd
-pushd sources\updated
-move /Y *.tar.gz ..
-echo [build]: Sources updated
-popd
-:check_centos_32
-echo [build]: Checking if we're building for CentOS 32-bit
-if %BUILD_CENTOS_32% == 1 goto build_centos_32
-goto check_ubuntu_32
-:build_centos_32
-pushd centos\x86
-SET COMPONENT=CentOS Build 32-bit
-echo [build]: MapGuide CentOS build 32-bit
-if exist build rd /S /Q build
-call vagrant up 2>&1 | tee up.log
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-if not exist build\*.tar.xz goto error
-echo [build]: Move artifacts to build output
-move /Y build\*.sh %ROOT%\builds\centos_x86
-move /Y build\*.tar.xz %ROOT%\builds\centos_x86
-move /Y build\*.log %ROOT%\builds\centos_x86\logs
-move /Y build\*.xml %ROOT%\builds\centos_x86\logs
-echo [build]: Generate MD5 hashes
-pushd %ROOT%\builds\centos_x86
-if exist md5sums.txt del md5sums.txt
-md5sum *.sh > md5sums.txt
-md5sum *.tar.xz >> md5sums.txt
-popd
-if %TEARDOWN_CENTOS_32% == 1 (
-    echo [build]: Tearing down CentOS 32 VM
-    goto destroy_centos_32
-) else (
-    echo [build]: Not tearing down CentOS 32 VM
-    goto centos_32_done
-)
-:destroy_centos_32
-call vagrant destroy -f
-:centos_32_done
-popd
-:check_ubuntu_32
-echo [build]: Checking if we're building for Ubuntu 32-bit
-if %BUILD_UBUNTU_32% == 1 goto build_ubuntu_32
-goto check_centos_64
-:build_ubuntu_32
-pushd ubuntu\x86
-SET COMPONENT=Ubuntu Build 32-bit
-echo [build]: MapGuide Ubuntu build 32-bit
-if exist build rd /S /Q build
-call vagrant up 2>&1 | tee up.log
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-if not exist build\*.deb goto error
-echo [build]: Move artifacts to build output
-move /Y build\*.sh %ROOT%\builds\ubuntu_x86
-move /Y build\*.deb %ROOT%\builds\ubuntu_x86
-move /Y build\*.log %ROOT%\builds\ubuntu_x86\logs
-move /Y build\*.xml %ROOT%\builds\ubuntu_x86\logs
-echo [build]: Generate MD5 hashes
-pushd %ROOT%\builds\ubuntu_x86
-if exist md5sums.txt del md5sums.txt
-md5sum *.sh > md5sums.txt
-md5sum *.deb >> md5sums.txt
-popd
-if %TEARDOWN_UBUNTU_32% == 1 (
-    echo [build]: Tearing down Ubuntu 32 VM
-    goto destroy_ubuntu_32
-) else (
-    echo [build]: Not tearing down Ubuntu 32 VM
-    goto ubuntu_32_done
-)
-:destroy_ubuntu_32
-call vagrant destroy -f
-:ubuntu_32_done
-popd
-:check_centos_64
-echo [build]: Checking if we're building for CentOS 64-bit
-if %BUILD_CENTOS_64% == 1 goto build_centos_64
-goto check_ubuntu_64
-:build_centos_64
-pushd centos\x64
-SET COMPONENT=CentOS Build 64-bit
-echo [build]: MapGuide CentOS build 64-bit
-if exist build rd /S /Q build
-call vagrant up 2>&1 | tee up.log
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-if not exist build\*.tar.xz goto error
-echo [build]: Move artifacts to build output
-move /Y build\*.sh %ROOT%\builds\centos_x64
-move /Y build\*.tar.xz %ROOT%\builds\centos_x64
-move /Y build\*.log %ROOT%\builds\centos_x64\logs
-move /Y build\*.xml %ROOT%\builds\centos_x64\logs
-echo [build]: Generate MD5 hashes
-pushd %ROOT%\builds\centos_x64
-if exist md5sums.txt del md5sums.txt
-md5sum *.sh > md5sums.txt
-md5sum *.tar.xz >> md5sums.txt
-popd
-if %TEARDOWN_CENTOS_64% == 1 (
-    echo [build]: Tearing down CentOS 64 VM
-    goto destroy_centos_64
-) else (
-    echo [build]: Not tearing down CentOS 64 VM
-    goto centos_64_done
-)
-:destroy_centos_64
-call vagrant destroy -f
-:centos_64_done
-popd
-:check_ubuntu_64
-echo [build]: Checking if we're building for Ubuntu 64-bit
-if %BUILD_UBUNTU_64% == 1 goto build_ubuntu_64
-goto quit
-:build_ubuntu_64
-pushd ubuntu\x64
-SET COMPONENT=Ubuntu Build 64-bit
-echo [build]: MapGuide Ubuntu build 64-bit
-if exist build rd /S /Q build
-call vagrant up 2>&1 | tee up.log
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-if not exist build\*.deb goto error
-echo [build]: Move artifacts to build output
-move /Y build\*.sh %ROOT%\builds\ubuntu_x64
-move /Y build\*.deb %ROOT%\builds\ubuntu_x64
-move /Y build\*.log %ROOT%\builds\ubuntu_x64\logs
-move /Y build\*.xml %ROOT%\builds\ubuntu_x64\logs
-echo [build]: Generate MD5 hashes
-pushd %ROOT%\builds\ubuntu_x64
-if exist md5sums.txt del md5sums.txt
-md5sum *.sh > md5sums.txt
-md5sum *.deb >> md5sums.txt
-popd
-if %TEARDOWN_UBUNTU_64% == 1 (
-    echo [build]: Tearing down Ubuntu 64 VM
-    goto destroy_ubuntu_64
-) else (
-    echo [build]: Not tearing down Ubuntu 64 VM
-    goto ubuntu_64_done
-)
-:destroy_ubuntu_64
-call vagrant destroy -f
-:ubuntu_64_done
-popd
-goto quit
-:error
-echo [ERROR]: There was an error building the component %COMPONENT%
-exit /B 1
-:quit
\ No newline at end of file

Copied: trunk/Tools/Vagrant/update_sources.bat (from rev 8944, trunk/Tools/Vagrant/build.bat)
===================================================================
--- trunk/Tools/Vagrant/update_sources.bat	                        (rev 0)
+++ trunk/Tools/Vagrant/update_sources.bat	2016-05-10 12:11:09 UTC (rev 8946)
@@ -0,0 +1,19 @@
+ at echo off
+
+rem update_sources.bat
+rem
+rem Updates MapGuide/FDO source tarballs via the src_update centos6 VM
+pushd sources
+if exist updated rd /S /Q updated
+popd
+copy /Y scripts\svn_update.sh centos6\src_update
+pushd centos6\src_update
+call vagrant up 2>&1 | tee up.log
+echo [src_update]: vagrant returned %errorlevel%
+if "%errorlevel%"=="1" goto error
+call vagrant destroy -f
+popd
+pushd sources\updated
+move /Y *.tar.gz ..
+echo [src_update]: Sources updated
+popd
\ No newline at end of file



More information about the mapguide-commits mailing list