diff --git a/Npgsql/build-windows.sh b/Npgsql/build-windows.sh index be7a534d7..2b1834c16 100644 --- a/Npgsql/build-windows.sh +++ b/Npgsql/build-windows.sh @@ -49,7 +49,7 @@ _prep_Npgsql_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Npgsql.zip del /S /Q Npgsql.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Npgsql.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Npgsql.windows rd /S /Q Npgsql.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Npgsql.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Npgsql.staging rd /S /Q Npgsql.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Npgsql.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Npgsql.staging.build rd /S /Q Npgsql.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Npgsql.staging.build directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST npgsql-staging.zip del /S /Q npgsql-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\npgsql-staging.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-Npgsql.bat del /S /Q build-Npgsql.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-Npgsql.bat on Windows VM" @@ -97,17 +97,18 @@ EOT ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c $PG_PATH_WINDOWS\\\\build-Npgsql.bat Npgsql.sln Release $PLATFORM_TOOLSET" || _die "Failed to build npgsql on the windows build host" # We need to copy them to staging directory - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Npgsql.staging/bin" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Npgsql.windows/src/Npgsql/bin/Release/* $PG_PATH_WINDOWS/Npgsql.staging/bin" || _die "Failed to copy Npgsql binary to staging directory" + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Npgsql.staging.build/bin" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Npgsql.windows/src/Npgsql/bin/Release/* $PG_PATH_WINDOWS/Npgsql.staging.build/bin" || _die "Failed to copy Npgsql binary to staging directory" - # Zip up the installed code, copy it back here, and unpack. - echo "Copying npgsql built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\Npgsql.staging; cmd /c zip -r ..\\\\npgsql-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/Npgsql.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/npgsql-staging.zip $WD/Npgsql/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/npgsql-staging.zip)" - unzip $WD/Npgsql/staging/windows/npgsql-staging.zip -d $WD/Npgsql/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/npgsql-staging.zip)" - rm $WD/Npgsql/staging/windows/npgsql-staging.zip + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\Npgsql.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Npgsql.staging rd /S /Q Npgsql.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\Npgsql.staging" || _die "Couldn't create the last successful staging directory" - cp $WD/Npgsql/source/Npgsql.windows/LICENSE.txt $WD/Npgsql/staging/windows/ || _die "Unable to copy LICENSE.txt" + echo "Copying the complete build to the successful staging directory" +ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y Npgsql.staging.build\\\\* Npgsql.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_NPGSQL=$PG_VERSION_NPGSQL > $PG_PATH_WINDOWS\\\\Npgsql.staging/versions-windows.sh" || _die "Failed to write pgAgent version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_NPGSQL=$PG_BUILDNUM_NPGSQL >> $PG_PATH_WINDOWS\\\\Npgsql.staging/versions-windows.sh" || _die "Failed to write pgAgent build number into versions-windows.sh" cd $WD @@ -122,7 +123,31 @@ EOT _postprocess_Npgsql_windows() { echo "BEGIN POST Npgsql Windows" + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/Npgsql/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/Npgsql/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/Npgsql/staging/windows)" + mkdir -p $WD/Npgsql/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Npgsql/staging/windows || _die "Couldn't set the permissions on the staging directory" + # Zip up the installed code, copy it back here, and unpack. + echo "Copying npgsql built tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST npgsql-staging.zip del /S /Q npgsql-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\npgsql-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\Npgsql.staging; cmd /c zip -r ..\\\\npgsql-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/Npgsql.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/npgsql-staging.zip $WD/Npgsql/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/npgsql-staging.zip)" + unzip $WD/Npgsql/staging/windows/npgsql-staging.zip -d $WD/Npgsql/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/npgsql-staging.zip)" + rm $WD/Npgsql/staging/windows/npgsql-staging.zip + + dos2unix $WD/Npgsql/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/Npgsql/staging/windows/versions-windows.sh + PG_BUILD_NPGSQL=$(expr $PG_BUILD_NPGSQL + $SKIPBUILD) + + cp $WD/Npgsql/source/Npgsql.windows/LICENSE.txt $WD/Npgsql/staging/windows/ || _die "Unable to copy LICENSE.txt" + cd $WD/Npgsql # Copy in the menu pick images @@ -132,8 +157,18 @@ _postprocess_Npgsql_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_NPGSQL -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/npgsql-$PG_VERSION_NPGSQL-$PG_BUILDNUM_NPGSQL-windows.exe $WD/output/npgsql-$PG_VERSION_NPGSQL-$PG_BUILDNUM_NPGSQL-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "npgsql-$PG_VERSION_NPGSQL-$PG_BUILDNUM_NPGSQL-windows.exe" + win32_sign "npgsql-$PG_VERSION_NPGSQL-$PG_BUILDNUM_NPGSQL-${BUILD_FAILED}windows.exe" cd $WD diff --git a/PostGIS/build-linux-x64.sh b/PostGIS/build-linux-x64.sh index 7253d1b18..be493c73c 100644 --- a/PostGIS/build-linux-x64.sh +++ b/PostGIS/build-linux-x64.sh @@ -26,15 +26,15 @@ _prep_PostGIS_linux_x64() { cp -pR postgis-$PG_VERSION_POSTGIS/* postgis.linux-x64 || _die "Failed to copy the source code (source/postgis-$PG_VERSION_POSTGIS)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/PostGIS/staging/linux-x64 ]; + if [ -e $WD/PostGIS/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/PostGIS/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/PostGIS/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/PostGIS/staging/linux-x64)" - mkdir -p $WD/PostGIS/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/PostGIS/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/PostGIS/staging/linux-x64.build)" + mkdir -p $WD/PostGIS/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/PostGIS/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" POSTGIS_MAJOR_VERSION=`echo $PG_VERSION_POSTGIS | cut -f1,2 -d "."` @@ -68,13 +68,13 @@ _build_PostGIS_linux_x64() { BLD_REMOTE_PATH=$PG_PATH_LINUX_X64 PACKAGE_SOURCE=$WD/PostGIS/source PACKAGE_SOURCE_REMOTE=$BLD_REMOTE_PATH/PostGIS/source - PACKAGE_STAGING=$BLD_REMOTE_PATH/PostGIS/staging/$PLATFORM + PACKAGE_STAGING=$BLD_REMOTE_PATH/PostGIS/staging/${PLATFORM}.build PACKAGE_CACHING=$BLD_REMOTE_PATH/PostGIS/caching/$PLATFORM POSTGIS_SOURCE=$WD/PostGIS/source/postgis.$PLATFORM POSTGIS_SOURCE_REMOTE=$PACKAGE_SOURCE_REMOTE/postgis.$PLATFORM - POSTGIS_STAGING=$WD/PostGIS/staging/$PLATFORM - POSTGIS_STAGING_REMOTE=$BLD_REMOTE_PATH/PostGIS/staging/$PLATFORM + POSTGIS_STAGING=$WD/PostGIS/staging/${PLATFORM}.build + POSTGIS_STAGING_REMOTE=$BLD_REMOTE_PATH/PostGIS/staging/${PLATFORM}.build cat < "build-postgis-$PLATFORM.sh" #!/bin/bash @@ -155,12 +155,12 @@ EOT scp build-postgis-$PLATFORM.sh $PLATFORM_SSH:$BLD_REMOTE_PATH || _die "Failed to copy build script on $PLATFORM VM" ssh $PLATFORM_SSH "cd $BLD_REMOTE_PATH; bash ./build-postgis-$PLATFORM.sh $BUILD_PROJ $BUILD_GEOS" || _die "Failed to execution of build script on $PLATFORM" - mkdir -p $WD/PostGIS/staging/linux-x64/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/html/images $WD/PostGIS/staging/linux-x64/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/html/postgis.html $WD/PostGIS/staging/linux-x64/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux-x64/java/jdbc/src/main/javadoc/overview.html $WD/PostGIS/staging/linux-x64/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/postgis-$PG_VERSION_POSTGIS.pdf $WD/PostGIS/staging/linux-x64/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/man $WD/PostGIS/staging/linux-x64/PostGIS/ + mkdir -p $WD/PostGIS/staging/linux-x64.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/html/images $WD/PostGIS/staging/linux-x64.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/html/postgis.html $WD/PostGIS/staging/linux-x64.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux-x64/java/jdbc/src/main/javadoc/overview.html $WD/PostGIS/staging/linux-x64.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/postgis-$PG_VERSION_POSTGIS.pdf $WD/PostGIS/staging/linux-x64.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux-x64/doc/man $WD/PostGIS/staging/linux-x64.build/PostGIS/ # Generate debug symbols @@ -175,7 +175,18 @@ EOT # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/PostGIS/staging/linux-x64/PostGIS/symbols $WD/output/symbols/linux-x64/PostGIS || _die "Failed to move $WD/PostGIS/staging/linux-x64/PostGIS/symbols to $WD/output/symbols/linux-x64/PostGIS directory" + mv $WD/PostGIS/staging/linux-x64.build/PostGIS/symbols $WD/output/symbols/linux-x64/PostGIS || _die "Failed to move $WD/PostGIS/staging/linux-x64.build/PostGIS/symbols to $WD/output/symbols/linux-x64/PostGIS directory" + + echo "Removing last successful staging directory ($WD/PostGIS/staging/linux-x64)" + rm -rf $WD/PostGIS/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/PostGIS/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/PostGIS/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/PostGIS/staging/linux-x64.build/* $WD/PostGIS/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_POSTGIS=$PG_VERSION_POSTGIS" > $WD/PostGIS/staging/linux-x64/versions-linux-x64.sh + echo "PG_VERSION_POSTGIS_JAVA=$PG_VERSION_POSTGIS_JAVA" >> $WD/PostGIS/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_POSTGIS=$PG_BUILDNUM_POSTGIS" >> $WD/PostGIS/staging/linux-x64/versions-linux-x64.sh cd $WD/PostGIS @@ -192,6 +203,9 @@ _postprocess_PostGIS_linux_x64() { echo "BEGIN POST PostGIS Linux-x64" + source $WD/PostGIS/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_POSTGIS=$(expr $PG_BUILD_POSTGIS + $SKIPBUILD) + cd $WD/PostGIS mkdir -p staging/linux-x64/installer/PostGIS || _die "Failed to create a directory for the install scripts" @@ -242,6 +256,16 @@ _postprocess_PostGIS_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_POSTGIS -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/postgis-pg96-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-linux-x64.run $WD/output/postgis-pg96-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST PostGIS Linux-x64" diff --git a/PostGIS/build-linux.sh b/PostGIS/build-linux.sh index e22af6068..04e9e63b6 100644 --- a/PostGIS/build-linux.sh +++ b/PostGIS/build-linux.sh @@ -26,15 +26,15 @@ _prep_PostGIS_linux() { cp -pR postgis-$PG_VERSION_POSTGIS/* postgis.linux || _die "Failed to copy the source code (source/postgis-$PG_VERSION_POSTGIS)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/PostGIS/staging/linux ]; + if [ -e $WD/PostGIS/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/PostGIS/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/PostGIS/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/PostGIS/staging/linux)" - mkdir -p $WD/PostGIS/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/PostGIS/staging/linux || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/PostGIS/staging/linux.build)" + mkdir -p $WD/PostGIS/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/PostGIS/staging/linux.build || _die "Couldn't set the permissions on the staging directory" POSTGIS_MAJOR_VERSION=`echo $PG_VERSION_POSTGIS | cut -f1,2 -d "."` @@ -47,7 +47,7 @@ _prep_PostGIS_linux() { ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f doc/postgresql/postgis/postgis.html doc/postgresql/postgis/README.postgis" || _die "Failed to remove documentation" ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f share/man/man1/pgsql2shp.1 share/man/man1/shp2pgsql.1" || _die "Failed to remove man pages" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX; rm -f build-postgis-linux.sh" || _die "Failed to remove build-postgis-linux.sh script" - + echo "END PREP PostGIS Linux" } @@ -69,13 +69,13 @@ _build_PostGIS_linux() { BLD_REMOTE_PATH=$PG_PATH_LINUX PACKAGE_SOURCE=$WD/PostGIS/source PACKAGE_SOURCE_REMOTE=$BLD_REMOTE_PATH/PostGIS/source - PACKAGE_STAGING=$BLD_REMOTE_PATH/PostGIS/staging/$PLATFORM + PACKAGE_STAGING=$BLD_REMOTE_PATH/PostGIS/staging/${PLATFORM}.build PACKAGE_CACHING=$BLD_REMOTE_PATH/PostGIS/caching/$PLATFORM POSTGIS_SOURCE=$WD/PostGIS/source/postgis.$PLATFORM POSTGIS_SOURCE_REMOTE=$PACKAGE_SOURCE_REMOTE/postgis.$PLATFORM - POSTGIS_STAGING=$WD/PostGIS/staging/$PLATFORM - POSTGIS_STAGING_REMOTE=$BLD_REMOTE_PATH/PostGIS/staging/$PLATFORM + POSTGIS_STAGING=$WD/PostGIS/staging/${PLATFORM}.build + POSTGIS_STAGING_REMOTE=$BLD_REMOTE_PATH/PostGIS/staging/${PLATFORM}.build cd $PACKAGE_SOURCE @@ -157,12 +157,12 @@ EOT scp build-postgis-$PLATFORM.sh $PLATFORM_SSH:$BLD_REMOTE_PATH || _die "Failed to copy build script on $PLATFORM VM" ssh $PLATFORM_SSH "cd $BLD_REMOTE_PATH; bash ./build-postgis-$PLATFORM.sh" || _die "Failed to execution of build script on $PLATFORM" - mkdir -p $WD/PostGIS/staging/linux/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux/doc/html/images $WD/PostGIS/staging/linux/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux/doc/html/postgis.html $WD/PostGIS/staging/linux/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux/java/jdbc/src/main/javadoc/overview.html $WD/PostGIS/staging/linux/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux/doc/postgis-$PG_VERSION_POSTGIS.pdf $WD/PostGIS/staging/linux/PostGIS/doc/postgis/ - cp -pR $WD/PostGIS/source/postgis.linux/doc/man $WD/PostGIS/staging/linux/PostGIS/ + mkdir -p $WD/PostGIS/staging/linux.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux/doc/html/images $WD/PostGIS/staging/linux.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux/doc/html/postgis.html $WD/PostGIS/staging/linux.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux/java/jdbc/src/main/javadoc/overview.html $WD/PostGIS/staging/linux.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux/doc/postgis-$PG_VERSION_POSTGIS.pdf $WD/PostGIS/staging/linux.build/PostGIS/doc/postgis/ + cp -pR $WD/PostGIS/source/postgis.linux/doc/man $WD/PostGIS/staging/linux.build/PostGIS/ # Generate debug symbols ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PACKAGE_STAGING/PostGIS" || _die "Failed to execute create_debug_symbols.sh" @@ -176,7 +176,18 @@ EOT # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/PostGIS/staging/linux/PostGIS/symbols $WD/output/symbols/linux/PostGIS || _die "Failed to move $WD/PostGIS/staging/linux/PostGIS/symbols to $WD/output/symbols/linux/PostGIS directory" + mv $WD/PostGIS/staging/linux.build/PostGIS/symbols $WD/output/symbols/linux/PostGIS || _die "Failed to move $WD/PostGIS/staging/linux.build/PostGIS/symbols to $WD/output/symbols/linux/PostGIS directory" + + echo "Removing last successful staging directory ($WD/PostGIS/staging/linux)" + rm -rf $WD/PostGIS/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/PostGIS/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/PostGIS/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/PostGIS/staging/linux.build/* $WD/PostGIS/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_POSTGIS=$PG_VERSION_POSTGIS" > $WD/PostGIS/staging/linux/versions-linux.sh + echo "PG_VERSION_POSTGIS_JAVA=$PG_VERSION_POSTGIS_JAVA" >> $WD/PostGIS/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_POSTGIS=$PG_BUILDNUM_POSTGIS" >> $WD/PostGIS/staging/linux/versions-linux.sh cd $WD/PostGIS @@ -192,6 +203,9 @@ _postprocess_PostGIS_linux() { echo "BEGIN POST PostGIS Linux" + source $WD/PostGIS/staging/linux/versions-linux.sh + PG_BUILD_POSTGIS=$(expr $PG_BUILD_POSTGIS + $SKIPBUILD) + cd $WD/PostGIS mkdir -p staging/linux/installer/PostGIS || _die "Failed to create a directory for the install scripts" @@ -241,6 +255,16 @@ _postprocess_PostGIS_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_POSTGIS -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/postgis-pg96-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-linux.run $WD/output/postgis-pg96-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}linux.run + cd $WD echo "END POST PostGIS Linux" diff --git a/PostGIS/build-osx.sh b/PostGIS/build-osx.sh index b711587c4..8d0af1089 100644 --- a/PostGIS/build-osx.sh +++ b/PostGIS/build-osx.sh @@ -56,7 +56,11 @@ _prep_PostGIS_osx() { ssh $PG_SSH_OSX "rm -f share/man/man1/pgsql2shp.1 share/man/man1/shp2pgsql.1" || _die "Failed to remove man pages" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/PostGIS ]; then rm -rf $PG_PATH_OSX/PostGIS/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/source" || _die "Falied to clean the PostGIS/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/scripts" || _die "Falied to clean the PostGIS/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/*.bz2" || _die "Falied to clean the PostGIS/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/*.sh" || _die "Falied to clean the PostGIS/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/staging/osx.build" || _die "Falied to clean the PostGIS/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/PostGIS/source" || _die "Failed to create the source dircetory on the build VM" @@ -220,8 +224,8 @@ cat < $WD/PostGIS/build-postgis.sh echo "Building PostGIS" LDFLAGS="-L/opt/local/Current/lib -arch x86_64 -arch i386" CFLAGS="$PG_ARCH_OSX_CFLAGS -arch x86_64 -arch i386" MACOSX_DEPLOYMENT_TARGET=10.6 make || _die "Failed to build PostGIS" make comments || _die "Failed to build comments" - make install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/share/postgresql || _die "Failed to install PostGIS" - make comments-install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/share/postgresql || _die "Failed to install PostGIS comments" + make install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/share/postgresql || _die "Failed to install PostGIS" + make comments-install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/share/postgresql || _die "Failed to install PostGIS comments" echo "Building postgis-doc" cd $PG_PATH_OSX/PostGIS/source/postgis.osx/doc/html/image_src; @@ -229,19 +233,19 @@ cat < $WD/PostGIS/build-postgis.sh LDFLAGS="-L/opt/local/Current/lib -arch x86_64 -arch i386" CFLAGS="$PG_ARCH_OSX_CFLAGS -arch x86_64 -arch i386" MACOSX_DEPLOYMENT_TARGET=10.6 make|| _die "Failed to build postgis-doc" cd $PG_PATH_OSX/PostGIS/source/postgis.osx/doc; LDFLAGS="-L/opt/local/Current/lib -arch x86_64 -arch i386" CFLAGS="$PG_ARCH_OSX_CFLAGS -arch x86_64 -arch i386" MACOSX_DEPLOYMENT_TARGET=10.6 make html || _die "Failed to build postgis-doc" - make install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/share/postgresql || _die "Failed to install PostGIS-doc" + make install PGXSOVERRIDE=0 DESTDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS bindir=/bin pkglibdir=/lib datadir=/share REGRESS=1 PGSQL_DOCDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/doc PGSQL_MANDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/man PGSQL_SHAREDIR=$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/share/postgresql || _die "Failed to install PostGIS-doc" cd $PG_PATH_OSX/PostGIS - mkdir -p staging/osx/PostGIS/doc/postgis/ - cp -pR source/postgis.osx/doc/html/images staging/osx/PostGIS/doc/postgis/ - cp -pR source/postgis.osx/doc/html/postgis.html staging/osx/PostGIS/doc/postgis/ - cp -pR source/postgis.osx/java/jdbc/src/main/javadoc/overview.html staging/osx/PostGIS/doc/postgis/ - cp -pR source/postgis.osx/doc/postgis-$PG_VERSION_POSTGIS.pdf staging/osx/PostGIS/doc/postgis/ + mkdir -p staging/osx.build/PostGIS/doc/postgis/ + cp -pR source/postgis.osx/doc/html/images staging/osx.build/PostGIS/doc/postgis/ + cp -pR source/postgis.osx/doc/html/postgis.html staging/osx.build/PostGIS/doc/postgis/ + cp -pR source/postgis.osx/java/jdbc/src/main/javadoc/overview.html staging/osx.build/PostGIS/doc/postgis/ + cp -pR source/postgis.osx/doc/postgis-$PG_VERSION_POSTGIS.pdf staging/osx.build/PostGIS/doc/postgis/ - mkdir -p staging/osx/PostGIS/man - cp -pR source/postgis.osx/doc/man staging/osx/PostGIS/ + mkdir -p staging/osx.build/PostGIS/man + cp -pR source/postgis.osx/doc/man staging/osx.build/PostGIS/ - mkdir -p staging/osx/PostGIS/utils + mkdir -p staging/osx.build/PostGIS/utils echo "Copying postgis-utils" cd $PG_PATH_OSX/PostGIS/source/postgis.osx/utils cp *.pl $PG_STAGING/PostGIS/utils || _die "Failed to copy the utilities " @@ -250,12 +254,12 @@ cat < $WD/PostGIS/build-postgis.sh cd $PG_PATH_OSX/PostGIS/source/postgis.osx/java/jdbc CLASSPATH=$PG_PATH_OSX/PostGIS/source/postgis.osx/postgresql-$PG_JAR_POSTGRESQL.jar:\$CLASSPATH JAVA_HOME=$PG_JAVA_HOME_OSX $PG_MAVEN_HOME_OSX/bin/mvn clean install || _die "Failed to build postgis-jdbc jar." - mkdir -p $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/java/jdbc + mkdir -p $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/java/jdbc echo "Copying postgis-jdbc" cd $PG_PATH_OSX/PostGIS/source/postgis.osx/java - cp jdbc/target/postgis*.jar $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/java/jdbc || _die "Failed to copy postgis jars into postgis-jdbc" - cp -R ejb2 ejb3 $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/java/ || _die "Failed to copy ejb2, ejb3 into postgis-java" + cp jdbc/target/postgis*.jar $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/java/jdbc || _die "Failed to copy postgis jars into postgis-jdbc" + cp -R ejb2 ejb3 $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/java/ || _die "Failed to copy ejb2, ejb3 into postgis-java" EOT-POSTGIS @@ -275,7 +279,7 @@ _build_PostGIS_osx() { echo "* Build: PostGIS (OSX) *" echo "**************************" - PG_STAGING=$PG_PATH_OSX/PostGIS/staging/osx + PG_STAGING=$PG_PATH_OSX/PostGIS/staging/osx.build POSTGIS_MAJOR_VERSION=`echo $PG_VERSION_POSTGIS | cut -f1,2 -d "."` # Building PostGIS @@ -283,83 +287,87 @@ _build_PostGIS_osx() { cat <> $WD/PostGIS/build-postgis.sh cd $PG_PATH_OSX/PostGIS - cp -pR staging/osx/PostGIS/$PG_PGHOME_OSX/bin/* $PG_STAGING/PostGIS/bin/ - cp -pR staging/osx/PostGIS/usr/local/include $PG_STAGING/PostGIS - cp -pR staging/osx/PostGIS/usr/local/lib/* $PG_STAGING/PostGIS/lib/ - rm -rf staging/osx/PostGIS/usr - rm -rf staging/osx/PostGIS/mnt + cp -pR staging/osx.build/PostGIS/$PG_PGHOME_OSX/bin/* $PG_STAGING/PostGIS/bin/ + cp -pR staging/osx.build/PostGIS/usr/local/include $PG_STAGING/PostGIS + cp -pR staging/osx.build/PostGIS/usr/local/lib/* $PG_STAGING/PostGIS/lib/ + rm -rf staging/osx.build/PostGIS/usr + rm -rf staging/osx.build/PostGIS/mnt echo "Copying Dependent libraries" - cp -pR /opt/local/Current/lib/libgeos*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libproj*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libgdal*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libcurl*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libpcre.*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libintl.*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent libraries" - cp -pR /opt/local/Current/lib/libjson-c.*dylib staging/osx/PostGIS/lib || _die "Failed to copy dependent (libjson-c) libraries" - - _rewrite_so_refs $PG_PATH_OSX/PostGIS/staging/osx/PostGIS bin @loader_path/.. - _rewrite_so_refs $PG_PATH_OSX/PostGIS/staging/osx/PostGIS lib @loader_path/../.. - #_change_so_refs $PG_PATH_OSX/PostGIS/staging/osx/PostGIS bin @loader_path/.. - #_change_so_refs $PG_PATH_OSX/PostGIS/staging/osx/PostGIS lib @loader_path/../.. - install_name_tool -change "libxml2.2.dylib" "@loader_path/../../lib/libxml2.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis-*.so - install_name_tool -change "@loader_path/../../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/libgeos_c.1.dylib - install_name_tool -change "@loader_path/../../lib/libpcre.1.dylib" "@loader_path/libpcre.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/libgdal.20.dylib - install_name_tool -change "@loader_path/../../lib/libcurl.4.dylib" "@loader_path/libcurl.4.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/libgdal.20.dylib - install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/libgdal.20.dylib - install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libgdal.20.dylib" "@loader_path/libgdal.20.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so - install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" "$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis_topology-$POSTGIS_MAJOR_VERSION.so" - install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" "$PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/postgis_topology-$POSTGIS_MAJOR_VERSION.so" - install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib - install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib - install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib - install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib + cp -pR /opt/local/Current/lib/libgeos*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libproj*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libgdal*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libcurl*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libpcre.*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libintl.*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent libraries" + cp -pR /opt/local/Current/lib/libjson-c.*dylib staging/osx.build/PostGIS/lib || _die "Failed to copy dependent (libjson-c) libraries" + + _rewrite_so_refs $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS bin @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS lib @loader_path/../.. + #_change_so_refs $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS bin @loader_path/.. + #_change_so_refs $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS lib @loader_path/../.. + install_name_tool -change "libxml2.2.dylib" "@loader_path/../../lib/libxml2.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis-*.so + install_name_tool -change "@loader_path/../../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/libgeos_c.1.dylib + install_name_tool -change "@loader_path/../../lib/libpcre.1.dylib" "@loader_path/libpcre.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/libgdal.20.dylib + install_name_tool -change "@loader_path/../../lib/libcurl.4.dylib" "@loader_path/libcurl.4.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/libgdal.20.dylib + install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/libgdal.20.dylib + install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libgdal.20.dylib" "@loader_path/libgdal.20.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/rtpostgis-$POSTGIS_MAJOR_VERSION.so + install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" "$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis_topology-$POSTGIS_MAJOR_VERSION.so" + install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" "$PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/postgis_topology-$POSTGIS_MAJOR_VERSION.so" + install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib + install_name_tool -change "@loader_path/../../lib/libgeos_c.1.dylib" "@loader_path/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib + install_name_tool -change "@loader_path/../../lib/libproj.9.dylib" "@loader_path/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib + install_name_tool -change "@loader_path/../../lib/libjson-c.2.dylib" "@loader_path/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib # Change the path for libs that will be installed in lib/postgresql - install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/pgsql2shp - install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/shp2pgsql - install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libcurl.4.dylib" "@loader_path/../lib/postgresql/libcurl.4.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libgdal.20.dylib" "@loader_path/../lib/postgresql/libgdal.20.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libpcre.1.dylib" "@loader_path/../lib/postgresql/libpcre.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/raster2pgsql - - chmod +r $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/lib/* - chmod +rx $PG_PATH_OSX/PostGIS/staging/osx/PostGIS/bin/* + install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/pgsql2shp + install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/shp2pgsql + install_name_tool -change "@loader_path/../lib/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" "@loader_path/../lib/postgresql/liblwgeom-$POSTGIS_MAJOR_VERSION.\$LIBLWGEOM_IFACE_CUR.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libgeos_c.1.dylib" "@loader_path/../lib/postgresql/libgeos_c.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libgeos-$PG_TARBALL_GEOS.dylib" "@loader_path/../lib/postgresql/libgeos-$PG_TARBALL_GEOS.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libproj.9.dylib" "@loader_path/../lib/postgresql/libproj.9.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libintl.8.dylib" "@loader_path/../lib/postgresql/libintl.8.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libcurl.4.dylib" "@loader_path/../lib/postgresql/libcurl.4.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libgdal.20.dylib" "@loader_path/../lib/postgresql/libgdal.20.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libpcre.1.dylib" "@loader_path/../lib/postgresql/libpcre.1.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + install_name_tool -change "@loader_path/../lib/libjson-c.2.dylib" "@loader_path/../lib/postgresql/libjson-c.2.dylib" $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/raster2pgsql + + chmod +r $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/lib/* + chmod +rx $PG_PATH_OSX/PostGIS/staging/osx.build/PostGIS/bin/* EOT-POSTGIS cd $WD scp PostGIS/build-postgis.sh $PG_SSH_OSX:$PG_PATH_OSX/PostGIS ssh $PG_SSH_OSX "cd $PG_PATH_OSX/PostGIS; sh ./build-postgis.sh" || _die "Failed to build PostGIS on OSX" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/PostGIS/staging/osx; tar -jcvf postgis-staging.tar.bz2 *" || _die "Failed to create archive of the postgis staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/PostGIS/staging/osx/postgis-staging.tar.bz2 $WD/PostGIS/staging/osx || _die "Failed to scp postgis staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/PostGIS/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/PostGIS/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/PostGIS/staging/osx" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR PostGIS/staging/osx.build/* PostGIS/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_POSTGIS=$PG_VERSION_POSTGIS > $PG_PATH_OSX/PostGIS/staging/osx/versions-osx.sh" || _die "Failed to write PostGIS version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_VERSION_POSTGIS_JAVA=$PG_VERSION_POSTGIS_JAVA >> $PG_PATH_OSX/PostGIS/staging/osx/versions-osx.sh" || _die "Failed to write PostGIS build number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_POSTGIS=$PG_BUILDNUM_POSTGIS >> $PG_PATH_OSX/PostGIS/staging/osx/versions-osx.sh" || _die "Failed to write PostGIS build number into versions-osx.sh" + - # Extract the staging archive - cd $WD/PostGIS/staging/osx - tar -jxvf postgis-staging.tar.bz2 || _die "Failed to extract the postgis staging archive" - rm -f postgis-staging.tar.bz2 echo "END BUILD PostGIS OSX" } @@ -377,6 +385,36 @@ _postprocess_PostGIS_osx() { echo "* Post Process: PostGIS (OSX) *" echo "*********************************" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/PostGIS/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/PostGIS/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/PostGIS/staging/osx)" + mkdir -p $WD/PostGIS/staging/osx || _die "Couldn't create the staging directory" + chmod ugo+w $WD/PostGIS/staging/osx || _die "Couldn't set the permissions on the staging directory" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/PostGIS/staging/osx; rm -f postgis-staging.tar.bz2" || _die "Failed to remove archive of the PostGIS staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/PostGIS/staging/osx; tar -jcvf postgis-staging.tar.bz2 *" || _die "Failed to create archive of the postgis staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/PostGIS/staging/osx/postgis-staging.tar.bz2 $WD/PostGIS/staging/osx || _die "Failed to scp postgis staging" + + # Extract the staging archive + cd $WD/PostGIS/staging/osx + tar -jxvf postgis-staging.tar.bz2 || _die "Failed to extract the postgis staging archive" + rm -f postgis-staging.tar.bz2 + + source $WD/PostGIS/staging/osx/versions-osx.sh + PG_BUILD_POSTGIS=$(expr $PG_BUILD_POSTGIS + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_POSTGIS -gt 0 ]; + then + BUILD_FAILED="" + fi + PG_STAGING=$WD/PostGIS/staging/osx pushd $WD/PostGIS/staging/osx @@ -421,12 +459,15 @@ _postprocess_PostGIS_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app/Contents/MacOS/PostGIS_PG$PG_CURRENT_VERSION - chmod a+x $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app/Contents/MacOS/PostGIS_PG$PG_CURRENT_VERSION - cp -f $WD/resources/extract_installbuilder.osx $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ PostGIS_PG$PG_CURRENT_VERSION $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" - chmod a+x $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app/Contents/MacOS/PostGIS_PG$PG_CURRENT_VERSION + chmod a+x $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app/Contents/MacOS/PostGIS_PG$PG_CURRENT_VERSION + cp -f $WD/resources/extract_installbuilder.osx $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ PostGIS_PG$PG_CURRENT_VERSION $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" + chmod a+x $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -434,18 +475,18 @@ _postprocess_PostGIS_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app.tar.bz2 postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app || _die "Failed to create the archive." + tar -jcvf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app.tar.bz2 postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf postgis*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app* || _die "Failed to clean the output directory." + scp postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app; mv postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx-signed.app postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app; mv postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx-signed.app postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.zip postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.zip postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/PostGIS/build-windows.sh b/PostGIS/build-windows.sh index bc97ac853..1c7db5f6a 100755 --- a/PostGIS/build-windows.sh +++ b/PostGIS/build-windows.sh @@ -92,7 +92,7 @@ _prep_PostGIS_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis.zip del /S /Q postgis.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis.windows rd /S /Q postgis.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis.staging rd /S /Q postgis.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis.staging.build rd /S /Q postgis.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis.staging.build directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-postgis.bat del /S /Q build-postgis.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-postgis.bat on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis-staging.zip del /S /Q postgis-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis-staging.zip on Windows VM" @@ -184,7 +184,7 @@ REM Configuring the geos source tree REM Configuring the postgis source tree @echo cd $PG_PATH_WINDOWS/postgis.windows/; export PATH=$PG_STAGING/proj-$PG_TARBALL_PROJ.staging/bin:$PG_STAGING/geos-$PG_TARBALL_GEOS.staging:\$PATH; LD_LIBRARY_PATH=$PG_STAGING/proj-$PG_TARBALL_PROJ.staging/lib:$PG_STAGING/geos-$PG_TARBALL_GEOS.staging:\$LD_LIBRARY_PATH; ./configure --with-pgconfig=$PG_PGHOME_MINGW_WINDOWS/bin/pg_config --with-projdir=$PG_STAGING/proj-$PG_TARBALL_PROJ.staging --with-geosconfig=$PG_STAGING/geos-$PG_TARBALL_GEOS.staging/bin/geos-config --with-xml2config=$PG_PGBUILD_MINGW_WINDOWS/libxml2_mingw/bin/xml2-config --with-libiconv=$PG_PGBUILD_MINGW_WINDOWS/iconv; make | $PG_MSYS_WINDOWS\bin\sh --login -i -@echo cd $PG_PATH_WINDOWS/postgis.windows/; make install DESTDIR=$PG_STAGING/postgis.staging bindir=/bin pkglibdir=/lib datadir=/share PGSQL_DOCDIR=$PG_STAGING/postgis.staging/doc/postgresql PGSQL_MANDIR=$PG_STAGING/postgis.staging/man PGSQL_SHAREDIR=$PG_STAGING/postgis.staging/share/postgresql | $PG_MSYS_WINDOWS\bin\sh --login -i +@echo cd $PG_PATH_WINDOWS/postgis.windows/; make install DESTDIR=$PG_STAGING/postgis.staging.build bindir=/bin pkglibdir=/lib datadir=/share PGSQL_DOCDIR=$PG_STAGING/postgis.staging.build/doc/postgresql PGSQL_MANDIR=$PG_STAGING/postgis.staging.build/man PGSQL_SHAREDIR=$PG_STAGING/postgis.staging.build/share/postgresql | $PG_MSYS_WINDOWS\bin\sh --login -i REM Building postgis-jdbc @echo cd $PG_PATH_WINDOWS/postgis.windows/java/jdbc; export CLASSPATH=$PG_STAGING/postgis.windows/postgresql-$PG_JAR_POSTGRESQL.jar; export JAVA_HOME=$PG_JAVA_HOME_MINGW_WINDOWS; $PG_ANT_HOME_MINGW_WINDOWS/bin/ant | $PG_MSYS_WINDOWS\bin\sh --login -i @@ -195,48 +195,45 @@ EOT ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c build-postgis.bat" echo "Copying Readme files" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging; mkdir -p doc/postgis" || _die "Failed to create doc directory" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging; mkdir -p man/man1" || _die "Failed to create man pages directory" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp README.postgis $PG_PATH_WINDOWS/postgis.staging/doc/postgis/" || _die "Failed to copy README.postgis " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp loader/README.shp2pgsql $PG_PATH_WINDOWS/postgis.staging/doc/postgis/" || _die "Failed to copy README.shp2pgsql " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp loader/README.pgsql2shp $PG_PATH_WINDOWS/postgis.staging/doc/postgis/" || _die "Failed to copy README.pgsql2shp " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build; mkdir -p doc/postgis" || _die "Failed to create doc directory" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build; mkdir -p man/man1" || _die "Failed to create man pages directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp README.postgis $PG_PATH_WINDOWS/postgis.staging.build/doc/postgis/" || _die "Failed to copy README.postgis " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp loader/README.shp2pgsql $PG_PATH_WINDOWS/postgis.staging.build/doc/postgis/" || _die "Failed to copy README.shp2pgsql " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp loader/README.pgsql2shp $PG_PATH_WINDOWS/postgis.staging.build/doc/postgis/" || _die "Failed to copy README.pgsql2shp " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging; mkdir -p doc/postgis/jdbc" || _die "Failed to create doc directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build; mkdir -p doc/postgis/jdbc" || _die "Failed to create doc directory" echo "Copying jdbc docs" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java/jdbc; cp postgis-jdbc-javadoc.zip $PG_PATH_WINDOWS/postgis.staging/doc/postgis/jdbc/" || _die "Failed to copy jdbc docs " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging/doc/postgis/jdbc; unzip postgis-jdbc-javadoc.zip; rm -f postgis-jdbc-javadoc.zip " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java/jdbc; cp postgis-jdbc-javadoc.zip $PG_PATH_WINDOWS/postgis.staging.build/doc/postgis/jdbc/" || _die "Failed to copy jdbc docs " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build/doc/postgis/jdbc; unzip postgis-jdbc-javadoc.zip; rm -f postgis-jdbc-javadoc.zip " echo "Copying postgis-utils" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging; mkdir -p utils" || _die "Failed to create doc directory" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp utils/*.pl $PG_PATH_WINDOWS/postgis.staging/utils/" || _die "Failed to copy postgis-utils " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build; mkdir -p utils" || _die "Failed to create doc directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows; cp utils/*.pl $PG_PATH_WINDOWS/postgis.staging.build/utils/" || _die "Failed to copy postgis-utils " mkdir -p $WD/PostGIS/staging/osx/PostGIS/jdbc - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging; mkdir -p java/jdbc" || _die "Failed to create jdbc directory" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java/jdbc; cp postgis*.jar $PG_PATH_WINDOWS/postgis.staging/java/jdbc/" || _die "Failed to copy postgis-jdbc " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R ejb2 $PG_PATH_WINDOWS/postgis.staging/java/" || _die "Failed to copy ejb2 " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R ejb3 $PG_PATH_WINDOWS/postgis.staging/java/" || _die "Failed to copy ejb3 " - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R pljava $PG_PATH_WINDOWS/postgis.staging/java/" || _die "Failed to copy pljava " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build; mkdir -p java/jdbc" || _die "Failed to create jdbc directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java/jdbc; cp postgis*.jar $PG_PATH_WINDOWS/postgis.staging.build/java/jdbc/" || _die "Failed to copy postgis-jdbc " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R ejb2 $PG_PATH_WINDOWS/postgis.staging.build/java/" || _die "Failed to copy ejb2 " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R ejb3 $PG_PATH_WINDOWS/postgis.staging.build/java/" || _die "Failed to copy ejb3 " + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.windows/java; cp -R pljava $PG_PATH_WINDOWS/postgis.staging.build/java/" || _die "Failed to copy pljava " echo "Copying required dependent libraries from proj and geos packages" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging/lib; cp *.dll $PG_PATH_WINDOWS/postgis.staging/bin" || _die "Failed to copy dependent dll" - ssh $PG_SSH_WINDOWS "rm -rf $PG_PATH_WINDOWS/postgis.staging/lib" || _die "Failed to delete the lib directory" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/geos-$PG_TARBALL_GEOS.staging/bin; cp *.dll $PG_PATH_WINDOWS/postgis.staging/bin" || _die "Failed to copy dependent dll" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/proj-$PG_TARBALL_PROJ.staging/lib; cp *.dll $PG_PATH_WINDOWS/postgis.staging/bin" || _die "Failed to copy dependent dll" - ssh $PG_SSH_WINDOWS "cd $PG_PGBUILD_WINDOWS/libxml2_mingw/bin; cp *.dll $PG_PATH_WINDOWS/postgis.staging/bin" || _die "Failed to copy dependent dll" - - mkdir -p $WD/PostGIS/staging/windows/PostGIS/ - # Zip up the installed code, copy it back here, and unpack. - echo "Copying postgis built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\postgis.staging; cmd /c zip -r ..\\\\postgis-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis-staging.zip $WD/PostGIS/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis-staging.zip)" - unzip $WD/PostGIS/staging/windows/postgis-staging.zip -d $WD/PostGIS/staging/windows/PostGIS || _die "Failed to unpack the built source tree ($WD/staging/windows/postgis-staging.zip)" - rm $WD/PostGIS/staging/windows/postgis-staging.zip - - cd $WD/PostGIS/staging/windows/PostGIS - mkdir -p man/man1 - cp $WD/PostGIS/staging/osx/PostGIS/man/man1/pgsql2shp.1 man/man1/ || _die "Failed to copy the man pages" - cp $WD/PostGIS/staging/osx/PostGIS/man/man1/shp2pgsql.1 man/man1/ || _die "Failed to copy the man pages" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgis.staging.build/lib; cp *.dll $PG_PATH_WINDOWS/postgis.staging.build/bin" || _die "Failed to copy dependent dll" + ssh $PG_SSH_WINDOWS "rm -rf $PG_PATH_WINDOWS/postgis.staging.build/lib" || _die "Failed to delete the lib directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/geos-$PG_TARBALL_GEOS.staging/bin; cp *.dll $PG_PATH_WINDOWS/postgis.staging.build/bin" || _die "Failed to copy dependent dll" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/proj-$PG_TARBALL_PROJ.staging/lib; cp *.dll $PG_PATH_WINDOWS/postgis.staging.build/bin" || _die "Failed to copy dependent dll" + ssh $PG_SSH_WINDOWS "cd $PG_PGBUILD_WINDOWS/libxml2_mingw/bin; cp *.dll $PG_PATH_WINDOWS/postgis.staging.build/bin" || _die "Failed to copy dependent dll" + + echo "Removing last successful staging directory ($PG_PATH_WINDOWS/postgis.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis.staging rd /S /Q postgis.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\postgis.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" +ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y postgis.staging.build\\\\* postgis.staging\\\\" || _die "Couldn't copy the existing staging directory" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_POSTGIS=$PG_VERSION_POSTGIS > $PG_PATH_WINDOWS\\\\postgis.staging/versions-windows.sh" || _die "Failed to write spatial version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_POSTGIS=$PG_BUILDNUM_POSTGIS >> $PG_PATH_WINDOWS\\\\postgis.staging/versions-windows.sh" || _die "Failed to write spatial build number into versions-windows.sh" + echo "END BUILD PostGIS Windows" } @@ -250,6 +247,35 @@ _postprocess_PostGIS_windows() { echo "BEGIN POST PostGIS Windows" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/PostGIS/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/PostGIS/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/PostGIS/staging/windows)" + mkdir -p $WD/PostGIS/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/PostGIS/staging/windows || _die "Couldn't set the permissions on the staging directory" + mkdir -p $WD/PostGIS/staging/osx/PostGIS/jdbc + mkdir -p $WD/PostGIS/staging/windows/PostGIS/ + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying postgis built tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST postgis-staging.zip del /S /Q postgis-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\postgis-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\postgis.staging; cmd /c zip -r ..\\\\postgis-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis-staging.zip $WD/PostGIS/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgis-staging.zip)" + unzip $WD/PostGIS/staging/windows/postgis-staging.zip -d $WD/PostGIS/staging/windows/PostGIS || _die "Failed to unpack the built source tree ($WD/staging/windows/postgis-staging.zip)" + rm $WD/PostGIS/staging/windows/postgis-staging.zip + + dos2unix $WD/PostGIS/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/PostGIS/staging/windows/versions-windows.sh + PG_BUILD_POSTGIS=$(expr $PG_BUILD_POSTGIS + $SKIPBUILD) + + cd $WD/PostGIS/staging/windows/PostGIS + mkdir -p man/man1 + cp $WD/PostGIS/staging/osx/PostGIS/man/man1/pgsql2shp.1 man/man1/ || _die "Failed to copy the man pages" + cp $WD/PostGIS/staging/osx/PostGIS/man/man1/shp2pgsql.1 man/man1/ || _die "Failed to copy the man pages" + #Copy postgis.html from osx build cp $WD/PostGIS/staging/osx/PostGIS/doc/postgis/postgis.html $WD/PostGIS/staging/windows/PostGIS/doc/postgis/ || _die "Failed to copy the postgis.html file" @@ -269,8 +295,18 @@ _postprocess_PostGIS_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_POSTGIS -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-windows.exe $WD/output/postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-windows.exe" + win32_sign "postgis-pg$PG_CURRENT_VERSION-$PG_VERSION_POSTGIS-$PG_BUILDNUM_POSTGIS-${BUILD_FAILED}windows.exe" cd $WD diff --git a/Slony/build-linux-x64.sh b/Slony/build-linux-x64.sh index bc15bb63c..a6f37f9d9 100755 --- a/Slony/build-linux-x64.sh +++ b/Slony/build-linux-x64.sh @@ -26,15 +26,15 @@ _prep_Slony_linux_x64() { cp -R slony1-$PG_VERSION_SLONY/* slony.linux-x64 || _die "Failed to copy the source code (source/slony1-$PG_VERSION_SLONY)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/linux-x64 ]; + if [ -e $WD/Slony/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/Slony/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/Slony/staging/linux-x64)" - mkdir -p $WD/Slony/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/Slony/staging/linux-x64.build)" + mkdir -p $WD/Slony/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Slony/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" echo "Removing existing slony files from the PostgreSQL directory" ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64; rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.$PG_VERSION_SLONY.so" || _die "Failed to remove slony binary files" @@ -53,7 +53,7 @@ _build_Slony_linux_x64() { echo "BEGIN BUILD Slony Linux-x64" # build slony - PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64 + PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64.build echo "Configuring the slony source tree" ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-x64/; ./configure --enable-debug --with-pgconfigdir=$PG_PGHOME_LINUX_X64/bin --with-pgport=yes LD_LIBRARY_PATH=$PG_PGHOME_LINUX_X64/lib" || _die "Failed to configure slony" @@ -66,38 +66,21 @@ _build_Slony_linux_x64() { ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/bin; for f in slon slonik slony_logshipper ; do chrpath --replace \"\\\${ORIGIN}/../lib\" \$f; done" ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/lib/postgresql; chrpath --replace \"\\\${ORIGIN}/../../lib\" slony1_funcs.$PG_VERSION_SLONY.so" - cd $WD - - echo "END BUILD Slony Linux-x64" - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_linux_x64() { - - echo "BEGIN POST Slony Linux-x64" - - PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64 - cd $WD/Slony # Slony installs it's files into postgresql directory # We need to copy them to staging directory - mkdir -p $WD/Slony/staging/linux-x64/bin + mkdir -p $WD/Slony/staging/linux-x64.build/bin ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slon $PG_STAGING/bin" || _die "Failed to copy slon binary to staging directory" ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slonik $PG_STAGING/bin" || _die "Failed to copy slonik binary to staging directory" ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slony_logshipper $PG_STAGING/bin" || _die "Failed to copy slony_logshipper binary to staging directory" - chmod +rx $WD/Slony/staging/linux-x64/bin/* + chmod +rx $WD/Slony/staging/linux-x64.build/bin/* - mkdir -p $WD/Slony/staging/linux-x64/lib + mkdir -p $WD/Slony/staging/linux-x64.build/lib ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/lib/postgresql/slony1_funcs.$PG_VERSION_SLONY.so $PG_STAGING/lib" || _die "Failed to copy slony_funs.so to staging directory" - chmod +r $WD/Slony/staging/linux-x64/lib/* + chmod +r $WD/Slony/staging/linux-x64.build/lib/* - mkdir -p $WD/Slony/staging/linux-x64/Slony + mkdir -p $WD/Slony/staging/linux-x64.build/Slony ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/share/postgresql/slony*.sql $PG_STAGING/Slony" || _die "Failed to share files to staging directory" # Generate debug symbols @@ -112,7 +95,39 @@ _postprocess_Slony_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/Slony/staging/linux-x64/symbols $WD/output/symbols/linux-x64/Slony || _die "Failed to move $WD/Slony/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/Slony directory" + mv $WD/Slony/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/Slony || _die "Failed to move $WD/Slony/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/Slony directory" + + echo "Removing last successful staging directory ($WD/Slony/staging/linux-x64)" + rm -rf $WD/Slony/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/Slony/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/Slony/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/Slony/staging/linux-x64.build/* $WD/Slony/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_SLONY=$PG_VERSION_SLONY" > $WD/Slony/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY" >> $WD/Slony/staging/linux-x64/versions-linux-x64.sh + + cd $WD + + echo "END BUILD Slony Linux-x64" + +} + + +################################################################################ +# PG Build +################################################################################ + +_postprocess_Slony_linux_x64() { + + echo "BEGIN POST Slony Linux-x64" + + source $WD/Slony/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) + + PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64 + + cd $WD/Slony mkdir -p staging/linux-x64/installer/Slony || _die "Failed to create a directory for the install scripts" @@ -156,7 +171,17 @@ _postprocess_Slony_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" - + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SLONY -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux-x64.run $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST Slony Linux-x64" diff --git a/Slony/build-linux.sh b/Slony/build-linux.sh index 1c22fc003..c33b72ee8 100755 --- a/Slony/build-linux.sh +++ b/Slony/build-linux.sh @@ -26,20 +26,20 @@ _prep_Slony_linux() { cp -R slony1-$PG_VERSION_SLONY/* slony.linux || _die "Failed to copy the source code (source/slony1-$PG_VERSION_SLONY)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/linux ]; + if [ -e $WD/Slony/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/Slony/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/Slony/staging/linux)" - mkdir -p $WD/Slony/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/linux || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/Slony/staging/linux.build)" + mkdir -p $WD/Slony/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Slony/staging/linux.build || _die "Couldn't set the permissions on the staging directory" echo "Removing existing slony files from the PostgreSQL directory" ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.$PG_VERSION_SLONY.so" || _die "Failed to remove slony binary files" ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f share/postgresql/slony*.sql" || _die "remove slony share files" - + echo "END PREP Slony Linux" } @@ -54,7 +54,7 @@ _build_Slony_linux() { echo "BEGIN BUILD Slony Linux" # build slony - PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux + PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux.build echo "Configuring the slony source tree" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/Slony/source/slony.linux/; LD_LIBRARY_PATH=$PG_PGHOME_LINUX/lib ./configure --enable-debug --with-pgconfigdir=$PG_PGHOME_LINUX/bin --with-pgport=yes" || _die "Failed to configure slony" @@ -67,38 +67,21 @@ _build_Slony_linux() { ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX/bin; for f in slon slonik slony_logshipper ; do chrpath --replace \"\\\${ORIGIN}/../lib\" \$f; done" ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX/lib/postgresql; chrpath --replace \"\\\${ORIGIN}/../../lib\" slony1_funcs.$PG_VERSION_SLONY.so" - cd $WD - - echo "END BUILD Slony Linux" - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_linux() { - - echo "BEGIN POST Slony Linux" - - PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux - cd $WD/Slony # Slony installs it's files into postgresql directory # We need to copy them to staging directory - mkdir -p $WD/Slony/staging/linux/bin + mkdir -p $WD/Slony/staging/linux.build/bin ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slon $PG_STAGING/bin" || _die "Failed to copy slon binary to staging directory" ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slonik $PG_STAGING/bin" || _die "Failed to copy slonik binary to staging directory" ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slony_logshipper $PG_STAGING/bin" || _die "Failed to copy slony_logshipper binary to staging directory" - chmod +rx $WD/Slony/staging/linux/bin/* + chmod +rx $WD/Slony/staging/linux.build/bin/* - mkdir -p $WD/Slony/staging/linux/lib + mkdir -p $WD/Slony/staging/linux.build/lib ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/lib/postgresql/slony1_funcs.$PG_VERSION_SLONY.so $PG_STAGING/lib" || _die "Failed to copy slony_funs.so to staging directory" - chmod +r $WD/Slony/staging/linux/lib/* + chmod +r $WD/Slony/staging/linux.build/lib/* - mkdir -p $WD/Slony/staging/linux/Slony + mkdir -p $WD/Slony/staging/linux.build/Slony ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/share/postgresql/slony*.sql $PG_STAGING/Slony" || _die "Failed to share files to staging directory" # Generate debug symbols @@ -113,7 +96,39 @@ _postprocess_Slony_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/Slony/staging/linux/symbols $WD/output/symbols/linux/Slony || _die "Failed to move $WD/Slony/staging/linux/symbols to $WD/output/symbols/linux/Slony directory" + mv $WD/Slony/staging/linux.build/symbols $WD/output/symbols/linux/Slony || _die "Failed to move $WD/Slony/staging/linux.build/symbols to $WD/output/symbols/linux/Slony directory" + + echo "Removing last successful staging directory ($WD/Slony/staging/linux)" + rm -rf $WD/Slony/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/Slony/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/Slony/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/Slony/staging/linux.build/* $WD/Slony/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_SLONY=$PG_VERSION_SLONY" > $WD/Slony/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY" >> $WD/Slony/staging/linux/versions-linux.sh + + cd $WD + + echo "END BUILD Slony Linux" + +} + + +################################################################################ +# PG Build +################################################################################ + +_postprocess_Slony_linux() { + + echo "BEGIN POST Slony Linux" + + source $WD/Slony/staging/linux/versions-linux.sh + PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) + + PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux + + cd $WD/Slony mkdir -p staging/linux/installer/Slony || _die "Failed to create a directory for the install scripts" @@ -157,6 +172,16 @@ _postprocess_Slony_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SLONY -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux.run $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}linux.run + cd $WD echo "END POST Slony Linux" diff --git a/Slony/build-osx.sh b/Slony/build-osx.sh index 997257fa6..46a0db267 100644 --- a/Slony/build-osx.sh +++ b/Slony/build-osx.sh @@ -42,12 +42,16 @@ _prep_Slony_osx() { chmod ugo+w $WD/Slony/staging/osx || _die "Couldn't set the permissions on the staging directory" echo "Removing existing slony files from the PostgreSQL directory" - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/staging/osx" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/staging/osx.build" ssh $PG_SSH_OSX "rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.$PG_VERSION_SLONY.so" || _die "Failed to remove slony binary files" ssh $PG_SSH_OSX "rm -f share/postgresql/slony*.sql" || _die "remove slony share files" - # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/Slony ]; then rm -rf $PG_PATH_OSX/Slony/*; fi" || _die "Couldn't remove the existing files on OS X build server" + # Remove existing source and staging directories + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/source" || _die "Falied to clean the Slony/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/scripts" || _die "Falied to clean the Slony/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/*.bz2" || _die "Falied to clean the Slony/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/*.sh" || _die "Falied to clean the Slony/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/staging/osx.build" || _die "Falied to clean the Slony/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/Slony/source" || _die "Failed to create the source dircetory on the build VM" @@ -81,7 +85,7 @@ _build_Slony_osx() { echo "*******************************************************" # build slony - PG_STAGING=$PG_PATH_OSX/Slony/staging/osx + PG_STAGING=$PG_PATH_OSX/Slony/staging/osx.build cat < $WD/Slony/build-slony.sh source ../settings.sh source ../versions.sh @@ -159,41 +163,42 @@ EOT # Slony installs it's files into postgresql directory # We need to copy them to staging directory - mkdir -p $PG_PATH_OSX/Slony/staging/osx/bin + mkdir -p $PG_PATH_OSX/Slony/staging/osx.build/bin cp $PG_PGHOME_OSX/bin/slon $PG_STAGING/bin || _die "Failed to copy slon binary to staging directory" cp $PG_PGHOME_OSX/bin/slonik $PG_STAGING/bin || _die "Failed to copy slonik binary to staging directory" cp $PG_PGHOME_OSX/bin/slony_logshipper $PG_STAGING/bin || _die "Failed to copy slony_logshipper binary to staging directory" - chmod +rx $PG_PATH_OSX/Slony/staging/osx/bin/* + chmod +rx $PG_PATH_OSX/Slony/staging/osx.build/bin/* - mkdir -p $PG_PATH_OSX/Slony/staging/osx/lib + mkdir -p $PG_PATH_OSX/Slony/staging/osx.build/lib cp $PG_PGHOME_OSX/lib/postgresql/slony1_funcs.$PG_VERSION_SLONY.so $PG_STAGING/lib || _die "Failed to copy slony_funcs.so to staging directory" - chmod +r $PG_PATH_OSX/Slony/staging/osx/lib/* + chmod +r $PG_PATH_OSX/Slony/staging/osx.build/lib/* - mkdir -p $PG_PATH_OSX/Slony/staging/osx/Slony + mkdir -p $PG_PATH_OSX/Slony/staging/osx.build/Slony cp $PG_PGHOME_OSX/share/postgresql/slony*.sql $PG_STAGING/Slony || _die "Failed to share files to staging directory" # Rewrite shared library references (assumes that we only ever reference libraries in lib/) - _rewrite_so_refs $PG_PATH_OSX/Slony/staging/osx lib @loader_path/.. - _rewrite_so_refs $PG_PATH_OSX/Slony/staging/osx bin @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/Slony/staging/osx.build lib @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/Slony/staging/osx.build bin @loader_path/.. - install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx/bin/slon" - install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx/bin/slonik" - install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx/bin/slony_logshipper" + install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx.build/bin/slon" + install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx.build/bin/slonik" + install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_PATH_OSX/Slony/staging/osx.build/bin/slony_logshipper" EOT-SLONY cd $WD scp Slony/build-slony.sh $PG_SSH_OSX:$PG_PATH_OSX/Slony ssh $PG_SSH_OSX "cd $PG_PATH_OSX/Slony; sh ./build-slony.sh" || _die "Failed to build slony on OSX VM" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/Slony/staging/osx; tar -jcvf Slony-staging.tar.bz2 *" || _die "Failed to create archive of the Slony staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/Slony/staging/osx/slony-staging.tar.bz2 $WD/Slony/staging/osx || _die "Failed to scp Slony staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/Slony/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/Slony/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/Slony/staging/osx" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR Slony/staging/osx.build/* Slony/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_SLONY=$PG_VERSION_SLONY > $PG_PATH_OSX/Slony/staging/osx/versions-osx.sh" || _die "Failed to write Slony version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY >> $PG_PATH_OSX/Slony/staging/osx/versions-osx.sh" || _die "Failed to write Slony build number into versions-osx.sh" - # Extract the staging archive - cd $WD/Slony/staging/osx - tar -jxvf slony-staging.tar.bz2 || _die "Failed to extract the server staging archive" - rm -f slony-staging.tar.bz2 - echo "END BUILD Slony OSX" } @@ -209,6 +214,36 @@ _postprocess_Slony_osx() { echo " Post Process : Slony(OSX)" echo "*******************************************************" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/Slony/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/Slony/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/Slony/staging/osx)" + mkdir -p $WD/Slony/staging/osx || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Slony/staging/osx || _die "Couldn't set the permissions on the staging directory" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/Slony/staging/osx; rm -f Slony-staging.tar.bz2" || _die "Failed to remove archive of the Slony staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/Slony/staging/osx; tar -jcvf Slony-staging.tar.bz2 *" || _die "Failed to create archive of the Slony staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/Slony/staging/osx/slony-staging.tar.bz2 $WD/Slony/staging/osx || _die "Failed to scp Slony staging" + + # Extract the staging archive + cd $WD/Slony/staging/osx + tar -jxvf slony-staging.tar.bz2 || _die "Failed to extract the server staging archive" + rm -f slony-staging.tar.bz2 + + source $WD/Slony/staging/osx/versions-osx.sh + PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SLONY -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/Slony mkdir -p staging/osx/installer/Slony || _die "Failed to create a directory for the install scripts" @@ -248,12 +283,15 @@ _postprocess_Slony_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app/Contents/MacOS/Slony_I_PG$PG_CURRENT_VERSION - chmod a+x $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app/Contents/MacOS/Slony_I_PG$PG_CURRENT_VERSION - cp -f $WD/resources/extract_installbuilder.osx $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ Slony_I_PG$PG_CURRENT_VERSION $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" - chmod a+x $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app/Contents/MacOS/Slony_I_PG$PG_CURRENT_VERSION + chmod a+x $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app/Contents/MacOS/Slony_I_PG$PG_CURRENT_VERSION + cp -f $WD/resources/extract_installbuilder.osx $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ Slony_I_PG$PG_CURRENT_VERSION $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" + chmod a+x $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -261,18 +299,18 @@ _postprocess_Slony_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app.tar.bz2 slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app || _die "Failed to create the archive." + tar -jcvf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app.tar.bz2 slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf slony*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app* || _die "Failed to clean the output directory." + scp slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app; mv slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx-signed.app slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app; mv slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx-signed.app slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.zip slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.zip slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/Slony/build-windows-x64.sh b/Slony/build-windows-x64.sh index b27bfca30..aac2fce78 100755 --- a/Slony/build-windows-x64.sh +++ b/Slony/build-windows-x64.sh @@ -52,7 +52,7 @@ _prep_Slony_windows_x64() { ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST Slony.zip del /S /Q Slony.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\Slony.zip on Windows-x64 VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST Slony.windows-x64 rd /S /Q Slony.windows-x64" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\Slony.windows-x64 directory on Windows-x64 VM" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST Slony.staging rd /S /Q Slony.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\Slony.staging directory on Windows-x64 VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST Slony.staging.build rd /S /Q Slony.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\Slony.staging.build directory on Windows-x64 VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\slony-staging.zip on Windows-x64 VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST build-Slony.bat del /S /Q build-Slony.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\build-Slony.bat on Windows-x64 VM" @@ -104,28 +104,31 @@ EOT # Slony installs it's files into postgresql directory # We need to copy them to staging directory - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging/bin" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/slon/slon.exe $PG_PATH_WINDOWS_X64/Slony.staging/bin" || _die "Failed to copy slon binary to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/slonik/slonik.exe $PG_PATH_WINDOWS_X64/Slony.staging/bin" || _die "Failed to copy slonik binary to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PGBUILD_WINDOWS_X64/bin/pthreadVC2.dll $PG_PATH_WINDOWS_X64/Slony.staging/bin" || _die "Failed to copy slonik binary to staging directory" - - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging/lib" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.$PG_VERSION_SLONY.dll $PG_PATH_WINDOWS_X64/Slony.staging/lib" || _die "Failed to copy slony_funcs.dll to staging directory" - - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging/Slony" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_base.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.v83.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_base.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.v84.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_base.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_funcs.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.v83.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_funcs.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.v84.sql $PG_PATH_WINDOWS_X64/Slony.staging/Slony/slony1_funcs.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging.build/bin" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/slon/slon.exe $PG_PATH_WINDOWS_X64/Slony.staging.build/bin" || _die "Failed to copy slon binary to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/slonik/slonik.exe $PG_PATH_WINDOWS_X64/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PGBUILD_WINDOWS_X64/bin/pthreadVC2.dll $PG_PATH_WINDOWS_X64/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" - # Zip up the installed code, copy it back here, and unpack. - echo "Copying slony built tree to Unix host" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\Slony.staging; cmd /c zip -r ..\\\\slony-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/Slony.staging)" - scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/slony-staging.zip $WD/Slony/staging/windows-x64 || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/slony-staging.zip)" - unzip $WD/Slony/staging/windows-x64/slony-staging.zip -d $WD/Slony/staging/windows-x64 || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/slony-staging.zip)" - rm $WD/Slony/staging/windows-x64/slony-staging.zip + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging.build/lib" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.$PG_VERSION_SLONY.dll $PG_PATH_WINDOWS_X64/Slony.staging.build/lib" || _die "Failed to copy slony_funcs.dll to staging directory" + + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_base.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.v83.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_base.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_base.v84.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_base.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_funcs.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.v83.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_funcs.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/Slony.windows-x64/src/backend/slony1_funcs.v84.sql $PG_PATH_WINDOWS_X64/Slony.staging.build/Slony/slony1_funcs.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + + echo "Removing last successful staging directory ($PG_PATH_WINDOWS_X64/Slony.staging)" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST Slony.staging rd /S /Q Slony.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\Slony.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" +ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c xcopy /E /Q /Y Slony.staging.build\\\\* Slony.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_VERSION_SLONY=$PG_VERSION_SLONY > $PG_PATH_WINDOWS_X64\\\\Slony.staging/versions-windows-x64.sh" || _die "Failed to write replication version number into versions-windows-x64.sh" + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY >> $PG_PATH_WINDOWS_X64\\\\Slony.staging/versions-windows-x64.sh" || _die "Failed to write replication build number into versions-windows-x64.sh" echo "END BUILD Slony Windows-x64" } @@ -140,6 +143,28 @@ _postprocess_Slony_windows_x64() { echo "BEGIN POST Slony Windows-x64" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/Slony/staging/windows-x64 ]; + then + echo "Removing existing staging directory" + rm -rf $WD/Slony/staging/windows-x64 || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/Slony/staging/windows-x64)" + mkdir -p $WD/Slony/staging/windows-x64 || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Slony/staging/windows-x64 || _die "Couldn't set the permissions on the staging directory" + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying slony built tree to Unix host" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\slony-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\Slony.staging; cmd /c zip -r ..\\\\slony-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/Slony.staging)" + scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/slony-staging.zip $WD/Slony/staging/windows-x64 || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/slony-staging.zip)" + unzip $WD/Slony/staging/windows-x64/slony-staging.zip -d $WD/Slony/staging/windows-x64 || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/slony-staging.zip)" + rm $WD/Slony/staging/windows-x64/slony-staging.zip + + dos2unix $WD/Slony/staging/windows-x64/versions-windows-x64.sh || _die "Failed to convert format of versions-windows-x64.sh from dos to unix" + source $WD/Slony/staging/windows-x64/versions-windows-x64.sh + PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) + cd $WD/Slony mkdir -p staging/windows-x64/installer/Slony || _die "Failed to create a directory for the install scripts" @@ -165,8 +190,18 @@ _postprocess_Slony_windows_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win64.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SLONY -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-windows-x64.exe $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows-x64.exe + # Sign the installer - win32_sign "slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-windows-x64.exe" + win32_sign "slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows-x64.exe" cd $WD diff --git a/Slony/build-windows.sh b/Slony/build-windows.sh index 14799262b..3d2dadb50 100755 --- a/Slony/build-windows.sh +++ b/Slony/build-windows.sh @@ -52,7 +52,7 @@ _prep_Slony_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.zip del /S /Q Slony.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.windows rd /S /Q Slony.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.staging rd /S /Q Slony.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.staging.build rd /S /Q Slony.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.staging.build directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\slony-staging.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-Slony.bat del /S /Q build-Slony.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-Slony.bat on Windows VM" @@ -104,28 +104,31 @@ EOT # Slony installs it's files into postgresql directory # We need to copy them to staging directory - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging/bin" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slon/slon.exe $PG_PATH_WINDOWS/Slony.staging/bin" || _die "Failed to copy slon binary to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slonik/slonik.exe $PG_PATH_WINDOWS/Slony.staging/bin" || _die "Failed to copy slonik binary to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PGBUILD_WINDOWS/bin/pthreadVC2.dll $PG_PATH_WINDOWS/Slony.staging/bin" || _die "Failed to copy slonik binary to staging directory" - - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging/lib" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.$PG_VERSION_SLONY.dll $PG_PATH_WINDOWS/Slony.staging/lib" || _die "Failed to copy slony_funcs.dll to staging directory" - - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging/Slony" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_base.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v83.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_base.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v84.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_base.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_funcs.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v83.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_funcs.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v84.sql $PG_PATH_WINDOWS/Slony.staging/Slony/slony1_funcs.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slon/slon.exe $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slon binary to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slonik/slonik.exe $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PGBUILD_WINDOWS/bin/pthreadVC2.dll $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" - # Zip up the installed code, copy it back here, and unpack. - echo "Copying slony built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\Slony.staging; cmd /c zip -r ..\\\\slony-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/Slony.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip $WD/Slony/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip)" - unzip $WD/Slony/staging/windows/slony-staging.zip -d $WD/Slony/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/slony-staging.zip)" - rm $WD/Slony/staging/windows/slony-staging.zip + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/lib" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.$PG_VERSION_SLONY.dll $PG_PATH_WINDOWS/Slony.staging.build/lib" || _die "Failed to copy slony_funcs.dll to staging directory" + + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/Slony" || _die "Failed to create the bin directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v83.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v84.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v83.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v84.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" + + echo "Removing last successful staging directory ($PG_PATH_WINDOWS/Slony.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.staging rd /S /Q Slony.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\Slony.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" +ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y Slony.staging.build\\\\* Slony.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_SLONY=$PG_VERSION_SLONY > $PG_PATH_WINDOWS\\\\Slony.staging/versions-windows.sh" || _die "Failed to write replication version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY >> $PG_PATH_WINDOWS\\\\Slony.staging/versions-windows.sh" || _die "Failed to write replication build number into versions-windows.sh" echo "END BUILD Slony Windows" } @@ -140,6 +143,28 @@ _postprocess_Slony_windows() { echo "BEGIN POST Slony Windows" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/Slony/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/Slony/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/Slony/staging/windows)" + mkdir -p $WD/Slony/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/Slony/staging/windows || _die "Couldn't set the permissions on the staging directory" + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying slony built tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\slony-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\Slony.staging; cmd /c zip -r ..\\\\slony-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/Slony.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip $WD/Slony/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip)" + unzip $WD/Slony/staging/windows/slony-staging.zip -d $WD/Slony/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/slony-staging.zip)" + rm $WD/Slony/staging/windows/slony-staging.zip + + dos2unix $WD/Slony/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/Slony/staging/windows/versions-windows.sh + PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) + cd $WD/Slony mkdir -p staging/windows/installer/Slony || _die "Failed to create a directory for the install scripts" @@ -164,8 +189,18 @@ _postprocess_Slony_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SLONY -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-windows.exe $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-windows.exe" + win32_sign "slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows.exe" cd $WD diff --git a/UpdateMonitor/build-linux-x64.sh b/UpdateMonitor/build-linux-x64.sh index b592615ff..a68753156 100644 --- a/UpdateMonitor/build-linux-x64.sh +++ b/UpdateMonitor/build-linux-x64.sh @@ -35,15 +35,15 @@ _prep_updatemonitor_linux_x64() { cp -R $WD/UpdateMonitor/resources/GetLatestPGInstalled GetLatestPGInstalled.linux-x64 # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/UpdateMonitor/staging/linux-x64 ]; + if [ -e $WD/UpdateMonitor/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/UpdateMonitor/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/UpdateMonitor/staging/linux-x64)" - mkdir -p $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/UpdateMonitor/staging/linux-x64.build)" + mkdir -p $WD/UpdateMonitor/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/UpdateMonitor/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP updatemonitor Linux-x64" } @@ -54,7 +54,7 @@ _prep_updatemonitor_linux_x64() { _build_updatemonitor_linux_x64() { - PG_STAGING=$PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64 + PG_STAGING=$PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build echo "BEGIN BUILD updatemonitor Linux-x64" @@ -71,28 +71,28 @@ _build_updatemonitor_linux_x64() { ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/UpdateMonitor/source/updatemonitor.linux-x64; $PG_QT_LINUX_X64_UM/bin/qmake UpdateManager.pro" || _die "Failed to configure UpdateMonitor on linux-x64" ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/UpdateMonitor/source/updatemonitor.linux-x64; LD_LIBRARY_PATH=/opt/local/Current/lib:$LD_LIBRARY_PATH make" || _die "Failed to build UpdateManger on linux-x64" - mkdir -p $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/bin - mkdir -p $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib - mkdir -p $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/instscripts/bin - mkdir -p $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/instscripts/lib + mkdir -p $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/bin + mkdir -p $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib + mkdir -p $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/instscripts/bin + mkdir -p $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/instscripts/lib echo "Copying UpdateMonitor binary to staging directory" - cp $WD/UpdateMonitor/source/GetLatestPGInstalled.linux-x64/GetLatestPGInstalled $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/instscripts/bin - cp $WD/UpdateMonitor/source/updatemonitor.linux-x64/UpdateManager $WD/UpdateMonitor/staging/linux-x64/UpdateMonitor/bin + cp $WD/UpdateMonitor/source/GetLatestPGInstalled.linux-x64/GetLatestPGInstalled $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/instscripts/bin + cp $WD/UpdateMonitor/source/updatemonitor.linux-x64/UpdateManager $WD/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/bin echo "Copying dependent libraries to staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp /opt/local/Current/lib/libwx_baseud-2.8.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libwx_baseud-2.8.so) in staging directory (linux)-x64" - ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libiconv.so* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libiconv.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libpng12.so* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib" || _die "Failed to copy dependent library (libpng12.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtXml.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtXml.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtNetwork.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtNetwork.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtCore.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtCore.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtGui.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtGui.so) in staging directory (linux-x64)" - ssh $PG_SSH_LINUX_X64 "chmod a+r $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64/UpdateMonitor/lib/*" || _die "Failed to set the permissions on the lib directory" + ssh $PG_SSH_LINUX_X64 "cp /opt/local/Current/lib/libwx_baseud-2.8.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libwx_baseud-2.8.so) in staging directory (linux)-x64" + ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libiconv.so* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libiconv.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libpng12.so* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libpng12.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtXml.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtXml.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtNetwork.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtNetwork.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtCore.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtCore.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "cp $PG_QT_LINUX_X64_UM/lib/libQtGui.so.* $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtGui.so) in staging directory (linux-x64)" + ssh $PG_SSH_LINUX_X64 "chmod a+r $PG_PATH_LINUX_X64/UpdateMonitor/staging/linux-x64.build/UpdateMonitor/lib/*" || _die "Failed to set the permissions on the lib directory" cd $WD - cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/linux-x64/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" - chmod 444 $WD/UpdateMonitor/staging/linux-x64/updatemonitor_license.txt || _die "Unable to change permissions for license file." + cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/linux-x64.build/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" + chmod 444 $WD/UpdateMonitor/staging/linux-x64.build/updatemonitor_license.txt || _die "Unable to change permissions for license file." # Generate debug symbols ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" @@ -106,7 +106,17 @@ _build_updatemonitor_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/UpdateMonitor/staging/linux-x64/symbols $WD/output/symbols/linux-x64/UpdateMonitor || _die "Failed to move $WD/UpdateMonitor/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/UpdateMonitor directory" + mv $WD/UpdateMonitor/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/UpdateMonitor || _die "Failed to move $WD/UpdateMonitor/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/UpdateMonitor directory" + + echo "Removing last successful staging directory ($WD/UpdateMonitor/staging/linux-x64)" + rm -rf $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/UpdateMonitor/staging/linux-x64.build/* $WD/UpdateMonitor/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_UPDATE_MONITOR=$PG_VERSION_UPDATE_MONITOR" > $WD/UpdateMonitor/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_UPDATE_MONITOR=$PG_BUILDNUM_UPDATE_MONITOR" >> $WD/UpdateMonitor/staging/linux-x64/versions-linux-x64.sh echo "END BUILD updatemonitor Linux-x64" @@ -124,7 +134,12 @@ _postprocess_updatemonitor_linux_x64() { echo "**************************************************" echo "* Post-processing - UpdateMonitor (linux-x64) *" echo "**************************************************" - + + source $WD/UpdateMonitor/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_UPDATE_MONITOR=$(expr $PG_BUILD_UPDATE_MONITOR + $SKIPBUILD) + + _registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" + cd $WD/UpdateMonitor pushd staging/linux-x64 @@ -146,6 +161,16 @@ _postprocess_updatemonitor_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer for linux-x64" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_UPDATE_MONITOR -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-linux-x64.run $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST updatemonitor Linux-x64" diff --git a/UpdateMonitor/build-linux.sh b/UpdateMonitor/build-linux.sh index 26ec2d93f..7eaaf7f08 100644 --- a/UpdateMonitor/build-linux.sh +++ b/UpdateMonitor/build-linux.sh @@ -35,15 +35,15 @@ _prep_updatemonitor_linux() { cp -R $WD/UpdateMonitor/resources/GetLatestPGInstalled GetLatestPGInstalled.linux # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/UpdateMonitor/staging/linux ]; + if [ -e $WD/UpdateMonitor/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/UpdateMonitor/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/UpdateMonitor/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/UpdateMonitor/staging/linux)" - mkdir -p $WD/UpdateMonitor/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/UpdateMonitor/staging/linux || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/UpdateMonitor/staging/linux.build)" + mkdir -p $WD/UpdateMonitor/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/UpdateMonitor/staging/linux.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP updatemonitor Linux" } @@ -54,7 +54,7 @@ _prep_updatemonitor_linux() { _build_updatemonitor_linux() { - PG_STAGING=$PG_PATH_LINUX/UpdateMonitor/staging/linux + PG_STAGING=$PG_PATH_LINUX/UpdateMonitor/staging/linux.build echo "BEGIN BUILD updatemonitor Linux" @@ -70,29 +70,29 @@ _build_updatemonitor_linux() { echo "Building & installing UpdateMonitor" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/UpdateMonitor/source/updatemonitor.linux; $PG_QT_LINUX_UM/bin/qmake UpdateManager.pro" || _die "Failed to configuring UpdateMonitor on linux" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/UpdateMonitor/source/updatemonitor.linux; LD_LIBRARY_PATH=/opt/local/Current/lib:$LD_LIBRARY_PATH make" || _die "Failed to build UpdateMonitor on linux" - mkdir -p $WD/UpdateMonitor/staging/linux/UpdateMonitor/bin - mkdir -p $WD/UpdateMonitor/staging/linux/UpdateMonitor/lib - mkdir -p $WD/UpdateMonitor/staging/linux/UpdateMonitor/instscripts/bin - mkdir -p $WD/UpdateMonitor/staging/linux/UpdateMonitor/instscripts/lib + mkdir -p $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/bin + mkdir -p $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/lib + mkdir -p $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/instscripts/bin + mkdir -p $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/instscripts/lib echo "Copying UpdateMonitor binary to staging directory" - cp $WD/UpdateMonitor/source/GetLatestPGInstalled.linux/GetLatestPGInstalled $WD/UpdateMonitor/staging/linux/UpdateMonitor/instscripts/bin - cp $WD/UpdateMonitor/source/updatemonitor.linux/UpdateManager $WD/UpdateMonitor/staging/linux/UpdateMonitor/bin + cp $WD/UpdateMonitor/source/GetLatestPGInstalled.linux/GetLatestPGInstalled $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/instscripts/bin + cp $WD/UpdateMonitor/source/updatemonitor.linux/UpdateManager $WD/UpdateMonitor/staging/linux.build/UpdateMonitor/bin echo "Copying dependent libraries to staging directory (linux)" - ssh $PG_SSH_LINUX "cp /opt/local/Current/lib/libwx_baseud-2.8.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libwx_baseud-2.8.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libiconv.so* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libiconv.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libpng12.so* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib" || _die "Failed to copy dependent library (libpng12.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtXml.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtXml.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtNetwork.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtNetwork.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtCore.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtCore.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtGui.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtGui.so) in staging directory (linux)" - ssh $PG_SSH_LINUX "chmod a+r $PG_PATH_LINUX/UpdateMonitor/staging/linux/UpdateMonitor/lib/*" || _die "Failed to set the read permissions on the lib directory" + ssh $PG_SSH_LINUX "cp /opt/local/Current/lib/libwx_baseud-2.8.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libwx_baseud-2.8.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libiconv.so* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/instscripts/lib" || _die "Failed to copy dependent library (libiconv.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libpng12.so* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libpng12.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtXml.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtXml.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtNetwork.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtNetwork.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtCore.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtCore.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "cp $PG_QT_LINUX_UM/lib/libQtGui.so.* $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib" || _die "Failed to copy dependent library (libQtGui.so) in staging directory (linux)" + ssh $PG_SSH_LINUX "chmod a+r $PG_PATH_LINUX/UpdateMonitor/staging/linux.build/UpdateMonitor/lib/*" || _die "Failed to set the read permissions on the lib directory" cd $WD - cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/linux/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" - chmod 444 $WD/UpdateMonitor/staging/linux/updatemonitor_license.txt || _die "Unable to change permissions for license file." + cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/linux.build/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" + chmod 444 $WD/UpdateMonitor/staging/linux.build/updatemonitor_license.txt || _die "Unable to change permissions for license file." # Generate debug symbols ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" @@ -106,7 +106,17 @@ _build_updatemonitor_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/UpdateMonitor/staging/linux/symbols $WD/output/symbols/linux/UpdateMonitor || _die "Failed to move $WD/UpdateMonitor/staging/linux/symbols to $WD/output/symbols/linux/UpdateMonitor directory" + mv $WD/UpdateMonitor/staging/linux.build/symbols $WD/output/symbols/linux/UpdateMonitor || _die "Failed to move $WD/UpdateMonitor/staging/linux.build/symbols to $WD/output/symbols/linux/UpdateMonitor directory" + + echo "Removing last successful staging directory ($WD/UpdateMonitor/staging/linux)" + rm -rf $WD/UpdateMonitor/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/UpdateMonitor/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/UpdateMonitor/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/UpdateMonitor/staging/linux.build/* $WD/UpdateMonitor/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_UPDATE_MONITOR=$PG_VERSION_UPDATE_MONITOR" > $WD/UpdateMonitor/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_UPDATE_MONITOR=$PG_BUILDNUM_UPDATE_MONITOR" >> $WD/UpdateMonitor/staging/linux/versions-linux.sh echo "END BUILD updatemonitor Linux" } @@ -124,6 +134,11 @@ _postprocess_updatemonitor_linux() { echo "* Post-processing - UpdateMonitor (linux) *" echo "**********************************************" + source $WD/UpdateMonitor/staging/linux/versions-linux.sh + PG_BUILD_UPDATE_MONITOR=$(expr $PG_BUILD_UPDATE_MONITOR + $SKIPBUILD) + + _registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" + cd $WD/UpdateMonitor pushd staging/linux @@ -145,6 +160,16 @@ _postprocess_updatemonitor_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer for linux" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_UPDATE_MONITOR -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-linux.run $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}linux.run + cd $WD echo "END POST updatemonitor Linux" diff --git a/UpdateMonitor/build-osx.sh b/UpdateMonitor/build-osx.sh index 1970e1dfd..90ede68cf 100644 --- a/UpdateMonitor/build-osx.sh +++ b/UpdateMonitor/build-osx.sh @@ -47,7 +47,11 @@ _prep_updatemonitor_osx() { chmod ugo+w $WD/UpdateMonitor/staging/osx || _die "Couldn't set the permissions on the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/UpdateMonitor ]; then rm -rf $PG_PATH_OSX/UpdateMonitor/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/source" || _die "Falied to clean the UpdateMonitor/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/scripts" || _die "Falied to clean the UpdateMonitor/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/*.bz2" || _die "Falied to clean the UpdateMonitor/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/*.sh" || _die "Falied to clean the UpdateMonitor/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/staging/osx.build" || _die "Falied to clean the UpdateMonitor/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/UpdateMonitor/source" || _die "Failed to create the source dircetory on the build VM" @@ -134,36 +138,34 @@ EOT cd $PG_PATH_OSX/UpdateMonitor/source echo "Copy the UpdateMonitor app bundle into place" - mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx/ - cp -R $PG_PATH_OSX/UpdateMonitor/source/updatemonitor.osx/UpdateMonitor.app $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor.app || _die "Failed to copy UpdateMonitor into the staging directory" + mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx.build/ + cp -R $PG_PATH_OSX/UpdateMonitor/source/updatemonitor.osx/UpdateMonitor.app $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor.app || _die "Failed to copy UpdateMonitor into the staging directory" - mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/bin - mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/lib + mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/bin + mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/lib - cp $PG_PATH_OSX/UpdateMonitor/source/GetLatestPGInstalled.osx/GetLatestPGInstalled $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/bin - cp /opt/local/Current/lib/libwx_base_carbonud-2.8.0.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/lib - cp -pR /opt/local/Current/lib/libiconv*.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/lib - cp -pR /opt/local/Current/lib/libz*.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts/lib + cp $PG_PATH_OSX/UpdateMonitor/source/GetLatestPGInstalled.osx/GetLatestPGInstalled $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/bin + cp /opt/local/Current/lib/libwx_base_carbonud-2.8.0.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/lib + cp -pR /opt/local/Current/lib/libiconv*.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/lib + cp -pR /opt/local/Current/lib/libz*.dylib $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts/lib - _rewrite_so_refs $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts bin @loader_path/.. - _rewrite_so_refs $PG_PATH_OSX/UpdateMonitor/staging/osx/UpdateMonitor/instscripts lib @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts bin @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/UpdateMonitor/staging/osx.build/UpdateMonitor/instscripts lib @loader_path/.. EOT-UPDATEMONITOR cd $WD scp UpdateMonitor/build-updatemonitor.sh $PG_SSH_OSX:$PG_PATH_OSX/UpdateMonitor ssh $PG_SSH_OSX "cd $PG_PATH_OSX/UpdateMonitor; sh ./build-updatemonitor.sh" || _die "Failed to build UpdateMonitor on OSX" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/UpdateMonitor/staging/osx; tar -jcvf updatemonitor-staging.tar.bz2 *" || _die "Failed to create archive of the updatemonitor staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/UpdateMonitor/staging/osx/updatemonitor-staging.tar.bz2 $WD/UpdateMonitor/staging/osx || _die "Failed to scp updatemonitor staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/UpdateMonitor/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/UpdateMonitor/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/UpdateMonitor/staging/osx" || _die "Couldn't create the last successful staging directory" - # Extract the staging archive - cd $WD/UpdateMonitor/staging/osx - tar -jxvf updatemonitor-staging.tar.bz2 || _die "Failed to extract the updatemonitor staging archive" - rm -f updatemonitor-staging.tar.bz2 - - cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/osx/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" - chmod 444 $WD/UpdateMonitor/staging/osx/updatemonitor_license.txt || _die "Unable to change permissions for license file." + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR UpdateMonitor/staging/osx.build/* UpdateMonitor/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_UPDATE_MONITOR=$PG_VERSION_UPDATE_MONITOR > $PG_PATH_OSX/UpdateMonitor/staging/osx/versions-osx.sh" || _die "Failed to write UpdateMonitor version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_UPDATE_MONITOR=$PG_BUILDNUM_UPDATE_MONITOR >> $PG_PATH_OSX/UpdateMonitor/staging/osx/versions-osx.sh" || _die "Failed to write UpdateMonitor build number into versions-osx.sh" echo "END BUILD updatemonitor OSX" } @@ -180,6 +182,41 @@ _postprocess_updatemonitor_osx() { echo "* Post-processing - UpdateMonitor (osx) *" echo "********************************************" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/UpdateMonitor/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/UpdateMonitor/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/UpdateMonitor/staging/osx)" + mkdir -p $WD/UpdateMonitor/staging/osx || _die "Couldn't create the staging directory" + chmod ugo+w $WD/UpdateMonitor/staging/osx || _die "Couldn't set the permissions on the staging directory" + + _registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/UpdateMonitor/staging/osx; rm -f updatemonitor-staging.tar.bz2" || _die "Failed to remove archive of the UpdateMonitor staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/UpdateMonitor/staging/osx; tar -jcvf updatemonitor-staging.tar.bz2 *" || _die "Failed to create archive of the updatemonitor staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/UpdateMonitor/staging/osx/updatemonitor-staging.tar.bz2 $WD/UpdateMonitor/staging/osx || _die "Failed to scp updatemonitor staging" + + # Extract the staging archive + cd $WD/UpdateMonitor/staging/osx + tar -jxvf updatemonitor-staging.tar.bz2 || _die "Failed to extract the updatemonitor staging archive" + rm -f updatemonitor-staging.tar.bz2 + + cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/osx/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" + chmod 444 $WD/UpdateMonitor/staging/osx/updatemonitor_license.txt || _die "Unable to change permissions for license file." + + source $WD/UpdateMonitor/staging/osx/versions-osx.sh + PG_BUILD_UPDATE_MONITOR=$(expr $PG_BUILD_UPDATE_MONITOR + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_UPDATE_MONITOR -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/UpdateMonitor pushd staging/osx generate_3rd_party_license "updatemonitor" @@ -219,12 +256,15 @@ _postprocess_updatemonitor_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer (UpdateMonitor)" + # Rename the installer + mv $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/Contents/MacOS/UpdateMonitor - chmod a+x $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/Contents/MacOS/UpdateMonitor - cp -f $WD/resources/extract_installbuilder.osx $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ UpdateMonitor $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/Contents/MacOS/installbuilder.sh - chmod a+x $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/Contents/MacOS/UpdateMonitor + chmod a+x $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/Contents/MacOS/UpdateMonitor + cp -f $WD/resources/extract_installbuilder.osx $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ UpdateMonitor $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + chmod a+x $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh # Zip up the output cd $WD/output @@ -233,17 +273,17 @@ _postprocess_updatemonitor_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app.tar.bz2 edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app + tar -jcvf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app.tar.bz2 edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf update*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ - rm -fr edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app* + scp edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ + rm -fr edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app* # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app; mv edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx-signed.app edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app; mv edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx-signed.app edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.zip edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.app/" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.zip edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.app/" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/UpdateMonitor/build-windows.sh b/UpdateMonitor/build-windows.sh index 499d48292..2d30ee041 100644 --- a/UpdateMonitor/build-windows.sh +++ b/UpdateMonitor/build-windows.sh @@ -6,7 +6,7 @@ ################################################################################ _prep_updatemonitor_windows() { - + echo "BEGIN PREP updatemonitor Windows" echo "****************************************" @@ -76,7 +76,7 @@ _prep_updatemonitor_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST GetLatestPGInstalled.zip del /Q GetLatestPGInstalled.zip" || _die"Couldn't remove the $PG_PATH_WINDOWS\\UpdateMonitor.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST updatemonitor.windows rd /S /Q updatemonitor.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\updatemonitor.windows directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST GetLatestPGInstalled.windows rd /S /Q GetLatestPGInstalled.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\GetLatestPGInstalled.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST updatemonitor.staging rd /S /Q updatemonitor.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\UpdateMonitor.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST updatemonitor.staging.build rd /S /Q updatemonitor.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\UpdateMonitor.staging directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-um.bat del /Q build-um.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-um.bat on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST um_output.zip del /Q um_output.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\um_output.zipon Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST vc-build.bat del /Q vc-build.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\vc-build.bat on Windows VM" @@ -86,7 +86,7 @@ _prep_updatemonitor_windows() { scp GetLatestPGInstalled.zip $PG_SSH_WINDOWS:$PG_PATH_WINDOWS || _die "Couldn't copy the UpdateMonitor archieve to Windows VM (GetLatestPGInstalled.zip)" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip updatemonitor.zip" || _die "Couldn't extract UpdateMonitor archieve on Windows VM (updatemonitor.zip)" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip GetLatestPGInstalled.zip" || _die "Couldn't extract GetLatestPGInstalled archieve on Windows VM (GetLatestPGInstalled.zip)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; mkdir -p updatemonitor.staging" || _die "Couldn't create updatemonitor.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; mkdir -p updatemonitor.staging.build" || _die "Couldn't create updatemonitor.staging.build directory on Windows VM" echo "END PREP updatemonitor Windows" } @@ -104,7 +104,7 @@ _build_updatemonitor_windows() { echo "**************************************" # build UpdateMonitor - PG_STAGING=$PG_PATH_WINDOWS\\\\updatemonitor.staging + PG_STAGING=$PG_PATH_WINDOWS\\\\updatemonitor.staging.build cd $WD/UpdateMonitor/source/updatemonitor.windows @@ -154,16 +154,16 @@ ECHO *************************************** cd "%SOURCE_PATH%\updatemonitor.windows" "%QMAKE%" UpdateManager.pro || SET ERRMSG=ERROR: Couldn't configure the UpdateMonitor on Windows && GOTO EXIT_WITH_ERROR nmake -f Makefile.Release || SET ERRMSG=ERROR: Couldn't build the UpdateManager && GOTO EXIT_WITH_ERROR -mkdir %SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\bin -mkdir %SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\instscripts\bin -copy release\UpdManager.exe %SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\bin\ || SET ERRMSG=ERROR: Couldn't copy the UpdateMonitor binary to staging directory && GOTO EXIT_WITH_ERROR -copy %SOURCE_PATH%\GetLatestPGInstalled.windows\release\GetLatestPGInstalled.exe %SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\instscripts\bin\ || SET ERRMSG=ERROR: Couldn't copy the UpdateMonitor binary to staging directory && GOTO EXIT_WITH_ERROR -copy "$PG_WXWIN_WINDOWS\lib\vc_dll\wxbase28u_vc_custom.dll" %SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\instscripts\bin\ || SET ERRMSG=ERROR: Couldn't copy dependent library (wxbase28u_vc_custom.dll) && GOTO EXIT_WITH_ERROR +mkdir %SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\bin +mkdir %SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\instscripts\bin +copy release\UpdManager.exe %SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\bin\ || SET ERRMSG=ERROR: Couldn't copy the UpdateMonitor binary to staging directory && GOTO EXIT_WITH_ERROR +copy %SOURCE_PATH%\GetLatestPGInstalled.windows\release\GetLatestPGInstalled.exe %SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\instscripts\bin\ || SET ERRMSG=ERROR: Couldn't copy the UpdateMonitor binary to staging directory && GOTO EXIT_WITH_ERROR +copy "$PG_WXWIN_WINDOWS\lib\vc_dll\wxbase28u_vc_custom.dll" %SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\instscripts\bin\ || SET ERRMSG=ERROR: Couldn't copy dependent library (wxbase28u_vc_custom.dll) && GOTO EXIT_WITH_ERROR ECHO ******************************************************************************************* ECHO * Collecting dependent libraries and Archieving all binaries in one file (um_output.zip) * ECHO ******************************************************************************************* -cd "%SOURCE_PATH%\updatemonitor.staging\UpdateMonitor\bin" +cd "%SOURCE_PATH%\updatemonitor.staging.build\UpdateMonitor\bin" echo Copying Qt5Core dll copy "%QT_PATH%\bin\Qt5Core.dll" . || SET ERRMSG=ERROR: Couldn't copy dependent library (Qt5Core.dll) && GOTO EXIT_WITH_ERROR echo Copying Qt5Network dll @@ -178,8 +178,8 @@ copy "%QT_PATH%\bin\libEGL.dll" . || SET ERRMSG=ERROR: Couldn't copy dependent l xcopy /f %QT_PATH%\plugins\platforms\qwindows.dll .\plugins\platforms\ /s /i || SET ERRMSG=ERROR: Couldn't copy dependent library (qwindows.dll) && GOTO EXIT_WITH_ERROR copy "$PG_PGBUILD_WINDOWS\vcredist\vcredist_x86.exe" . || SET ERRMSG=ERROR: Couldn't copy dependent library (Qt5Xml.dll) && GOTO EXIT_WITH_ERROR -cd "%SOURCE_PATH%\updatemonitor.staging" -zip -r ..\um_output.zip * || SET ERRMSG=ERROR: Couldn't archieve the UpdateMonitor binaries && GOTO EXIT_WITH_ERROR +REM cd "%SOURCE_PATH%\updatemonitor.staging.build" +REM zip -r ..\um_output.zip * || SET ERRMSG=ERROR: Couldn't archieve the UpdateMonitor binaries && GOTO EXIT_WITH_ERROR ECHO Completed Successfully. exit 0 @@ -196,25 +196,17 @@ Libraries=./plugins EOT scp build-um.bat $PG_SSH_WINDOWS:$PG_PATH_WINDOWS || _die "Couldn't copy build-um.bat in staging directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c build-um.bat" || _die "Error building UpdateMonitor binaries on Windows VM" - # Remove output archieve, if exists - if [ -f um_output.zip ]; - then - rm -f um_output.zip - fi - cd $WD/UpdateMonitor/staging/windows - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/um_output.zip . + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\updatemonitor.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST updatemonitor.staging rd /S /Q updatemonitor.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\updatemonitor.staging" || _die "Couldn't create the last successful staging directory" - unzip um_output.zip - rm -f um_output.zip - - cp $WD/UpdateMonitor/source/updatemonitor.windows/qt.conf $WD/UpdateMonitor/staging/windows/UpdateMonitor/bin - - win32_sign "UpdManager.exe" "$WD/UpdateMonitor/staging/windows/UpdateMonitor/bin" + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y updatemonitor.staging.build\\\\* updatemonitor.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_UPDATE_MONITOR=$PG_VERSION_UPDATE_MONITOR > $PG_PATH_WINDOWS\\\\updatemonitor.staging/versions-windows.sh" || _die "Failed to write updatemonitor version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_UPDATE_MONITOR=$PG_BUILDNUM_UPDATE_MONITOR >> $PG_PATH_WINDOWS\\\\updatemonitor.staging/versions-windows.sh" || _die "Failed to write updatemonitor build number into versions-windows.sh" - cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/windows/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" - chmod 444 $WD/UpdateMonitor/staging/windows/updatemonitor_license.txt || _die "Unable to change permissions for license file." - echo "END BUILD updtemonitor Windows" } @@ -226,7 +218,50 @@ EOT _postprocess_updatemonitor_windows() { echo "BEGIN POST updatemonitor Windows" - + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/UpdateMonitor/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/UpdateMonitor/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/UpdateMonitor/staging/windows)" + mkdir -p $WD/UpdateMonitor/staging/windows || _die "Couldn't create the staging directory" + mkdir -p $WD/UpdateMonitor/staging/windows/share || _die "Couldn't create the staging/share directory" + chmod ugo+w $WD/UpdateMonitor/staging/windows || _die "Couldn't set the permissions on the staging directory" + + _registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" + + cd $WD/UpdateMonitor/staging/windows + echo "Copying built tree to Windows host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST um_output.zip del /S /Q um_output.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\um_output.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\updatemonitor.staging; cmd /c zip -r um_output.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$OUTPUT_DIR)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\updatemonitor.staging\\\\um_output.zip $WD/UpdateMonitor/staging/windows/um_output.zip || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\um_output.zip)" + unzip -o $WD/UpdateMonitor/staging/windows/um_output.zip -d $WD/UpdateMonitor/staging/windows || _die "Failed to unpack the built source tree ($WD/UpdateMonitor/staging/windows/um_output.zip)" + rm -f $WD/UpdateMonitor/staging/windows/um_output.zip + +## # Remove output archieve, if exists +## if [ -f um_output.zip ]; +## then +## rm -f um_output.zip +## fi +## +## cd $WD/UpdateMonitor/staging/windows +## scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/um_output.zip . +## +## unzip um_output.zip +## rm -f um_output.zip + + dos2unix $WD/UpdateMonitor/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/UpdateMonitor/staging/windows/versions-windows.sh + PG_BUILD_UPDATE_MONITOR=$(expr $PG_BUILD_UPDATE_MONITOR + $SKIPBUILD) + + cp $WD/UpdateMonitor/source/updatemonitor.windows/qt.conf $WD/UpdateMonitor/staging/windows/UpdateMonitor/bin + + win32_sign "UpdManager.exe" "$WD/UpdateMonitor/staging/windows/UpdateMonitor/bin" + + cp $WD/UpdateMonitor/resources/licence.txt $WD/UpdateMonitor/staging/windows/updatemonitor_license.txt || _die "Unable to copy updatemonitor_license.txt" + chmod 444 $WD/UpdateMonitor/staging/windows/updatemonitor_license.txt || _die "Unable to change permissions for license file." cd $WD/UpdateMonitor pushd staging/windows @@ -247,9 +282,19 @@ _postprocess_updatemonitor_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_UPDATE_MONITOR -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-windows.exe $WD/output/edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-windows.exe" - + win32_sign "edb-updatemonitor-$PG_VERSION_UPDATE_MONITOR-$PG_BUILDNUM_UPDATE_MONITOR-${BUILD_FAILED}windows.exe" + cd $WD echo "END POST updatemonitor Windows" diff --git a/UpdateMonitor/build.sh b/UpdateMonitor/build.sh index 6ae5d424b..518f18076 100644 --- a/UpdateMonitor/build.sh +++ b/UpdateMonitor/build.sh @@ -174,7 +174,7 @@ _postprocess_updatemonitor() { _replace PG_BUILDNUM_UPDATE_MONITOR $PG_BUILDNUM_UPDATE_MONITOR installer.xml || _die "Failed to set the Build Number in the installer project file (UpdateMonitor/installer.xml)" #_registration_plus_postprocess(STAGING DIRECTORY, COMPONENT NAME, VERSION VARIABLE, INI, REGISTRY_PREFIX, REGISTRY_PREFIX_WIN, COMONENT TYPE PRODUCT_DESCRIPTION, PRODUCT_VERSION) - _registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" + ##_registration_plus_postprocess "$WD/UpdateMonitor/staging" "UpdateMonitor" "iUMVersion" "/etc/postgres-reg.ini" "UpdateMonitor" "UpdateMonitor" "UpdateMonitor" "$PG_VERSION_UPDATE_MONITOR" # Mac OSX if [ $PG_ARCH_OSX = 1 ]; diff --git a/build.sh b/build.sh index 50ce0c9ca..aaa6ebbf7 100755 --- a/build.sh +++ b/build.sh @@ -162,13 +162,15 @@ then cd $WD source ./server/build.sh + PG_BUILD_SERVER=0 if [ $SKIPBUILD = 0 ]; then - _prep_server || exit 1 - _build_server || exit 1 + (_prep_server && _build_server) + if [ $? == 0 ]; then + PG_BUILD_SERVER=1 + fi fi - - _postprocess_server || exit 1 + (_postprocess_server) fi # Package: LanguagePack @@ -177,12 +179,15 @@ then cd $WD source ./languagepack/build.sh + PG_BUILD_LANGUAGEPACK=0 if [ $SKIPBUILD = 0 ]; then - _prep_languagepack || exit 1 - _build_languagepack || exit 1 + (_prep_languagepack && _build_languagepack) + if [ $? == 0 ]; then + PG_BUILD_LANGUAGEPACK=1 + fi fi - _postprocess_languagepack || exit 1 + (_postprocess_languagepack) fi # Package: ApachePhp @@ -192,29 +197,33 @@ then cd $WD source ./ApachePhp/build.sh + PG_BUILD_APACHEPHP=0 if [ $SKIPBUILD = 0 ]; then - _prep_ApachePhp || exit 1 - _build_ApachePhp || exit 1 + (_prep_ApachePhp && _build_ApachePhp) + if [ $? == 0 ]; then + PG_BUILD_APACHEPHP=1 + fi fi - - _postprocess_ApachePhp || exit 1 + (_postprocess_ApachePhp) fi -# Package: ApacheHTTPD -if [ $PG_PACKAGE_APACHEHTTPD = 1 ]; +# Package: PEM-HTTPD +if [ $PG_PACKAGE_PEMHTTPD = 1 ]; then - echo "### Package: ApacheHTTPD" + echo "### Package: PEM-HTTPD" cd $WD - source ./ApacheHTTPD/build.sh + source ./PEM-HTTPD/build.sh + PG_BUILD_PEMHTTPD=0 if [ $SKIPBUILD = 0 ]; then - _prep_ApacheHTTPD || exit 1 - _build_ApacheHTTPD || exit 1 + (_prep_PEM-HTTPD && _build_PEM-HTTPD) + if [ $? == 0 ]; then + PG_BUILD_PEMHTTPD=1 + fi fi - - _postprocess_ApacheHTTPD || exit 1 + (_postprocess_PEM-HTTPD) fi # Package: phppgadmin @@ -224,13 +233,15 @@ then cd $WD source ./phpPgAdmin/build.sh + PG_BUILD_PHPPGADMIN=0 if [ $SKIPBUILD = 0 ]; then - _prep_phpPgAdmin || exit 1 - _build_phpPgAdmin || exit 1 + (_prep_phpPgAdmin && _build_phpPgAdmin) + if [ $? == 0 ]; then + PG_BUILD_PHPPGADMIN=1 + fi fi - - _postprocess_phpPgAdmin || exit 1 + (_postprocess_phpPgAdmin) fi # Package: pgJDBC @@ -240,13 +251,15 @@ then cd $WD source ./pgJDBC/build.sh + PG_BUILD_PGJDBC=0 if [ $SKIPBUILD = 0 ]; then - _prep_pgJDBC || exit 1 - _build_pgJDBC || exit 1 + (_prep_pgJDBC && _build_pgJDBC) + if [ $? == 0 ]; then + PG_BUILD_PGJDBC=1 + fi fi - - _postprocess_pgJDBC || exit 1 + (_postprocess_pgJDBC) fi # Package: psqlODBC @@ -256,13 +269,15 @@ then cd $WD source ./psqlODBC/build.sh + PG_BUILD_PSQLODBC=0 if [ $SKIPBUILD = 0 ]; then - _prep_psqlODBC || exit 1 - _build_psqlODBC || exit 1 + (_prep_psqlODBC && _build_psqlODBC) + if [ $? == 0 ]; then + PG_BUILD_PSQLODBC=1 + fi fi - - _postprocess_psqlODBC || exit 1 + (_postprocess_psqlODBC) fi # Package: PostGIS @@ -272,13 +287,15 @@ then cd $WD source ./PostGIS/build.sh + PG_BUILD_POSTGIS=0 if [ $SKIPBUILD = 0 ]; then - _prep_PostGIS || exit 1 - _build_PostGIS || exit 1 + (_prep_PostGIS && _build_PostGIS) + if [ $? == 0 ]; then + PG_BUILD_POSTGIS=1 + fi fi - - _postprocess_PostGIS || exit 1 + (_postprocess_PostGIS) fi # Package: Slony @@ -288,12 +305,15 @@ then cd $WD source ./Slony/build.sh + PG_BUILD_SLONY=0 if [ $SKIPBUILD = 0 ]; then - _prep_Slony || exit 1 - _build_Slony || exit 1 + (_prep_Slony && _build_Slony) + if [ $? == 0 ]; then + PG_BUILD_SLONY=1 + fi fi - _postprocess_Slony || exit 1 + (_postprocess_Slony) fi # Package: Npgsql @@ -303,12 +323,15 @@ then cd $WD source ./Npgsql/build.sh + PG_BUILD_NPGSQL=0 if [ $SKIPBUILD = 0 ]; then - _prep_Npgsql || exit 1 - _build_Npgsql || exit 1 + (_prep_Npgsql && _build_Npgsql) + if [ $? == 0 ]; then + PG_BUILD_NPGSQL=1 + fi fi - _postprocess_Npgsql || exit 1 + (_postprocess_Npgsql) fi # Package: pgAgent @@ -318,12 +341,15 @@ then cd $WD source ./pgAgent/build.sh + PG_BUILD_PGAGENT=0 if [ $SKIPBUILD = 0 ]; then - _prep_pgAgent || exit 1 - _build_pgAgent || exit 1 + (_prep_pgAgent && _build_pgAgent) + if [ $? == 0 ]; then + PG_BUILD_PGAGENT=1 + fi fi - _postprocess_pgAgent || exit 1 + (_postprocess_pgAgent) fi # Package: pgmemcache @@ -333,12 +359,15 @@ then cd $WD source ./pgmemcache/build.sh + PG_BUILD_PGMEMCACHE=0 if [ $SKIPBUILD = 0 ]; then - _prep_pgmemcache || exit 1 - _build_pgmemcache || exit 1 + (_prep_pgmemcache && _build_pgmemcache) + if [ $? == 0 ]; then + PG_BUILD_PGMEMCACHE=1 + fi fi - _postprocess_pgmemcache || exit 1 + (_postprocess_pgmemcache) fi # Package: pgbouncer @@ -348,12 +377,15 @@ then cd $WD source ./pgbouncer/build.sh + PG_BUILD_PGBOUNCER=0 if [ $SKIPBUILD = 0 ]; then - _prep_pgbouncer || exit 1 - _build_pgbouncer || exit 1 + (_prep_pgbouncer && _build_pgbouncer) + if [ $? == 0 ]; then + PG_BUILD_PGBOUNCER=1 + fi fi - _postprocess_pgbouncer || exit 1 + (_postprocess_pgbouncer) fi #Package: MigrationToolKit @@ -361,12 +393,16 @@ if [ $PG_PACKAGE_MIGRATIONTOOLKIT = 1 ]; then cd $WD source ./MigrationToolKit/build.sh + + PG_BUILD_MIGRATIONTOOLKIT=0 if [ $SKIPBUILD = 0 ]; then - _prep_MigrationToolKit || exit 1 - _build_MigrationToolKit || exit 1 + (_prep_MigrationToolKit && _build_MigrationToolKit) + if [ $? == 0 ]; then + PG_BUILD_MIGRATIONTOOLKIT=1 + fi fi - _postprocess_MigrationToolKit || exit 1 + (_postprocess_MigrationToolKit) fi # Package: SQLPROTECT @@ -375,13 +411,15 @@ then cd $WD source ./sqlprotect/build.sh + PG_BUILD_SQLPROTECT=0 if [ $SKIPBUILD = 0 ]; then - _prep_sqlprotect || exit 1 - _build_sqlprotect || exit 1 + (_prep_sqlprotect && _build_sqlprotect) + if [ $? == 0 ]; then + PG_BUILD_SQLPROTECT=1 + fi fi - - _postprocess_sqlprotect || exit 1 + (_postprocess_sqlprotect) fi # Package: UPDATE_MONITOR @@ -390,13 +428,15 @@ then cd $WD source ./UpdateMonitor/build.sh + PG_BUILD_UPDATE_MONITOR=0 if [ $SKIPBUILD = 0 ]; then - _prep_updatemonitor || exit 1 - _build_updatemonitor || exit 1 + (_prep_updatemonitor && _build_updatemonitor) + if [ $? == 0 ]; then + PG_BUILD_UPDATE_MONITOR=1 + fi fi - - _postprocess_updatemonitor || exit 1 + (_postprocess_updatemonitor) fi # Package: hdfs_fdw @@ -405,12 +445,15 @@ then cd $WD source ./hdfs_fdw/build.sh + PG_BUILD_HDFS_FDW=0 if [ $SKIPBUILD = 0 ]; then - _prep_hdfs_fdw || exit 1 - _build_hdfs_fdw || exit 1 + (_prep_hdfs_fdw && _build_hdfs_fdw) + if [ $? == 0 ]; then + PG_BUILD_HDFS_FDW=1 + fi fi - _postprocess_hdfs_fdw || exit 1 + (_postprocess_hdfs_fdw) fi # Check for private builds @@ -423,6 +466,5 @@ then fi fi - # Archive the symbols _archive_symbols diff --git a/pgAgent/build-linux-x64.sh b/pgAgent/build-linux-x64.sh index ab6bb9550..a6c9262ca 100755 --- a/pgAgent/build-linux-x64.sh +++ b/pgAgent/build-linux-x64.sh @@ -29,14 +29,14 @@ _prep_pgAgent_linux_x64() { cp -R pgAgent-$PG_VERSION_PGAGENT-Source/* pgAgent.linux-x64 || _die "Failed to copy the source code (source/pgAgent-$PG_VERSION_PGAGENT)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgAgent/staging/linux-x64 ]; + if [ -e $WD/pgAgent/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgAgent/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgAgent/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgAgent/staging/linux-x64)" - mkdir -p $WD/pgAgent/staging/linux-x64 || _die "Couldn't create the staging directory" + echo "Creating staging directory ($WD/pgAgent/staging/linux-x64.build)" + mkdir -p $WD/pgAgent/staging/linux-x64.build || _die "Couldn't create the staging directory" echo "END PREP pgAgent Linux-x64" @@ -56,7 +56,7 @@ _build_pgAgent_linux_x64() { cd $WD/pgAgent - PG_STAGING=$PG_PATH_LINUX_X64/pgAgent/staging/linux-x64 + PG_STAGING=$PG_PATH_LINUX_X64/pgAgent/staging/linux-x64.build SOURCE_DIR=$PG_PATH_LINUX_X64/pgAgent/source/pgAgent.linux-x64 echo "Building pgAgent sources" @@ -112,7 +112,17 @@ _build_pgAgent_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/pgAgent/staging/linux-x64/symbols $WD/output/symbols/linux-x64/pgAgent || _die "Failed to move $WD/pgAgent/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/pgAgent directory" + mv $WD/pgAgent/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/pgAgent || _die "Failed to move $WD/pgAgent/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/pgAgent directory" + + echo "Removing last successful staging directory ($WD/pgAgent/staging/linux-x64)" + rm -rf $WD/pgAgent/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgAgent/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgAgent/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgAgent/staging/linux-x64.build/* $WD/pgAgent/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGAGENT=$PG_VERSION_PGAGENT" > $WD/pgAgent/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_PGAGENT=$PG_BUILDNUM_PGAGENT" >> $WD/pgAgent/staging/linux-x64/versions-linux-x64.sh echo "END BUILD pgAgent Linux-x64" } @@ -130,6 +140,9 @@ _postprocess_pgAgent_linux_x64() { echo "# pgAgent : LINUX-X64 : Post Process #" echo "###########################################" + source $WD/pgAgent/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_PGAGENT=$(expr $PG_BUILD_PGAGENT + $SKIPBUILD) + # Setup the installer scripts. mkdir -p $WD/pgAgent/staging/linux-x64/installer/pgAgent || _die "Failed to create a directory for the install scripts" @@ -149,6 +162,16 @@ _postprocess_pgAgent_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGAGENT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-linux-x64.run $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST pgAgent Linux-x64" diff --git a/pgAgent/build-linux.sh b/pgAgent/build-linux.sh index 979a04ed9..3f4a2853f 100644 --- a/pgAgent/build-linux.sh +++ b/pgAgent/build-linux.sh @@ -27,14 +27,14 @@ _prep_pgAgent_linux() { cp -R pgAgent-$PG_VERSION_PGAGENT-Source pgAgent.linux || _die "Failed to copy the source code (source/pgAgent-$PG_VERSION_PGAGENT-Source)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgAgent/staging/linux ]; + if [ -e $WD/pgAgent/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgAgent/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgAgent/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgAgent/staging/linux)" - mkdir -p $WD/pgAgent/staging/linux || _die "Couldn't create the staging directory" + echo "Creating staging directory ($WD/pgAgent/staging/linux.build)" + mkdir -p $WD/pgAgent/staging/linux.build || _die "Couldn't create the staging directory" echo "END PREP pgAgent Linux" @@ -54,7 +54,7 @@ _build_pgAgent_linux() { cd $WD/pgAgent - PG_STAGING=$PG_PATH_LINUX/pgAgent/staging/linux + PG_STAGING=$PG_PATH_LINUX/pgAgent/staging/linux.build SOURCE_DIR=$PG_PATH_LINUX/pgAgent/source/pgAgent.linux echo "Building pgAgent sources" @@ -102,7 +102,17 @@ _build_pgAgent_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/pgAgent/staging/linux/symbols $WD/output/symbols/linux/pgAgent || _die "Failed to move $WD/pgAgent/staging/linux/symbols to $WD/output/symbols/linux/pgAgent directory" + mv $WD/pgAgent/staging/linux.build/symbols $WD/output/symbols/linux/pgAgent || _die "Failed to move $WD/pgAgent/staging/linux.build/symbols to $WD/output/symbols/linux/pgAgent directory" + + echo "Removing last successful staging directory ($WD/pgAgent/staging/linux)" + rm -rf $WD/pgAgent/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgAgent/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgAgent/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgAgent/staging/linux.build/* $WD/pgAgent/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGAGENT=$PG_VERSION_PGAGENT" > $WD/pgAgent/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_PGAGENT=$PG_BUILDNUM_PGAGENT" >> $WD/pgAgent/staging/linux/versions-linux.sh echo "END BUILD pgAgent Linux" } @@ -120,6 +130,9 @@ _postprocess_pgAgent_linux() { echo "# pgAgent : LINUX : Post Process #" echo "#######################################" + source $WD/pgAgent/staging/linux/versions-linux.sh + PG_BUILD_PGAGENT=$(expr $PG_BUILD_PGAGENT + $SKIPBUILD) + # Setup the installer scripts. mkdir -p $WD/pgAgent/staging/linux/installer/pgAgent || _die "Failed to create a directory for the install scripts" @@ -139,6 +152,16 @@ _postprocess_pgAgent_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGAGENT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-linux.run $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}linux.run + cd $WD echo "END POST pgAgent Linux" diff --git a/pgAgent/build-osx.sh b/pgAgent/build-osx.sh index e4a4f2b0b..f672cb7b1 100644 --- a/pgAgent/build-osx.sh +++ b/pgAgent/build-osx.sh @@ -40,7 +40,11 @@ _prep_pgAgent_osx() { mkdir -p $WD/pgAgent/staging/osx || _die "Couldn't create the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/pgAgent ]; then rm -rf $PG_PATH_OSX/pgAgent/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/source" || _die "Falied to clean the pgAgent/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/scripts" || _die "Falied to clean the pgAgent/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/*.bz2" || _die "Falied to clean the pgAgent/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/*.sh" || _die "Falied to clean the pgAgent/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/staging/osx.build" || _die "Falied to clean the pgAgent/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgAgent/source" || _die "Failed to create the source dircetory on the build VM" @@ -80,7 +84,7 @@ cat < $WD/pgAgent/build-pgagent.sh source ../common.sh - PG_STAGING=$PG_PATH_OSX/pgAgent/staging/osx + PG_STAGING=$PG_PATH_OSX/pgAgent/staging/osx.build SOURCE_DIR=$PG_PATH_OSX/pgAgent/source/pgAgent.osx echo "Building pgAgent sources" @@ -106,11 +110,11 @@ cat < $WD/pgAgent/build-pgagent.sh cp -pR /opt/local/Current/lib/libiconv*dylib \$PG_STAGING/lib || _die "Failed to copy the latest libxml2" cp -pR /opt/local/Current/lib/libwx_base_carbonu-2.8*dylib \$PG_STAGING/lib || _die "Failed to copy the latest libxml2" - otool -L $PG_PATH_OSX/pgAgent/staging/osx/bin/pgagent + otool -L $PG_PATH_OSX/pgAgent/staging/osx.build/bin/pgagent install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "\$PG_STAGING/bin/psql" install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "\$PG_STAGING/bin/pgagent" - _rewrite_so_refs $PG_PATH_OSX/pgAgent/staging/osx lib @loader_path/.. - _rewrite_so_refs $PG_PATH_OSX/pgAgent/staging/osx bin @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/pgAgent/staging/osx.build lib @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/pgAgent/staging/osx.build bin @loader_path/.. chmod +r \$PG_STAGING/lib/* chmod +rx \$PG_STAGING/bin/* @@ -120,15 +124,16 @@ EOT-PGAGENT scp pgAgent/build-pgagent.sh $PG_SSH_OSX:$PG_PATH_OSX/pgAgent ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgAgent; sh ./build-pgagent.sh" || _die "Failed to build pgAgent on OSX VM" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgAgent/staging/osx; tar -jcvf pgagent-staging.tar.bz2 *" || _die "Failed to create archive of the pgagent staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/pgAgent/staging/osx/pgagent-staging.tar.bz2 $WD/pgAgent/staging/osx || _die "Failed to scp pgagent staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/pgAgent/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgAgent/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgAgent/staging/osx" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR pgAgent/staging/osx.build/* pgAgent/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_PGAGENT=$PG_VERSION_PGAGENT > $PG_PATH_OSX/pgAgent/staging/osx/versions-osx.sh" || _die "Failed to write pgAgent version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_PGAGENT=$PG_BUILDNUM_PGAGENT >> $PG_PATH_OSX/pgAgent/staging/osx/versions-osx.sh" || _die "Failed to write pgAgent build number into versions-osx.sh" - # Extract the staging archive - cd $WD/pgAgent/staging/osx - tar -jxvf pgagent-staging.tar.bz2 || _die "Failed to extract the pgagent staging archive" - rm -f pgagent-staging.tar.bz2 - echo "END BUILD pgAgent OSX" } @@ -145,6 +150,35 @@ _postprocess_pgAgent_osx() { echo "# pgAgent : OSX : Post Process #" echo "#####################################" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/pgAgent/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/pgAgent/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/pgAgent/staging/osx)" + mkdir -p $WD/pgAgent/staging/osx || _die "Couldn't create the staging directory" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgAgent/staging/osx; rm -f pgagent-staging.tar.bz2" || _die "Failed to remove archive of the pgAgent staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgAgent/staging/osx; tar -jcvf pgagent-staging.tar.bz2 *" || _die "Failed to create archive of the pgagent staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/pgAgent/staging/osx/pgagent-staging.tar.bz2 $WD/pgAgent/staging/osx || _die "Failed to scp pgagent staging" + + # Extract the staging archive + cd $WD/pgAgent/staging/osx + tar -jxvf pgagent-staging.tar.bz2 || _die "Failed to extract the pgagent staging archive" + rm -f pgagent-staging.tar.bz2 + + source $WD/pgAgent/staging/osx/versions-osx.sh + PG_BUILD_PGAGENT=$(expr $PG_BUILD_PGAGENT + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGAGENT -gt 0 ]; + then + BUILD_FAILED="" + fi + # Setup the installer scripts. cd $WD/pgAgent/staging mkdir -p $WD/pgAgent/staging/osx/installer/pgAgent || _die "Failed to create a directory for the install scripts" @@ -180,12 +214,15 @@ _postprocess_pgAgent_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/pgAgent - chmod a+x $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/pgAgent - cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ pgAgent $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with pgAgent ($WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/installbuilder.sh)" - chmod a+x $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/pgAgent + chmod a+x $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/pgAgent + cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ pgAgent $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with pgAgent ($WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh)" + chmod a+x $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh # Zip up the output cd $WD/output @@ -194,18 +231,18 @@ _postprocess_pgAgent_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app.tar.bz2 pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app || _die "Failed to create the archive." + tar -jcvf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app.tar.bz2 pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgagent*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app* || _die "Failed to clean the output directory." + scp pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app; mv pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx-signed.app pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app; mv pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx-signed.app pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.zip pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.zip pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/pgAgent/build-windows.sh b/pgAgent/build-windows.sh index a94a31fc7..7277ad5fb 100755 --- a/pgAgent/build-windows.sh +++ b/pgAgent/build-windows.sh @@ -68,7 +68,7 @@ _prep_pgAgent_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgAgent.zip del /S /Q pgAgent.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\pgAgent.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST vc-build.bat del /S /Q vc-build.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\vc-build.bat on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgAgent.windows rd /S /Q pgAgent.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\pgAgent.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgAgent.output rd /S /Q pgAgent.output" || _die "Couldn't remove the $PG_PATH_WINDOWS\\pgAgent.output directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgAgent.output.build rd /S /Q pgAgent.output.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\pgAgent.output.build directory on Windows VM" # Copy sources on windows VM echo "Copying pgAgent sources to Windows VM" @@ -92,7 +92,7 @@ _build_pgAgent_windows() { cd $WD/pgAgent SOURCE_DIR=$PG_PATH_WINDOWS/pgAgent.windows - OUTPUT_DIR=$PG_PATH_WINDOWS\\\\pgAgent.output + OUTPUT_DIR=$PG_PATH_WINDOWS\\\\pgAgent.output.build STAGING_DIR=$WD/pgAgent/staging/windows cat < "vc-build.bat" @@ -138,23 +138,15 @@ EOT ssh $PG_SSH_WINDOWS "cd $SOURCE_DIR; cmd /c copy CreatePGPassconfForUser\\\\release\\\\CreatePGPassconfForUser.exe $OUTPUT_DIR" || _die "Failed to copy a program file on the windows build host" ssh $PG_SSH_WINDOWS "cmd /c copy /Y $PG_PGBUILD_WINDOWS\\\\vcredist\\\\vcredist_x86.exe $OUTPUT_DIR" || _die "Failed to copy the VC++ runtimes on the windows build host" - cd $WD/pgAgent/staging/windows - echo "Copying built tree to Windows host" - ssh $PG_SSH_WINDOWS "cd $OUTPUT_DIR; cmd /c zip -r pgagent_output.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$OUTPUT_DIR)" - scp $PG_SSH_WINDOWS:$OUTPUT_DIR\\\\pgagent_output.zip $WD/pgAgent/staging/windows/pgagent_output.zip || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$OUTPUT_DIR/pgagent_output.zip)" - unzip -o $WD/pgAgent/staging/windows/pgagent_output.zip -d $WD/pgAgent/staging/windows || _die "Failed to unpack the built source tree ($WD/pgAgent/staging/windows/pgagent_output.zip)" - rm -f $WD/pgAgent/staging/windows/pgagent_output.zip + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\pgAgent.output)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgAgent.output rd /S /Q pgAgent.output" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\pgAgent.output" || _die "Couldn't create the last successful staging directory" - mkdir -p $WD/pgAgent/staging/windows/bin + echo "Copying the complete build to the successful staging directory" +ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y pgAgent.output.build\\\\* pgAgent.output\\\\" || _die "Couldn't copy the existing staging directory" - echo "Copying dependent libraries from the windows VM to staging directory" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/bin/psql.exe $STAGING_DIR/bin || _die "Failed to copy psql.exe" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/bin/libpq.dll $STAGING_DIR/bin || _die "Failed to copy the dependent dll (libpq.dll)" - scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/ssleay32.dll $STAGING_DIR/bin || _die "Failed to copy the dependent dll (ssleay32.dll)" - scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS//bin/libeay32.dll $STAGING_DIR/bin || _die "Failed to copy the dependent dll (libeay32.dll)" - scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/libiconv-2.dll $STAGING_DIR/bin || _die "Failed to copy the dependent dll (libiconv-2.dll)" - scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/libintl-8.dll $STAGING_DIR/bin || _die "Failed to copy the dependent dll (libintl-8.dll)" - scp $PG_SSH_WINDOWS:$PG_WXWIN_WINDOWS/lib/vc_dll/wxbase28u_vc_custom.dll $STAGING_DIR/bin || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_PGAGENT=$PG_VERSION_PGAGENT > $PG_PATH_WINDOWS\\\\pgAgent.output/versions-windows.sh" || _die "Failed to write pgAgent version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_PGAGENT=$PG_BUILDNUM_PGAGENT >> $PG_PATH_WINDOWS\\\\pgAgent.output/versions-windows.sh" || _die "Failed to write pgAgent build number into versions-windows.sh" echo "END BUILD pgAgent Windows" } @@ -172,6 +164,38 @@ _postprocess_pgAgent_windows() { echo "# pgAgent : WIN : Post Process #" echo "#####################################" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/pgAgent/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/pgAgent/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/pgAgent/staging/windows)" + mkdir -p $WD/pgAgent/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgAgent/staging/windows || _die "Couldn't set the permissions on the staging directory" + + cd $WD/pgAgent/staging/windows + echo "Copying built tree to Windows host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgagent_output.zip del /S /Q pgagent_output.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\pgagent_output.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\pgAgent.output; cmd /c zip -r pgagent_output.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\pgAgent.output)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\pgAgent.output\\\\pgagent_output.zip $WD/pgAgent/staging/windows/pgagent_output.zip || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\pgAgent.output/pgagent_output.zip)" + unzip -o $WD/pgAgent/staging/windows/pgagent_output.zip -d $WD/pgAgent/staging/windows || _die "Failed to unpack the built source tree ($WD/pgAgent/staging/windows/pgagent_output.zip)" + rm -f $WD/pgAgent/staging/windows/pgagent_output.zip + + dos2unix $WD/pgAgent/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/pgAgent/staging/windows/versions-windows.sh + PG_BUILD_PGAGENT=$(expr $PG_BUILD_PGAGENT + $SKIPBUILD) + + mkdir -p $WD/pgAgent/staging/windows/bin + + echo "Copying dependent libraries from the windows VM to staging directory" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/bin/psql.exe $WD/pgAgent/staging/windows/bin || _die "Failed to copy psql.exe" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/bin/libpq.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy the dependent dll (libpq.dll)" + scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/ssleay32.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy the dependent dll (ssleay32.dll)" + scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS//bin/libeay32.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy the dependent dll (libeay32.dll)" + scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/libiconv-2.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy the dependent dll (libiconv-2.dll)" + scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/libintl-8.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy the dependent dll (libintl-8.dll)" + scp $PG_SSH_WINDOWS:$PG_WXWIN_WINDOWS/lib/vc_dll/wxbase28u_vc_custom.dll $WD/pgAgent/staging/windows/bin || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_vc_custom.dll)" # Setup the installer scripts mkdir -p $WD/pgAgent/staging/windows/installer/pgAgent || _die "Failed to create a directory for the install scripts" cp -f $WD/pgAgent/staging/windows/validateuser.exe $WD/pgAgent/staging/windows/installer/pgAgent/ || _die "Failed to copy validateuser.exe (staging/windows/validateuser.exe)" @@ -190,8 +214,18 @@ _postprocess_pgAgent_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGAGENT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-windows.exe $WD/output/pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-windows.exe" + win32_sign "pgagent-$PG_VERSION_PGAGENT-$PG_BUILDNUM_PGAGENT-${BUILD_FAILED}windows.exe" cd $WD diff --git a/pgJDBC/build-linux-x64.sh b/pgJDBC/build-linux-x64.sh index e372b7362..0f1cd08d9 100644 --- a/pgJDBC/build-linux-x64.sh +++ b/pgJDBC/build-linux-x64.sh @@ -25,15 +25,15 @@ _prep_pgJDBC_linux_x64() { cp -R pgJDBC-$PG_VERSION_PGJDBC/* pgJDBC.linux-x64 || _die "Failed to copy the source code (source/pgJDBC-$PG_VERSION_PGJDBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgJDBC/staging/linux-x64 ]; + if [ -e $WD/pgJDBC/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgJDBC/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgJDBC/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgJDBC/staging/linux-x64)" - mkdir -p $WD/pgJDBC/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgJDBC/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/pgJDBC/staging/linux-x64.build)" + mkdir -p $WD/pgJDBC/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgJDBC/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP pgJDBC Linux-x64" @@ -47,6 +47,18 @@ _build_pgJDBC_linux_x64() { echo "BEGIN BUILD pgJDBC Linux-x64" + cp -R $WD/pgJDBC/source/pgJDBC.linux-x64/* $WD/pgJDBC/staging/linux-x64.build || _die "Failed to copy the pgJDBC Source into the staging directory" + + echo "Removing last successful staging directory ($WD/pgJDBC/staging/linux-x64)" + rm -rf $WD/pgJDBC/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgJDBC/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgJDBC/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgJDBC/staging/linux-x64.build/* $WD/pgJDBC/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGJDBC=$PG_VERSION_PGJDBC" > $WD/pgJDBC/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_PGJDBC=$PG_BUILDNUM_PGJDBC" >> $WD/pgJDBC/staging/linux-x64/versions-linux-x64.sh + cd $WD echo "END BUILD pgJDBC Linux-x64" @@ -61,7 +73,8 @@ _postprocess_pgJDBC_linux_x64() { echo "BEGIN POST pgJDBC Linux-x64" - cp -R $WD/pgJDBC/source/pgJDBC.linux-x64/* $WD/pgJDBC/staging/linux-x64 || _die "Failed to copy the pgJDBC Source into the staging directory" + source $WD/pgJDBC/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_PGJDBC=$(expr $PG_BUILD_PGJDBC + $SKIPBUILD) cd $WD/pgJDBC @@ -98,6 +111,16 @@ _postprocess_pgJDBC_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGJDBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-linux-x64.run $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST pgJDBC Linux-x64" diff --git a/pgJDBC/build-linux.sh b/pgJDBC/build-linux.sh index 165c456d9..58a7b9efc 100644 --- a/pgJDBC/build-linux.sh +++ b/pgJDBC/build-linux.sh @@ -25,16 +25,16 @@ _prep_pgJDBC_linux() { cp -R pgJDBC-$PG_VERSION_PGJDBC/* pgJDBC.linux || _die "Failed to copy the source code (source/pgJDBC-$PG_VERSION_PGJDBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgJDBC/staging/linux ]; + if [ -e $WD/pgJDBC/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgJDBC/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgJDBC/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgJDBC/staging/linux)" - mkdir -p $WD/pgJDBC/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgJDBC/staging/linux || _die "Couldn't set the permissions on the staging directory" - + echo "Creating staging directory ($WD/pgJDBC/staging/linux.build)" + mkdir -p $WD/pgJDBC/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgJDBC/staging/linux.build || _die "Couldn't set the permissions on the staging directory" + echo "END PREP pgJDBC Linux" } @@ -47,8 +47,20 @@ _build_pgJDBC_linux() { echo "BEGIN BUILD pgJDBC Linux" + cp -R $WD/pgJDBC/source/pgJDBC.linux/* $WD/pgJDBC/staging/linux.build || _die "Failed to copy the pgJDBC Source into the staging directory" + cd $WD + echo "Removing last successful staging directory ($WD/pgJDBC/staging/linux)" + rm -rf $WD/pgJDBC/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgJDBC/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgJDBC/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgJDBC/staging/linux.build/* $WD/pgJDBC/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGJDBC=$PG_VERSION_PGJDBC" > $WD/pgJDBC/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_PGJDBC=$PG_BUILDNUM_PGJDBC" >> $WD/pgJDBC/staging/linux/versions-linux.sh + echo "END BUILD pgJDBC Linux" } @@ -60,8 +72,9 @@ _build_pgJDBC_linux() { _postprocess_pgJDBC_linux() { echo "BEGIN POST pgJDBC Linux" - - cp -R $WD/pgJDBC/source/pgJDBC.linux/* $WD/pgJDBC/staging/linux || _die "Failed to copy the pgJDBC Source into the staging directory" + + source $WD/pgJDBC/staging/linux/versions-linux.sh + PG_BUILD_PGJDBC=$(expr $PG_BUILD_PGJDBC + $SKIPBUILD) cd $WD/pgJDBC @@ -100,6 +113,16 @@ _postprocess_pgJDBC_linux() { cd $WD + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGJDBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-linux.run $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}linux.run + echo "END POST pgJDBC Linux" } diff --git a/pgJDBC/build-osx.sh b/pgJDBC/build-osx.sh index 73cb358c7..0418f2ed8 100644 --- a/pgJDBC/build-osx.sh +++ b/pgJDBC/build-osx.sh @@ -29,15 +29,15 @@ _prep_pgJDBC_osx() { cp -R pgJDBC-$PG_VERSION_PGJDBC/* pgJDBC.osx || _die "Failed to copy the source code (source/pgJDBC-$PG_VERSION_PGJDBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgJDBC/staging/osx ]; + if [ -e $WD/pgJDBC/staging/osx.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgJDBC/staging/osx || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgJDBC/staging/osx.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgJDBC/staging/osx)" - mkdir -p $WD/pgJDBC/staging/osx || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgJDBC/staging/osx || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/pgJDBC/staging/osx.build)" + mkdir -p $WD/pgJDBC/staging/osx.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgJDBC/staging/osx.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP pgJDBC OSX" } @@ -53,7 +53,17 @@ _build_pgJDBC_osx() { echo "*******************************************************" echo " Build : pgJDBC (OSX)" echo "*******************************************************" - cp -R $WD/pgJDBC/source/pgJDBC.osx/* $WD/pgJDBC/staging/osx || _die "Failed to copy the pgJDBC Source into the staging directory" + cp -R $WD/pgJDBC/source/pgJDBC.osx/* $WD/pgJDBC/staging/osx.build || _die "Failed to copy the pgJDBC Source into the staging directory" + + echo "Removing last successful staging directory ($WD/pgJDBC/staging/osx)" + rm -rf $WD/pgJDBC/staging/osx || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgJDBC/staging/osx || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgJDBC/staging/osx || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgJDBC/staging/osx.build/* $WD/pgJDBC/staging/osx || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGJDBC=$PG_VERSION_PGJDBC" > $WD/pgJDBC/staging/osx/versions-osx.sh + echo "PG_BUILDNUM_PGJDBC=$PG_BUILDNUM_PGJDBC" >> $WD/pgJDBC/staging/osx/versions-osx.sh cd $WD @@ -73,6 +83,16 @@ _postprocess_pgJDBC_osx() { echo " Post Process : pgJDBC (OSX)" echo "*******************************************************" + source $WD/pgJDBC/staging/osx/versions-osx.sh + PG_BUILD_PGJDBC=$(expr $PG_BUILD_PGJDBC + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGJDBC -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/pgJDBC # Setup the installer scripts. @@ -110,12 +130,15 @@ _postprocess_pgJDBC_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app/Contents/MacOS/pgJDBC - chmod a+x $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app/Contents/MacOS/pgJDBC - cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ pgJDBC $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" - chmod a+x $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app/Contents/MacOS/pgJDBC + chmod a+x $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app/Contents/MacOS/pgJDBC + cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ pgJDBC $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace the Project Name placeholder in the one click installer in the installbuilder.sh script" + chmod a+x $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -123,18 +146,18 @@ _postprocess_pgJDBC_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app.tar.bz2 pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app || _die "Failed to create the archive." + tar -jcvf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app.tar.bz2 pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgjdbc*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app* || _die "Failed to clean the output directory." + scp pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app; mv pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx-signed.app pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app; mv pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx-signed.app pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.zip pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.zip pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/pgJDBC/build-windows.sh b/pgJDBC/build-windows.sh index ae2bb1f1a..9a7c8c4b9 100644 --- a/pgJDBC/build-windows.sh +++ b/pgJDBC/build-windows.sh @@ -6,7 +6,7 @@ ################################################################################ _prep_pgJDBC_windows() { - + echo "BEGIN PREP pgJDBC Windows" # Enter the source directory and cleanup if required @@ -25,15 +25,15 @@ _prep_pgJDBC_windows() { cp -R pgJDBC-$PG_VERSION_PGJDBC/* pgJDBC.windows || _die "Failed to copy the source code (source/pgJDBC-$PG_VERSION_PGJDBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgJDBC/staging/windows ]; + if [ -e $WD/pgJDBC/staging/windows.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgJDBC/staging/windows || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgJDBC/staging/windows.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgJDBC/staging/windows)" - mkdir -p $WD/pgJDBC/staging/windows || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgJDBC/staging/windows || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/pgJDBC/staging/windows.build)" + mkdir -p $WD/pgJDBC/staging/windows.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgJDBC/staging/windows.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP pgJDBC Windows" @@ -47,8 +47,20 @@ _build_pgJDBC_windows() { echo "BEGIN BUILD pgJDBC Windows" + cp -R $WD/pgJDBC/source/pgJDBC.windows/* $WD/pgJDBC/staging/windows.build || _die "Failed to copy the pgJDBC Source into the staging directory" + cd $WD + echo "Removing last successful staging directory ($WD/pgJDBC/staging/windows)" + rm -rf $WD/pgJDBC/staging/windows || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgJDBC/staging/windows || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgJDBC/staging/windows || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgJDBC/staging/windows.build/* $WD/pgJDBC/staging/windows || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGJDBC=$PG_VERSION_PGJDBC" > $WD/pgJDBC/staging/windows/versions-windows.sh + echo "PG_BUILDNUM_PGJDBC=$PG_BUILDNUM_PGJDBC" >> $WD/pgJDBC/staging/windows/versions-windows.sh + echo "END BUILD pgJDBC Windows" } @@ -60,8 +72,9 @@ _build_pgJDBC_windows() { _postprocess_pgJDBC_windows() { echo "BEGIN POST pgJDBC Windows" - - cp -R $WD/pgJDBC/source/pgJDBC.windows/* $WD/pgJDBC/staging/windows || _die "Failed to copy the pgJDBC Source into the staging directory" + + source $WD/pgJDBC/staging/windows/versions-windows.sh + PG_BUILD_PGJDBC=$(expr $PG_BUILD_PGJDBC + $SKIPBUILD) cd $WD/pgJDBC @@ -72,8 +85,18 @@ _postprocess_pgJDBC_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGJDBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-windows.exe $WD/output/pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-windows.exe" + win32_sign "pgjdbc-$PG_VERSION_PGJDBC-$PG_BUILDNUM_PGJDBC-${BUILD_FAILED}windows.exe" cd $WD diff --git a/pgbouncer/build-linux-x64.sh b/pgbouncer/build-linux-x64.sh index 5d51a594b..baf7c0268 100755 --- a/pgbouncer/build-linux-x64.sh +++ b/pgbouncer/build-linux-x64.sh @@ -28,21 +28,21 @@ _prep_pgbouncer_linux_x64() { cp -R pgbouncer-$PG_VERSION_PGBOUNCER/* pgbouncer.linux-x64 || _die "Failed to copy the source code (source/pgbouncer-$PG_VERSION_PGBOUNCER)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgbouncer/staging/linux-x64 ]; + if [ -e $WD/pgbouncer/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgbouncer/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgbouncer/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgbouncer/staging/linux-x64)" - mkdir -p $WD/pgbouncer/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgbouncer/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/pgbouncer/staging/linux-x64.build)" + mkdir -p $WD/pgbouncer/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgbouncer/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" - echo "Creating staging doc directory ($WD/pgbouncer/staging/linux-x64/pgbouncer/doc)" - mkdir -p $WD/pgbouncer/staging/linux-x64/pgbouncer/doc || _die "Couldn't create the staging doc directory" - chmod 755 $WD/pgbouncer/staging/linux-x64/pgbouncer/doc || _die "Couldn't set the permissions on the staging doc directory" + echo "Creating staging doc directory ($WD/pgbouncer/staging/linux-x64.build/pgbouncer/doc)" + mkdir -p $WD/pgbouncer/staging/linux-x64.build/pgbouncer/doc || _die "Couldn't create the staging doc directory" + chmod 755 $WD/pgbouncer/staging/linux-x64.build/pgbouncer/doc || _die "Couldn't set the permissions on the staging doc directory" echo "Copying README.pgbouncer to staging doc directory" - cp $WD/pgbouncer/resources/README.pgbouncer $WD/pgbouncer/staging/linux-x64/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" + cp $WD/pgbouncer/resources/README.pgbouncer $WD/pgbouncer/staging/linux-x64.build/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" echo "END PREP pgbouncer Linux-x64" } @@ -55,44 +55,42 @@ _build_pgbouncer_linux_x64() { echo "BEGIN BUILD pgbouncer Linux-x64" - PG_STAGING_CACHE=$WD/server/staging_cache/linux-x64 - - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/pgbouncer/source/pgbouncer.linux-x64/; ./configure --enable-debug --prefix=$PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current" || _die "Failed to configure pgbouncer" + ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/pgbouncer/source/pgbouncer.linux-x64/; ./configure --enable-debug --prefix=$PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current" || _die "Failed to configure pgbouncer" ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/pgbouncer/source/pgbouncer.linux-x64/; make" || _die "Failed to build pgbouncer" ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/pgbouncer/source/pgbouncer.linux-x64/; make install" || _die "Failed to install pgbouncer" - ssh $PG_SSH_LINUX_X64 "cp -R $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/share/" || _die "Failed to copy pgbouncer ini to share folder" + ssh $PG_SSH_LINUX_X64 "cp -R $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/share/" || _die "Failed to copy pgbouncer ini to share folder" - mkdir -p $WD/pgbouncer/staging/linux-x64/instscripts || _die "Failed to create the instscripts directory" - mkdir -p $WD/pgbouncer/staging/linux-x64/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" + mkdir -p $WD/pgbouncer/staging/linux-x64.build/instscripts || _die "Failed to create the instscripts directory" + mkdir -p $WD/pgbouncer/staging/linux-x64.build/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" - ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libevent-* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/lib" || _die "Failed to copy libevent libs in pgbouncer lib folder" - ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libssl.so* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/lib" || _die "Failed to copy libssl libs in pgbouncer lib folder" - ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libcrypto.so* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/lib" || _die "Failed to copy libcrypto libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libevent-* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/lib" || _die "Failed to copy libevent libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libssl.so* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/lib" || _die "Failed to copy libssl libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX_X64 "cp -R /opt/local/Current/lib/libcrypto.so* $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/lib" || _die "Failed to copy libcrypto libs in pgbouncer lib folder" - ssh $PG_SSH_LINUX_X64 "chmod o+rx $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer/lib/*" || _die "Failed to change permission of libevent libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX_X64 "chmod o+rx $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer/lib/*" || _die "Failed to change permission of libevent libs in pgbouncer lib folder" - cd $WD/pgbouncer/staging/linux-x64/instscripts/ + cd $WD/pgbouncer/staging/linux-x64.build/instscripts/ - cp -pR $PG_STAGING_CACHE/bin/psql* . || _die "Failed to copy psql binary" - cp -pR $PG_STAGING_CACHE/lib/libpq.so* . || _die "Failed to copy libpq.so" - cp -pR $PG_STAGING_CACHE/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libssl.so* . || _die "Failed to copy libssl.so" - cp -pR $PG_STAGING_CACHE/lib/libedit.so* . || _die "Failed to copy libedit.so" - cp -pR $PG_STAGING_CACHE/lib/libsasl*.so* . || _die "Failed to copy libsasl2.so.3" - cp -pR $PG_STAGING_CACHE/lib/libldap*.so* . || _die "Failed to copy libldap.so" - cp -pR $PG_STAGING_CACHE/lib/liblber*.so* . || _die "Failed to copy liblber.so" - cp -pR $PG_STAGING_CACHE/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" - cp -pR $PG_STAGING_CACHE/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" - cp -pR $PG_STAGING_CACHE/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" + cp -pR $WD/server/staging/linux-x64/bin/psql* . || _die "Failed to copy psql binary" + cp -pR $WD/server/staging/linux-x64/lib/libpq.so* . || _die "Failed to copy libpq.so" + cp -pR $WD/server/staging/linux-x64/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux-x64/lib/libssl.so* . || _die "Failed to copy libssl.so" + cp -pR $WD/server/staging/linux-x64/lib/libedit.so* . || _die "Failed to copy libedit.so" + cp -pR $WD/server/staging/linux-x64/lib/libsasl*.so* . || _die "Failed to copy libsasl2.so.3" + cp -pR $WD/server/staging/linux-x64/lib/libldap*.so* . || _die "Failed to copy libldap.so" + cp -pR $WD/server/staging/linux-x64/lib/liblber*.so* . || _die "Failed to copy liblber.so" + cp -pR $WD/server/staging/linux-x64/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" + cp -pR $WD/server/staging/linux-x64/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" + cp -pR $WD/server/staging/linux-x64/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" + cp -pR $WD/server/staging/linux-x64/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" + cp -pR $WD/server/staging/linux-x64/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" + cp -pR $WD/server/staging/linux-x64/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" - ssh $PG_SSH_LINUX_X64 "chmod 755 $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/instscripts/*" || _die "Failed to change permission of libraries" + ssh $PG_SSH_LINUX_X64 "chmod 755 $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/instscripts/*" || _die "Failed to change permission of libraries" # Generate debug symbols - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64/pgbouncer" || _die "Failed to execute create_debug_symbols.sh" + ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX_X64/pgbouncer/staging/linux-x64.build/pgbouncer" || _die "Failed to execute create_debug_symbols.sh" # Remove existing symbols directory in output directory if [ -e $WD/output/symbols/linux-x64/pgbouncer ]; @@ -103,7 +101,17 @@ _build_pgbouncer_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/pgbouncer/staging/linux-x64/pgbouncer/symbols $WD/output/symbols/linux-x64/pgbouncer || _die "Failed to move $WD/pgbouncer/staging/linux-x64/pgbouncer/symbols to $WD/output/symbols/linux-x64/pgbouncer directory" + mv $WD/pgbouncer/staging/linux-x64.build/pgbouncer/symbols $WD/output/symbols/linux-x64/pgbouncer || _die "Failed to move $WD/pgbouncer/staging/linux-x64.build/pgbouncer/symbols to $WD/output/symbols/linux-x64/pgbouncer directory" + + echo "Removing last successful staging directory ($WD/pgbouncer/staging/linux-x64)" + rm -rf $WD/pgbouncer/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgbouncer/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgbouncer/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgbouncer/staging/linux-x64.build/* $WD/pgbouncer/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGBOUNCER=$PG_VERSION_PGBOUNCER" > $WD/pgbouncer/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_PGBOUNCER=$PG_BUILDNUM_PGBOUNCER" >> $WD/pgbouncer/staging/linux-x64/versions-linux-x64.sh cd $WD @@ -118,6 +126,9 @@ _build_pgbouncer_linux_x64() { _postprocess_pgbouncer_linux_x64() { echo "BEGIN POST pgbouncer Linux-x64" + + source $WD/pgbouncer/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_PGBOUNCER=$(expr $PG_BUILD_PGBOUNCER + $SKIPBUILD) cd $WD/pgbouncer @@ -149,6 +160,16 @@ _postprocess_pgbouncer_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGBOUNCER -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-linux-x64.run $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST pgbouncer Linux-x64" diff --git a/pgbouncer/build-linux.sh b/pgbouncer/build-linux.sh index af3e5f660..475cc0d88 100644 --- a/pgbouncer/build-linux.sh +++ b/pgbouncer/build-linux.sh @@ -28,22 +28,22 @@ _prep_pgbouncer_linux() { cp -R pgbouncer-$PG_VERSION_PGBOUNCER/* pgbouncer.linux || _die "Failed to copy the source code (source/pgbouncer-$PG_VERSION_PGBOUNCER)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgbouncer/staging/linux ]; + if [ -e $WD/pgbouncer/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/pgbouncer/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/pgbouncer/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/pgbouncer/staging/linux)" - mkdir -p $WD/pgbouncer/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgbouncer/staging/linux || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/pgbouncer/staging/linux.build)" + mkdir -p $WD/pgbouncer/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgbouncer/staging/linux.build || _die "Couldn't set the permissions on the staging directory" - echo "Creating staging doc directory ($WD/pgbouncer/staging/linux/pgbouncer/doc)" - mkdir -p $WD/pgbouncer/staging/linux/pgbouncer/doc || _die "Couldn't create the staging doc directory" - chmod 755 $WD/pgbouncer/staging/linux/pgbouncer/doc || _die "Couldn't set the permissions on the staging doc directory" + echo "Creating staging doc directory ($WD/pgbouncer/staging/linux.build/pgbouncer/doc)" + mkdir -p $WD/pgbouncer/staging/linux.build/pgbouncer/doc || _die "Couldn't create the staging doc directory" + chmod 755 $WD/pgbouncer/staging/linux.build/pgbouncer/doc || _die "Couldn't set the permissions on the staging doc directory" echo "Copying README.pgbouncer to staging doc directory" - cp $WD/pgbouncer/resources/README.pgbouncer $WD/pgbouncer/staging/linux/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" - + cp $WD/pgbouncer/resources/README.pgbouncer $WD/pgbouncer/staging/linux.build/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" + echo "END PREP pgbouncer Linux" } @@ -56,44 +56,42 @@ _build_pgbouncer_linux() { echo "BEGIN BUILD pgbouncer Linux" - PG_STAGING_CACHE=$WD/server/staging_cache/linux - - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/pgbouncer/source/pgbouncer.linux/; ./configure --enable-debug --prefix=$PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current" || _die "Failed to configure pgbouncer" + ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/pgbouncer/source/pgbouncer.linux/; ./configure --enable-debug --prefix=$PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current" || _die "Failed to configure pgbouncer" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/pgbouncer/source/pgbouncer.linux/; make" || _die "Failed to build pgbouncer" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/pgbouncer/source/pgbouncer.linux/; make install" || _die "Failed to install pgbouncer" - ssh $PG_SSH_LINUX "cp -R $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/share" || _die "Failed to copy pgbouncer ini to share directory" + ssh $PG_SSH_LINUX "cp -R $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/share" || _die "Failed to copy pgbouncer ini to share directory" - mkdir -p $WD/pgbouncer/staging/linux/instscripts || _die "Failed to create the instscripts directory" - mkdir -p $WD/pgbouncer/staging/linux/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" + mkdir -p $WD/pgbouncer/staging/linux.build/instscripts || _die "Failed to create the instscripts directory" + mkdir -p $WD/pgbouncer/staging/linux.build/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" - ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libevent-* $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/lib" || _die "Failed to copy libevent libs in pgbouncer lib folder" - ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libssl.so* $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/lib" || _die "Failed to copy libssl libs in pgbouncer lib folder" - ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libcrypto.so* $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/lib" || _die "Failed to copy libcrypto libs in pgbouncer lib folder" - - ssh $PG_SSH_LINUX "chmod a+rx $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer/lib/*" || _die "Failed to change permission of libevent libs in pgbouncer lib folder" - - cd $WD/pgbouncer/staging/linux/instscripts/ - - cp -pR $PG_STAGING_CACHE/bin/psql* . || _die "Failed to copy psql binary" - cp -pR $PG_STAGING_CACHE/lib/libpq.so* . || _die "Failed to copy libpq.so" - cp -pR $PG_STAGING_CACHE/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libssl.so* . || _die "Failed to copy libssl.so" - cp -pR $PG_STAGING_CACHE/lib/libedit.so* . || _die "Failed to copy libedit.so" - cp -pR $PG_STAGING_CACHE/lib/libsasl*.so* . || _die "Failed to copy libsasl2.so.3" - cp -pR $PG_STAGING_CACHE/lib/libldap*.so* . || _die "Failed to copy libldap.so" - cp -pR $PG_STAGING_CACHE/lib/liblber*.so* . || _die "Failed to copy liblber.so" - cp -pR $PG_STAGING_CACHE/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" - cp -pR $PG_STAGING_CACHE/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" - cp -pR $PG_STAGING_CACHE/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" - - ssh $PG_SSH_LINUX "chmod 755 $PG_PATH_LINUX/pgbouncer/staging/linux/instscripts/*" || _die "Failed to change permission of libraries" + ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libevent-* $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/lib" || _die "Failed to copy libevent libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libssl.so* $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/lib" || _die "Failed to copy libssl libs in pgbouncer lib folder" + ssh $PG_SSH_LINUX "cp -R /opt/local/Current/lib/libcrypto.so* $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/lib" || _die "Failed to copy libcrypto libs in pgbouncer lib folder" + + ssh $PG_SSH_LINUX "chmod a+rx $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer/lib/*" || _die "Failed to change permission of libevent libs in pgbouncer lib folder" + + cd $WD/pgbouncer/staging/linux.build/instscripts/ + + cp -pR $WD/server/staging/linux/bin/psql* . || _die "Failed to copy psql binary" + cp -pR $WD/server/staging/linux/lib/libpq.so* . || _die "Failed to copy libpq.so" + cp -pR $WD/server/staging/linux/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux/lib/libssl.so* . || _die "Failed to copy libssl.so" + cp -pR $WD/server/staging/linux/lib/libedit.so* . || _die "Failed to copy libedit.so" + cp -pR $WD/server/staging/linux/lib/libsasl*.so* . || _die "Failed to copy libsasl2.so.3" + cp -pR $WD/server/staging/linux/lib/libldap*.so* . || _die "Failed to copy libldap.so" + cp -pR $WD/server/staging/linux/lib/liblber*.so* . || _die "Failed to copy liblber.so" + cp -pR $WD/server/staging/linux/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" + cp -pR $WD/server/staging/linux/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" + cp -pR $WD/server/staging/linux/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" + cp -pR $WD/server/staging/linux/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" + cp -pR $WD/server/staging/linux/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" + cp -pR $WD/server/staging/linux/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" + + ssh $PG_SSH_LINUX "chmod 755 $PG_PATH_LINUX/pgbouncer/staging/linux.build/instscripts/*" || _die "Failed to change permission of libraries" # Generate debug symbols - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX/pgbouncer/staging/linux/pgbouncer" || _die "Failed to execute create_debug_symbols.sh" + ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX/pgbouncer/staging/linux.build/pgbouncer" || _die "Failed to execute create_debug_symbols.sh" # Remove existing symbols directory in output directory if [ -e $WD/output/symbols/linux/pgbouncer ]; @@ -104,7 +102,17 @@ _build_pgbouncer_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/pgbouncer/staging/linux/pgbouncer/symbols $WD/output/symbols/linux/pgbouncer || _die "Failed to move $WD/pgbouncer/staging/linux/pgbouncer/symbols to $WD/output/symbols/linux/pgbouncer directory" + mv $WD/pgbouncer/staging/linux.build/pgbouncer/symbols $WD/output/symbols/linux/pgbouncer || _die "Failed to move $WD/pgbouncer/staging/linux.build/pgbouncer/symbols to $WD/output/symbols/linux/pgbouncer directory" + + echo "Removing last successful staging directory ($WD/pgbouncer/staging/linux)" + rm -rf $WD/pgbouncer/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgbouncer/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgbouncer/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgbouncer/staging/linux.build/* $WD/pgbouncer/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGBOUNCER=$PG_VERSION_PGBOUNCER" > $WD/pgbouncer/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_PGBOUNCER=$PG_BUILDNUM_PGBOUNCER" >> $WD/pgbouncer/staging/linux/versions-linux.sh cd $WD @@ -120,6 +128,9 @@ _postprocess_pgbouncer_linux() { echo "BEGIN POST pgbouncer Linux" + source $WD/pgbouncer/staging/linux/versions-linux.sh + PG_BUILD_PGBOUNCER=$(expr $PG_BUILD_PGBOUNCER + $SKIPBUILD) + cd $WD/pgbouncer pushd staging/linux @@ -150,6 +161,16 @@ _postprocess_pgbouncer_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGBOUNCER -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-linux.run $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}linux.run + cd $WD echo "END POST pgbouncer Linux" diff --git a/pgbouncer/build-osx.sh b/pgbouncer/build-osx.sh index 398e913cd..eb99195e3 100644 --- a/pgbouncer/build-osx.sh +++ b/pgbouncer/build-osx.sh @@ -41,7 +41,11 @@ _prep_pgbouncer_osx() { chmod ugo+w $WD/pgbouncer/staging/osx || _die "Couldn't set the permissions on the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/pgbouncer ]; then rm -rf $PG_PATH_OSX/pgbouncer/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/source" || _die "Falied to clean the pgbouncer/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/scripts" || _die "Falied to clean the pgbouncer/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/*.bz2" || _die "Falied to clean the pgbouncer/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/*.sh" || _die "Falied to clean the pgbouncer/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/staging/osx.build" || _die "Falied to clean the pgbouncer/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgbouncer/source" || _die "Failed to create the source dircetory on the build VM" @@ -57,11 +61,11 @@ _prep_pgbouncer_osx() { ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer/source; tar -jxvf pgbouncer.tar.bz2" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer; tar -jxvf scripts.tar.bz2" - echo "Creating staging doc directory ($WD/pgbouncer/staging/osx/pgbouncer/doc)" - ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/doc" || _die "Couldn't create the staging doc directory" - ssh $PG_SSH_OSX "chmod 755 $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/doc" || _die "Couldn't set the permissions on the staging doc directory" + echo "Creating staging doc directory ($WD/pgbouncer/staging/osx.build/pgbouncer/doc)" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/doc" || _die "Couldn't create the staging doc directory" + ssh $PG_SSH_OSX "chmod 755 $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/doc" || _die "Couldn't set the permissions on the staging doc directory" echo "Copying README.pgbouncer to staging doc directory" - scp $WD/pgbouncer/resources/README.pgbouncer $PG_SSH_OSX:$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" + scp $WD/pgbouncer/resources/README.pgbouncer $PG_SSH_OSX:$PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" echo "END PREP pgbouncer OSX" @@ -86,13 +90,13 @@ cat< $WD/pgbouncer/build-pgbouncer.sh cd $PG_PATH_OSX/pgbouncer/source/pgbouncer.osx/ - CFLAGS="$PG_ARCH_OSX_CFLAGS -arch i386 -O2" LDFLAGS="-arch i386" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current || _die "Failed to configure pgbouncer" + CFLAGS="$PG_ARCH_OSX_CFLAGS -arch i386 -O2" LDFLAGS="-arch i386" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer --with-libevent=/opt/local/Current --with-openssl=/opt/local/Current || _die "Failed to configure pgbouncer" mv lib/usual/config.h lib/usual/config_i386.h || _die "Failed to rename config.h" - CFLAGS="$PG_ARCH_OSX_CFLAGS -arch x86_64 -O2" LDFLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer --with-libevent=/opt/local/Current || _die "Failed to configure pgbouncer" + CFLAGS="$PG_ARCH_OSX_CFLAGS -arch x86_64 -O2" LDFLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer --with-libevent=/opt/local/Current || _die "Failed to configure pgbouncer" mv lib/usual/config.h lib/usual/config_x86_64.h || _die "Failed to rename config.h" - CFLAGS="$PG_ARCH_OSX_CFLAGS -arch i386 -arch x86_64 -O2" LDFLAGS="-arch i386 -arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer --with-libevent=/opt/local/Current || _die "Failed to configure pgbouncer" + CFLAGS="$PG_ARCH_OSX_CFLAGS -arch i386 -arch x86_64 -O2" LDFLAGS="-arch i386 -arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure --prefix=$PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer --with-libevent=/opt/local/Current || _die "Failed to configure pgbouncer" echo "#ifdef __BIG_ENDIAN__" > lib/usual/config.h echo " #error \"Do not support ppc architecture\"" >> lib/usual/config.h @@ -108,64 +112,65 @@ cat< $WD/pgbouncer/build-pgbouncer.sh ln -s $PG_PATH_OSX/pgbouncer/source/pgbouncer.osx/install-sh $PG_PATH_OSX/pgbouncer/source/pgbouncer.osx/doc/install-sh make install || _die "Failed to install pgbouncer" - cp -R $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/share || _die "Failed to copy the ini file to share directory" + cp -R $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/share/doc/pgbouncer/pgbouncer.ini $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/share || _die "Failed to copy the ini file to share directory" - mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" - cp -pR /opt/local/Current/lib/libevent-*.dylib $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/lib - cp -pR /opt/local/Current/lib/libssl*.dylib $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/lib - cp -pR /opt/local/Current/lib/libcrypto*.dylib $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/lib + mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/lib || _die "Failed to create the pgbouncer lib directory" + cp -pR /opt/local/Current/lib/libevent-*.dylib $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/lib + cp -pR /opt/local/Current/lib/libssl*.dylib $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/lib + cp -pR /opt/local/Current/lib/libcrypto*.dylib $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/lib - _rewrite_so_refs $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer bin @loader_path/.. - _rewrite_so_refs $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer lib @loader_path/ + _rewrite_so_refs $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer bin @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer lib @loader_path/ - mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx/instscripts || _die "Failed to create the instscripts directory" + mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts || _die "Failed to create the instscripts directory" - cp -pR $PG_PGHOME_OSX/lib/libpq* $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy libpq in instscripts" - cp -pR $PG_PGHOME_OSX/lib/libedit* $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy libedit in instscripts" - cp -pR $PG_PGHOME_OSX/lib/libssl* $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy libssl in instscripts" - cp -pR $PG_PGHOME_OSX/lib/libcrypto* $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy libcrypto in instscripts" - cp -pR $PG_PGHOME_OSX/lib/libxml2* $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy libxml2 in instscripts" - cp -pR $PG_PGHOME_OSX/bin/psql $PG_PATH_OSX/pgbouncer/staging/osx/instscripts/ || _die "Failed to copy psql in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/lib/libpq* $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy libpq in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/lib/libedit* $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy libedit in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/lib/libssl* $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy libssl in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/lib/libcrypto* $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy libcrypto in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/lib/libxml2* $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy libxml2 in instscripts" + cp -pR $PG_PATH_OSX/server/staging/osx/bin/psql $PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/ || _die "Failed to copy psql in instscripts" # Change the referenced libraries - OLD_DLL_LIST=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/psql | grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` + OLD_DLL_LIST=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/psql | grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` for OLD_DLL in \$OLD_DLL_LIST do NEW_DLL=\`echo \$OLD_DLL | sed -e "s^@loader_path/../lib/^^g"\` - install_name_tool -change "\$OLD_DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/psql" + install_name_tool -change "\$OLD_DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/psql" done - OLD_DLLS=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/libpq.5.dylib| grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` + OLD_DLLS=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/libpq.5.dylib| grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` for DLL in \$OLD_DLLS do NEW_DLL=\`echo \$DLL | sed -e "s^@loader_path/../lib/^^g"\` - install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/libpq.5.dylib" + install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/libpq.5.dylib" done - OLD_DLLS=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/libssl.dylib| grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` + OLD_DLLS=\`otool -L \$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/libssl.dylib| grep @loader_path/../lib | grep -v ":" | awk '{ print \$1 }' \` for DLL in \$OLD_DLLS do NEW_DLL=\`echo \$DLL | sed -e "s^@loader_path/../lib/^^g"\` - install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/libssl.dylib" - install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx/instscripts/libssl.1.0.0.dylib" + install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/libssl.dylib" + install_name_tool -change "\$DLL" "\$NEW_DLL" "\$PG_PATH_OSX/pgbouncer/staging/osx.build/instscripts/libssl.1.0.0.dylib" done - install_name_tool -change "@loader_path//lib/libcrypto.1.0.0.dylib" "@loader_path/libcrypto.1.0.0.dylib" $PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer/lib/libssl.1.0.0.dylib + install_name_tool -change "@loader_path//lib/libcrypto.1.0.0.dylib" "@loader_path/libcrypto.1.0.0.dylib" $PG_PATH_OSX/pgbouncer/staging/osx.build/pgbouncer/lib/libssl.1.0.0.dylib PGBOUNCER cd $WD scp pgbouncer/build-pgbouncer.sh $PG_SSH_OSX:$PG_PATH_OSX/pgbouncer ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer; sh ./build-pgbouncer.sh" || _die "Failed to build pgbouncer on OSX VM" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer/staging/osx/; tar -jcvf pgbouncer-staging.tar.bz2 *" || _die "Failed to create archive of the pgbouncer staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer-staging.tar.bz2 $WD/pgbouncer/staging/osx || _die "Failed to scp pgbouncer staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/pgbouncer/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgbouncer/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgbouncer/staging/osx" || _die "Couldn't create the last successful staging directory" - # Extract the staging archive - cd $WD/pgbouncer/staging/osx - tar -jxvf pgbouncer-staging.tar.bz2 || _die "Failed to extract the pgbouncer staging archive" - rm -f pgbouncer-staging.tar.bz2 + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR pgbouncer/staging/osx.build/* pgbouncer/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_PGBOUNCER=$PG_VERSION_PGBOUNCER > $PG_PATH_OSX/pgbouncer/staging/osx/versions-osx.sh" || _die "Failed to write pgbouncer version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_PGBOUNCER=$PG_BUILDNUM_PGBOUNCER >> $PG_PATH_OSX/pgbouncer/staging/osx/versions-osx.sh" || _die "Failed to write pgbouncer build number into versions-osx.sh" echo "END BUILD pgbouncer OSX" } @@ -182,7 +187,37 @@ _postprocess_pgbouncer_osx() { echo "***********************************" echo "* Post Process: pgBouncer (OSX) *" echo "***********************************" + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/pgbouncer/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/pgbouncer/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/pgbouncer/staging/osx)" + mkdir -p $WD/pgbouncer/staging/osx || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgbouncer/staging/osx || _die "Couldn't set the permissions on the staging directory" + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer/staging/osx; rm -f pgbouncer-staging.tar.bz2" || _die "Failed to remove archive of the pgbouncer staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgbouncer/staging/osx/; tar -jcvf pgbouncer-staging.tar.bz2 *" || _die "Failed to create archive of the pgbouncer staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/pgbouncer/staging/osx/pgbouncer-staging.tar.bz2 $WD/pgbouncer/staging/osx || _die "Failed to scp pgbouncer staging" + + # Extract the staging archive + cd $WD/pgbouncer/staging/osx + tar -jxvf pgbouncer-staging.tar.bz2 || _die "Failed to extract the pgbouncer staging archive" + rm -f pgbouncer-staging.tar.bz2 + + source $WD/Slony/staging/osx/versions-osx.sh + PG_BUILD_PGBOUNCER=$(expr $PG_BUILD_PGBOUNCER + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGBOUNCER -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/pgbouncer pushd staging/osx @@ -228,12 +263,15 @@ _postprocess_pgbouncer_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/PgBouncer - chmod a+x $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/PgBouncer - cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ PgBouncer $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with PgBouncer ($WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/installbuilder.sh)" - chmod a+x $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/PgBouncer + chmod a+x $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/PgBouncer + cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ PgBouncer $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with PgBouncer ($WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh)" + chmod a+x $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -241,18 +279,18 @@ _postprocess_pgbouncer_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app.tar.bz2 pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app || _die "Failed to create the archive." + tar -jcvf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app.tar.bz2 pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgbouncer*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app* || _die "Failed to clean the output directory." + scp pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app; mv pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx-signed.app pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app; mv pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx-signed.app pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.zip pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.zip pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/pgbouncer/build-windows.sh b/pgbouncer/build-windows.sh index 4207716d7..5124022c9 100644 --- a/pgbouncer/build-windows.sh +++ b/pgbouncer/build-windows.sh @@ -6,7 +6,7 @@ ################################################################################ _prep_pgbouncer_windows() { - + echo "BEGIN PREP pgbouncer Windows" # Enter the source directory and cleanup if required @@ -33,7 +33,7 @@ _prep_pgbouncer_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c del /S /Q pgbouncer-staging.zip" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c del /S /Q build-pgbouncer.bat" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q pgbouncer.windows" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q pgbouncer.staging" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q pgbouncer.staging.build" # Grab a copy of the source tree cp -R pgbouncer-$PG_VERSION_PGBOUNCER/* pgbouncer.windows || _die "Failed to copy the source code (source/pgbouncer-$PG_VERSION_PGBOUNCER)" @@ -82,44 +82,47 @@ _build_pgbouncer_windows() { @SET TEMP=/tmp REM Configuring, building the pgbouncer source tree -@echo cd $PG_PATH_WINDOWS;export COMMONDIR=\$PWD; cd pgbouncer.windows; CPPFLAGS="-I$PG_PGBUILD_MINGW_WINDOWS/include -D_mkgmtime32=_mkgmtime" LDFLAGS="-L$PG_PGBUILD_MINGW_WINDOWS/lib" ./configure --prefix=\$COMMONDIR/pgbouncer.staging --with-libevent=$PG_PGBUILD_MINGW_WINDOWS --with-openssl=$PG_PGBUILD_MINGW_WINDOWS; make; make install | $PG_MSYS_WINDOWS_PGBOUNCER\bin\sh --login -i +@echo cd $PG_PATH_WINDOWS;export COMMONDIR=\$PWD; cd pgbouncer.windows; CPPFLAGS="-I$PG_PGBUILD_MINGW_WINDOWS/include -D_mkgmtime32=_mkgmtime" LDFLAGS="-L$PG_PGBUILD_MINGW_WINDOWS/lib" ./configure --prefix=\$COMMONDIR/pgbouncer.staging.build --with-libevent=$PG_PGBUILD_MINGW_WINDOWS --with-openssl=$PG_PGBUILD_MINGW_WINDOWS; make; make install | $PG_MSYS_WINDOWS_PGBOUNCER\bin\sh --login -i EOT scp build-pgbouncer.bat $PG_SSH_WINDOWS:$PG_PATH_WINDOWS || _die "Failed to copy the scripts source tree to the windows build host (scripts.zip)" # Build the code and install into a temporary directory ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c build-pgbouncer.bat " || _die "Failed to build pgbouncer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\regex2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\bin" || _die "Failed to build pgbouncer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libevent*.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\bin" || _die "Failed to build pgbouncer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\bin" || _die "Failed to build pgbouncer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\bin" || _die "Failed to build pgbouncer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\share\\\\doc\\\\pgbouncer\\\\pgbouncer.ini $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\share" || _die "Failed to copy pgbouncer ini to share dir" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\regex2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\bin" || _die "Failed to build pgbouncer on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libevent*.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\bin" || _die "Failed to build pgbouncer on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\bin" || _die "Failed to build pgbouncer on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\bin" || _die "Failed to build pgbouncer on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\share\\\\doc\\\\pgbouncer\\\\pgbouncer.ini $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\share" || _die "Failed to copy pgbouncer ini to share dir" # Copy psql and dependent libraries # Requirement : server component should be build before this component mkdir -p $WD/pgbouncer/staging/windows/instscripts || _die "Failed to create the instscripts directory" # Copy the various support files into place - ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to create the pgbouncer.staging\\\\instscripts directory on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output\\\\bin\\\\psql.exe $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy the psql.exe to the pgbouncer.staging\\\\instscripts directory on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output\\\\bin\\\\libpq.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy the psql.exe to the pgbouncer.staging\\\\instscripts directory on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\vcredist\\\\vcredist_x86.exe $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy the VC++ runtimes on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to create the pgbouncer.staging.build\\\\instscripts directory on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output\\\\bin\\\\psql.exe $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy the psql.exe to the pgbouncer.staging.build\\\\instscripts directory on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output\\\\bin\\\\libpq.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy the psql.exe to the pgbouncer.staging.build\\\\instscripts directory on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\vcredist\\\\vcredist_x86.exe $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy the VC++ runtimes on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS\\\\pgbouncer.staging.build\\\\instscripts" || _die "Failed to copy a dependency DLL on the windows build host" + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\pgbouncer.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgbouncer.staging rd /S /Q pgbouncer.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\pgbouncer.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y pgbouncer.staging.build\\\\* pgbouncer.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_PGBOUNCER=$PG_VERSION_PGBOUNCER > $PG_PATH_WINDOWS\\\\pgbouncer.staging/versions-windows.sh" || _die "Failed to write pgbouncer version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_PGBOUNCER=$PG_BUILDNUM_PGBOUNCER >> $PG_PATH_WINDOWS\\\\pgbouncer.staging/versions-windows.sh" || _die "Failed to write pgbouncer build number into versions-windows.sh" + - # Zip up the installed code, copy it back here, and unpack. - echo "Copying pgbouncer built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\pgbouncer.staging; cmd /c zip -r ..\\\\pgbouncer-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer-staging.zip $WD/pgbouncer/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer-staging.zip)" - unzip $WD/pgbouncer/staging/windows/pgbouncer-staging.zip -d $WD/pgbouncer/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/pgbouncer-staging.zip)" - rm $WD/pgbouncer/staging/windows/pgbouncer-staging.zip - echo "END BUILD pgbouncer Windows" } @@ -131,6 +134,35 @@ _postprocess_pgbouncer_windows() { echo "BEGIN POST pgbouncer Windows" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/pgbouncer/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/pgbouncer/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/pgbouncer/staging/windows)" + mkdir -p $WD/pgbouncer/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/pgbouncer/staging/windows || _die "Couldn't set the permissions on the staging directory" + + echo "Creating staging doc directory ($WD/pgbouncer/staging/windows/pgbouncer/doc)" + mkdir -p $WD/pgbouncer/staging/windows/pgbouncer/doc || _die "Couldn't create the staging doc directory" + chmod 755 $WD/pgbouncer/staging/windows/pgbouncer/doc || _die "Couldn't set the permissions on the staging doc directory" + echo "Copying README.pgbouncer to staging doc directory" + cp $WD/pgbouncer/resources/README.pgbouncer $WD/pgbouncer/staging/windows/pgbouncer/doc/README-pgbouncer.txt || _die "Couldn't copy README.pgbouncer to staging doc directory" + unix2dos $WD/pgbouncer/staging/windows/pgbouncer/doc/README-pgbouncer.txt|| _die "Failed to convert pgbouncer readme in dos readable format." + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying pgbouncer built tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST pgbouncer-staging.zip del /S /Q pgbouncer-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\pgbouncer-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\pgbouncer.staging; cmd /c zip -r ..\\\\pgbouncer-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer-staging.zip $WD/pgbouncer/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/pgbouncer-staging.zip)" + unzip $WD/pgbouncer/staging/windows/pgbouncer-staging.zip -d $WD/pgbouncer/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/pgbouncer-staging.zip)" + rm $WD/pgbouncer/staging/windows/pgbouncer-staging.zip + + dos2unix $WD/pgbouncer/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/pgbouncer/staging/windows/versions-windows.sh + PG_BUILD_PGBOUNCER=$(expr $PG_BUILD_PGBOUNCER + $SKIPBUILD) + cd $WD/pgbouncer pushd staging/windows @@ -158,8 +190,18 @@ _postprocess_pgbouncer_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGBOUNCER -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-windows.exe $WD/output/pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-windows.exe" + win32_sign "pgbouncer-$PG_VERSION_PGBOUNCER-$PG_BUILDNUM_PGBOUNCER-${BUILD_FAILED}windows.exe" cd $WD diff --git a/pgmemcache/build-linux-x64.sh b/pgmemcache/build-linux-x64.sh index 390d82b6c..c8c46cdbc 100755 --- a/pgmemcache/build-linux-x64.sh +++ b/pgmemcache/build-linux-x64.sh @@ -14,7 +14,7 @@ _prep_pgmemcache_linux_x64() { PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux-x64 - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM + PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source # Remove any existing source directory that might exists, and create a clean one @@ -51,7 +51,7 @@ _build_pgmemcache_linux_x64() { PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux-x64 - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM + PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source/pgmemcache.$PGMEM_PLATFORM PG_PATH=$PG_PGHOME_LINUX_X64 PVT_SSH=$PG_SSH_LINUX_X64 @@ -71,17 +71,17 @@ _build_pgmemcache_linux_x64() { mkdir -p $PGMEM_STAGING/lib || _die "Failed to create lib directory" mkdir -p $PGMEM_STAGING/share/extension || _die "Failed to create share directory" - ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux-x64/lib/" || _die "Failed to copy the libmemcached binaries" + ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux-x64.build/lib/" || _die "Failed to copy the libmemcached binaries" cp -pR $PGMEM_SOURCE/pgmemcache.so $PGMEM_STAGING/lib || _die "Failed to copy the pgmemcache binary" cp -pR $PGMEM_SOURCE/*.sql $PGMEM_STAGING/share/extension || _die "Failed to copy the share files for the pgmemcache" cp -pR $PGMEM_SOURCE/pgmemcache.control $PGMEM_STAGING/share/extension || _die "Failed to copy the control file for the pgmemcache" - ssh $PVT_SSH "cp -pR /opt/local/Current/include/* $PVT_REPO/pgmemcache/staging/linux-x64/include" || _die "Failed to copy the header files for the libmemcached" + ssh $PVT_SSH "cp -pR /opt/local/Current/include/* $PVT_REPO/pgmemcache/staging/linux-x64.build/include" || _die "Failed to copy the header files for the libmemcached" chmod a+rx $PGMEM_STAGING/lib/* || _die "Failed to set permissions" chmod a+r $PGMEM_STAGING/share/extension/* || _die "Failed to set permissions" # Generate debug symbols - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX_X64/pgmemcache/staging/linux-x64" || _die "Failed to execute create_debug_symbols.sh" + ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX_X64/pgmemcache/staging/linux-x64.build" || _die "Failed to execute create_debug_symbols.sh" # Remove existing symbols directory in output directory if [ -e $WD/output/symbols/linux-x64/pgmemcache ]; @@ -92,7 +92,17 @@ _build_pgmemcache_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/pgmemcache/staging/linux-x64/symbols $WD/output/symbols/linux-x64/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/pgmemcache directory" + mv $WD/pgmemcache/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/pgmemcache directory" + + echo "Removing last successful staging directory ($WD/pgmemcache/staging/linux-x64)" + rm -rf $WD/pgmemcache/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgmemcache/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgmemcache/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgmemcache/staging/linux-x64.build/* $WD/pgmemcache/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE" > $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_PGMEMCACHE=$PG_BUILDNUM_PGMEMCACHE" >> $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh echo "END BUILD pgmemcache Linux-x64" } @@ -110,6 +120,9 @@ _postprocess_pgmemcache_linux_x64() { echo "# pgmemcache : LINUX-X64 : Post Process #" echo "#########################################" + source $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_PGMEMCACHE=$(expr $PG_BUILD_PGMEMCACHE + $SKIPBUILD) + PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux-x64 PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM @@ -130,6 +143,16 @@ _postprocess_pgmemcache_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml ${PGMEM_PLATFORM} || _die "Failed to build the installer (${PGMEM_PLATFORM})" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGMEMCACHE -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgmemcache-pg96-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux-x64.run $WD/output/pgmemcache-pg96-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST pgmemcache Linux-x64" diff --git a/pgmemcache/build-linux.sh b/pgmemcache/build-linux.sh index a30ff9708..2487cecc2 100755 --- a/pgmemcache/build-linux.sh +++ b/pgmemcache/build-linux.sh @@ -14,7 +14,7 @@ _prep_pgmemcache_linux() { PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM + PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source # Remove any existing source directory that might exists, and create a clean one @@ -33,7 +33,6 @@ _prep_pgmemcache_linux() { echo "Creating staging directory ($PGMEM_STAGING)" mkdir -p $PGMEM_STAGING || _die "Couldn't create the staging directory" - echo "END PREP pgmemcache Linux" } @@ -51,7 +50,7 @@ _build_pgmemcache_linux() { PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM + PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source/pgmemcache.$PGMEM_PLATFORM PG_PATH=$PG_PGHOME_LINUX PVT_SSH=$PG_SSH_LINUX @@ -71,17 +70,17 @@ _build_pgmemcache_linux() { mkdir -p $PGMEM_STAGING/lib || _die "Failed to create lib directory" mkdir -p $PGMEM_STAGING/share/extension || _die "Failed to create share directory" - ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux/lib/" || _die "Failed to copy the libmemcached binaries" + ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux.build/lib/" || _die "Failed to copy the libmemcached binaries" cp -pR $PGMEM_SOURCE/pgmemcache.so $PGMEM_STAGING/lib || _die "Failed to copy the pgmemcache binary" cp -pR $PGMEM_SOURCE/*.sql $PGMEM_STAGING/share/extension || _die "Failed to copy the share files for the pgmemcache" cp -pR $PGMEM_SOURCE/pgmemcache.control $PGMEM_STAGING/share/extension || _die "Failed to copy the control file for the pgmemcache" - ssh $PVT_SSH "cp -pR /opt/local/Current/include/libmemcached* $PVT_REPO/pgmemcache/staging/linux/include/" || _die "Failed to copy the header files for the libmemcached" + ssh $PVT_SSH "cp -pR /opt/local/Current/include/libmemcached* $PVT_REPO/pgmemcache/staging/linux.build/include/" || _die "Failed to copy the header files for the libmemcached" chmod a+rx $PGMEM_STAGING/lib/* || _die "Failed to set permissions" chmod a+r $PGMEM_STAGING/share/extension/* || _die "Failed to set permissions" # Generate debug symbols - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX/pgmemcache/staging/linux" || _die "Failed to execute create_debug_symbols.sh" + ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX/pgmemcache/staging/linux.build" || _die "Failed to execute create_debug_symbols.sh" # Remove existing symbols directory in output directory if [ -e $WD/output/symbols/linux/pgmemcache ]; @@ -92,7 +91,17 @@ _build_pgmemcache_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/pgmemcache/staging/linux/symbols $WD/output/symbols/linux/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux/symbols to $WD/output/symbols/linux/pgmemcache directory" + mv $WD/pgmemcache/staging/linux.build/symbols $WD/output/symbols/linux/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux.build/symbols to $WD/output/symbols/linux/pgmemcache directory" + + echo "Removing last successful staging directory ($WD/pgmemcache/staging/linux)" + rm -rf $WD/pgmemcache/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/pgmemcache/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/pgmemcache/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/pgmemcache/staging/linux.build/* $WD/pgmemcache/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE" > $WD/pgmemcache/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_PGMEMCACHE=$PG_BUILDNUM_PGMEMCACHE" >> $WD/pgmemcache/staging/linux/versions-linux.sh echo "END BUILD pgmemcache Linux" @@ -111,6 +120,9 @@ _postprocess_pgmemcache_linux() { echo "# pgmemcache : LINUX : Post Process #" echo "#######################################" + source $WD/pgmemcache/staging/linux/versions-linux.sh + PG_BUILD_PGMEMCACHE=$(expr $PG_BUILD_PGMEMCACHE + $SKIPBUILD) + PGMEM_PACKAGE_PATH=$WD/pgmemcache PGMEM_PLATFORM=linux PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM @@ -131,6 +143,16 @@ _postprocess_pgmemcache_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml ${PGMEM_PLATFORM} || _die "Failed to build the installer (${PGMEM_PLATFORM})" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGMEMCACHE -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/pgmemcache-pg96-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux.run $WD/output/pgmemcache-pg96-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}linux.run + cd $WD echo "END POST pgmemcache Linux" diff --git a/pgmemcache/build-osx.sh b/pgmemcache/build-osx.sh index 444ab376a..93ca7b345 100755 --- a/pgmemcache/build-osx.sh +++ b/pgmemcache/build-osx.sh @@ -5,7 +5,7 @@ ################################################################################ _prep_pgmemcache_osx() { - + echo "BEGIN PREP pgmemcache OSX" echo "########################################" @@ -38,7 +38,11 @@ _prep_pgmemcache_osx() { mkdir -p $PGMEM_STAGING || _die "Couldn't create the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/pgmemcache ]; then rm -rf $PG_PATH_OSX/pgmemcache/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/source" || _die "Falied to clean the pgmemcache/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/scripts" || _die "Falied to clean the pgmemcache/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/*.bz2" || _die "Falied to clean the pgmemcache/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/*.sh" || _die "Falied to clean the pgmemcache/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/staging/osx.build" || _die "Falied to clean the pgmemcache/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgmemcache/source" || _die "Failed to create the source dircetory on the build VM" @@ -77,9 +81,9 @@ cat < $WD/pgmemcache/build-pgmemcache.sh PGMEM_PACKAGE_PATH=$PG_PATH_OSX/pgmemcache PGMEM_PLATFORM=osx - PGMEM_STAGING=$PG_PATH_OSX/pgmemcache/staging/\$PGMEM_PLATFORM + PGMEM_STAGING=$PG_PATH_OSX/pgmemcache/staging/\${PGMEM_PLATFORM}.build PGMEM_SOURCE=$PG_PATH_OSX/pgmemcache/source/pgmemcache.\$PGMEM_PLATFORM - PG_PATH=$PG_PATH_OSX/server/staging_cache/\$PGMEM_PLATFORM + PG_PATH=$PG_PATH_OSX/server/staging/\$PGMEM_PLATFORM cd \$PGMEM_SOURCE PATH=\$PG_PATH/bin:\$PATH make CFLAGS="$PG_ARCH_OSX_CFLAGS -I/opt/local/Current/include -arch x86_64 -arch i386" LDFLAGS="-L/opt/local/Current/lib -arch x86_64 -arch i386" || _die "Failed to build the pgmemcache for \$PGMEM_PLATFORM" @@ -100,22 +104,22 @@ cat < $WD/pgmemcache/build-pgmemcache.sh cd \$PGMEM_STAGING/lib _rewrite_so_refs \$PGMEM_STAGING lib @loader_path/.. - install_name_tool -change "@loader_path/../lib/libmemcached.10.dylib" "@loader_path/libmemcached.10.dylib" $PG_PATH_OSX/pgmemcache/staging/osx/lib/pgmemcache.so + install_name_tool -change "@loader_path/../lib/libmemcached.10.dylib" "@loader_path/libmemcached.10.dylib" $PG_PATH_OSX/pgmemcache/staging/osx.build/lib/pgmemcache.so PGMEMCACHE cd $WD scp pgmemcache/build-pgmemcache.sh $PG_SSH_OSX:$PG_PATH_OSX/pgmemcache ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgmemcache; sh ./build-pgmemcache.sh" || _die "Failed to build the pgmemcache on OSX VM" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgmemcache/staging/osx; tar -jcvf pgmemcache-staging.tar.bz2 *" || _die "Failed to create archive of the pgmemcache staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/pgmemcache/staging/osx/pgmemcache-staging.tar.bz2 $WD/pgmemcache/staging/osx || _die "Failed to scp pgmemcache staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/pgmemcache/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/pgmemcache/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/pgmemcache/staging/osx" || _die "Couldn't create the last successful staging directory" - # Extract the staging archive - cd $WD/pgmemcache/staging/osx - tar -jxvf pgmemcache-staging.tar.bz2 || _die "Failed to extract the pgmemcache staging archive" - rm -f pgmemcache-staging.tar.bz2 + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR pgmemcache/staging/osx.build/* pgmemcache/staging/osx" || _die "Couldn't copy the existing staging directory" + ssh $PG_SSH_OSX "echo PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE > $PG_PATH_OSX/pgmemcache/staging/osx/versions-osx.sh" || _die "Failed to write pgmemcache version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE >> $PG_PATH_OSX/pgmemcache/staging/osx/versions-osx.sh" || _die "Failed to write pgmemcache build number into versions-osx.sh" echo "END BUILD pgmemcache OSX" } @@ -137,6 +141,35 @@ _postprocess_pgmemcache_osx() { PGMEM_PLATFORM=osx PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $PGMEM_STAGING ]; + then + echo "Removing existing staging directory" + rm -rf $PGMEM_STAGING || _die "Couldn't remove the existing staging directory ($PGMEM_STAGING)" + fi + echo "Creating staging directory ($PGMEM_STAGING)" + mkdir -p $PGMEM_STAGING || _die "Couldn't create the staging directory" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgmemcache/staging/osx; rm -f pgmemcache-staging.tar.bz2" || _die "Failed to remove archive of the pgmemcache staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/pgmemcache/staging/osx; tar -jcvf pgmemcache-staging.tar.bz2 *" || _die "Failed to create archive of the pgmemcache staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/pgmemcache/staging/osx/pgmemcache-staging.tar.bz2 $WD/pgmemcache/staging/osx || _die "Failed to scp pgmemcache staging" + + # Extract the staging archive + cd $WD/pgmemcache/staging/osx + tar -jxvf pgmemcache-staging.tar.bz2 || _die "Failed to extract the pgmemcache staging archive" + rm -f pgmemcache-staging.tar.bz2 + + source $WD/pgmemcache/staging/osx/versions-osx.sh + PG_BUILD_PGMEMCACHE=$(expr $PG_BUILD_PGMEMCACHE + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PGMEMCACHE -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $PGMEM_PACKAGE_PATH pushd staging/osx @@ -172,12 +205,15 @@ _postprocess_pgmemcache_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml $PGMEM_PLATFORM || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app/Contents/MacOS/pgmemcache-pg$PG_CURRENT_VERSION - chmod a+x $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app/Contents/MacOS/pgmemcache-pg$PG_CURRENT_VERSION - cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ pgmemcache-pg$PG_CURRENT_VERSION $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app/Contents/MacOS/installbuilder.sh - chmod a+rwx $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app/Contents/MacOS/pgmemcache-pg$PG_CURRENT_VERSION + chmod a+x $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app/Contents/MacOS/pgmemcache-pg$PG_CURRENT_VERSION + cp -f $WD/resources/extract_installbuilder.osx $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ pgmemcache-pg$PG_CURRENT_VERSION $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + chmod a+rwx $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -185,18 +221,18 @@ _postprocess_pgmemcache_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app.tar.bz2 pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app || _die "Failed to create the archive." + tar -jcvf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app.tar.bz2 pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgmemcahe*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app* || _die "Failed to clean the output directory." + scp pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app; mv pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx-signed.app pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app; mv pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx-signed.app pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.zip pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.zip pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/psqlODBC/build-linux-x64.sh b/psqlODBC/build-linux-x64.sh index 13f995a08..ccf83a8d7 100755 --- a/psqlODBC/build-linux-x64.sh +++ b/psqlODBC/build-linux-x64.sh @@ -25,15 +25,15 @@ _prep_psqlODBC_linux_x64() { cp -R psqlodbc-$PG_VERSION_PSQLODBC/* psqlODBC.linux-x64 || _die "Failed to copy the source code (source/psqlODBC-$PG_VERSION_PSQLODBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/psqlODBC/staging/linux-x64 ]; + if [ -e $WD/psqlODBC/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/psqlODBC/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/psqlODBC/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/psqlODBC/staging/linux-x64)" - mkdir -p $WD/psqlODBC/staging/linux-x64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/psqlODBC/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/psqlODBC/staging/linux-x64.build)" + mkdir -p $WD/psqlODBC/staging/linux-x64.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/psqlODBC/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP psqlODBC Linux-x64" } @@ -134,9 +134,8 @@ _build_psqlODBC_linux_x64() { cd $WD/psqlODBC - PG_STAGING=$PG_PATH_LINUX_X64/psqlODBC/staging/linux-x64 + PG_STAGING=$PG_PATH_LINUX_X64/psqlODBC/staging/linux-x64.build SOURCE_DIR=$PG_PATH_LINUX_X64/psqlODBC/source/psqlODBC.linux-x64 - PG_STAGING_CACHE=$WD/server/staging_cache/linux-x64 echo "Configuring psqlODBC sources" ssh $PG_SSH_LINUX_X64 "cd $SOURCE_DIR; export LD_LIBRARY_PATH=/opt/local/Current/lib:$PG_PGHOME_LINUX_X64/lib:\$LD_LIBRARY_PATH; export PATH=/opt/local/Current/bin:$PG_PGHOME_LINUX_X64/bin:\$PATH; CFLAGS=\"-I/opt/local/Current/include\" LDFLAGS=\"-L/opt/local/Current/lib\" ./configure --prefix=$PG_STAGING " || _die "Couldn't configure the psqlODBC sources" @@ -145,21 +144,21 @@ _build_psqlODBC_linux_x64() { echo "Installing psqlODBC into the sources" ssh $PG_SSH_LINUX_X64 "cd $SOURCE_DIR; make install" || _die "Couldn't install the psqlODBC into statging directory" - cd $WD/psqlODBC/staging/linux-x64/lib + cd $WD/psqlODBC/staging/linux-x64.build/lib # Copy in the dependency libraries - cp -pR $PG_STAGING_CACHE/lib/libpq.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libssl.so* . || _die "Failed to copy libssl.so" - cp -pR $PG_STAGING_CACHE/lib/libedit.so* . || _die "Failed to copy libedit.so" - cp -pR $PG_STAGING_CACHE/lib/libldap*.so* . || _die "Failed to copy libldap.so" - cp -pR $PG_STAGING_CACHE/lib/liblber*.so* . || _die "Failed to copy liblber.so" - cp -pR $PG_STAGING_CACHE/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" - cp -pR $PG_STAGING_CACHE/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" - cp -pR $PG_STAGING_CACHE/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" + cp -pR $WD/server/staging/linux-x64/lib/libpq.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux-x64/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux-x64/lib/libssl.so* . || _die "Failed to copy libssl.so" + cp -pR $WD/server/staging/linux-x64/lib/libedit.so* . || _die "Failed to copy libedit.so" + cp -pR $WD/server/staging/linux-x64/lib/libldap*.so* . || _die "Failed to copy libldap.so" + cp -pR $WD/server/staging/linux-x64/lib/liblber*.so* . || _die "Failed to copy liblber.so" + cp -pR $WD/server/staging/linux-x64/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" + cp -pR $WD/server/staging/linux-x64/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" + cp -pR $WD/server/staging/linux-x64/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" + cp -pR $WD/server/staging/linux-x64/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" + cp -pR $WD/server/staging/linux-x64/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" + cp -pR $WD/server/staging/linux-x64/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libodbcinst.so* $PG_STAGING/lib" || _die "Failed to copy libodbcinst.so" ssh $PG_SSH_LINUX_X64 "cp -pR /opt/local/Current/lib/libodbc.so* $PG_STAGING/lib" || _die "Failed to copy libodbc.so" @@ -190,7 +189,17 @@ _build_psqlODBC_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/psqlODBC/staging/linux-x64/symbols $WD/output/symbols/linux-x64/psqlODBC || _die "Failed to move $WD/psqlODBC/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/psqlODBC directory" + mv $WD/psqlODBC/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/psqlODBC || _die "Failed to move $WD/psqlODBC/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/psqlODBC directory" + + echo "Removing last successful staging directory ($WD/psqlODBC/staging/linux-x64)" + rm -rf $WD/psqlODBC/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/psqlODBC/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/psqlODBC/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/psqlODBC/staging/linux-x64.build/* $WD/psqlODBC/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PSQLODBC=$PG_VERSION_PSQLODBC" > $WD/psqlODBC/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_PSQLODBC=$PG_BUILDNUM_PSQLODBC" >> $WD/psqlODBC/staging/linux-x64/versions-linux-x64.sh echo "END BUILD psqlODBC Linux-x64" } @@ -204,6 +213,9 @@ _postprocess_psqlODBC_linux_x64() { echo "BEGIN POST psqlODBC Linux-x64" + source $WD/psqlODBC/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_PSQLODBC=$(expr $PG_BUILD_PSQLODBC + $SKIPBUILD) + cd $WD/psqlODBC pushd staging/linux-x64 @@ -250,6 +262,16 @@ _postprocess_psqlODBC_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PSQLODBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-linux-x64.run $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST psqlODBC Linux-x64" diff --git a/psqlODBC/build-linux.sh b/psqlODBC/build-linux.sh index 000143760..709160829 100755 --- a/psqlODBC/build-linux.sh +++ b/psqlODBC/build-linux.sh @@ -25,16 +25,16 @@ _prep_psqlODBC_linux() { cp -R psqlodbc-$PG_VERSION_PSQLODBC/* psqlODBC.linux || _die "Failed to copy the source code (source/psqlODBC-$PG_VERSION_PSQLODBC)" # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/psqlODBC/staging/linux ]; + if [ -e $WD/psqlODBC/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/psqlODBC/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/psqlODBC/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/psqlODBC/staging/linux)" - mkdir -p $WD/psqlODBC/staging/linux || _die "Couldn't create the staging directory" - chmod ugo+w $WD/psqlODBC/staging/linux || _die "Couldn't set the permissions on the staging directory" - + echo "Creating staging directory ($WD/psqlODBC/staging/linux.build)" + mkdir -p $WD/psqlODBC/staging/linux.build || _die "Couldn't create the staging directory" + chmod ugo+w $WD/psqlODBC/staging/linux.build || _die "Couldn't set the permissions on the staging directory" + echo "END PREP psqlODBC Linux" } @@ -132,9 +132,8 @@ _build_psqlODBC_linux() { cd $WD/psqlODBC - PG_STAGING=$PG_PATH_LINUX/psqlODBC/staging/linux + PG_STAGING=$PG_PATH_LINUX/psqlODBC/staging/linux.build SOURCE_DIR=$PG_PATH_LINUX/psqlODBC/source/psqlODBC.linux - PG_STAGING_CACHE=$WD/server/staging_cache/linux echo "Configuring psqlODBC sources" ssh $PG_SSH_LINUX "cd $SOURCE_DIR; export LD_LIBRARY_PATH=/opt/local/Current/lib:$PG_PGHOME_LINUX/lib:\$LD_LIBRARY_PATH; export PATH=/opt/local/Current/bin:$PG_PGHOME_LINUX/bin:\$PATH; CFLAGS=\"-I/opt/local/Current/include\" LDFLAGS=\"-L/opt/local/Current/lib\" ./configure --prefix=$PG_STAGING " || _die "Couldn't configure the psqlODBC sources" @@ -143,21 +142,21 @@ _build_psqlODBC_linux() { echo "Installing psqlODBC into the sources" ssh $PG_SSH_LINUX "cd $SOURCE_DIR; make install" || _die "Couldn't install the psqlODBC into statging directory" - cd $WD/psqlODBC/staging/linux/lib + cd $WD/psqlODBC/staging/linux.build/lib # Copy in the dependency libraries - cp -pR $PG_STAGING_CACHE/lib/libpq.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" - cp -pR $PG_STAGING_CACHE/lib/libssl.so* . || _die "Failed to copy libssl.so" - cp -pR $PG_STAGING_CACHE/lib/libedit.so* . || _die "Failed to copy libedit.so" - cp -pR $PG_STAGING_CACHE/lib/libldap*.so* . || _die "Failed to copy libldap.so" - cp -pR $PG_STAGING_CACHE/lib/liblber*.so* . || _die "Failed to copy liblber.so" - cp -pR $PG_STAGING_CACHE/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" - cp -pR $PG_STAGING_CACHE/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" - cp -pR $PG_STAGING_CACHE/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" - cp -pR $PG_STAGING_CACHE/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" - cp -pR $PG_STAGING_CACHE/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" + cp -pR $WD/server/staging/linux/lib/libpq.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux/lib/libcrypto.so* . || _die "Failed to copy libcrypto.so" + cp -pR $WD/server/staging/linux/lib/libssl.so* . || _die "Failed to copy libssl.so" + cp -pR $WD/server/staging/linux/lib/libedit.so* . || _die "Failed to copy libedit.so" + cp -pR $WD/server/staging/linux/lib/libldap*.so* . || _die "Failed to copy libldap.so" + cp -pR $WD/server/staging/linux/lib/liblber*.so* . || _die "Failed to copy liblber.so" + cp -pR $WD/server/staging/linux/lib/libgssapi_krb5*.so* . || _die "Failed to copy libgssapi_krb5.so" + cp -pR $WD/server/staging/linux/lib/libkrb5.so* . || _die "Failed to copy libkrb5.so" + cp -pR $WD/server/staging/linux/lib/libkrb5support*.so* . || _die "Failed to copy libkrb5support.so" + cp -pR $WD/server/staging/linux/lib/libk5crypto*.so* . || _die "Failed to copy libk5crypto.so" + cp -pR $WD/server/staging/linux/lib/libcom_err*.so* . || _die "Failed to copy libcom_err.so" + cp -pR $WD/server/staging/linux/lib/libncurses*.so* . || _die "Failed to copy libncurses.so" ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libodbcinst.so* $PG_STAGING/lib" || _die "Failed to copy libodbcinst.so" ssh $PG_SSH_LINUX "cp -pR /opt/local/Current/lib/libodbc.so* $PG_STAGING/lib" || _die "Failed to copy libodbc.so" @@ -188,7 +187,17 @@ _build_psqlODBC_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/psqlODBC/staging/linux/symbols $WD/output/symbols/linux/psqlODBC || _die "Failed to move $WD/psqlODBC/staging/linux/symbols to $WD/output/symbols/linux/psqlODBC directory" + mv $WD/psqlODBC/staging/linux.build/symbols $WD/output/symbols/linux/psqlODBC || _die "Failed to move $WD/psqlODBC/staging/linux.build/symbols to $WD/output/symbols/linux/psqlODBC directory" + + echo "Removing last successful staging directory ($WD/psqlODBC/staging/linux)" + rm -rf $WD/psqlODBC/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/psqlODBC/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/psqlODBC/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/psqlODBC/staging/linux.build/* $WD/psqlODBC/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_PSQLODBC=$PG_VERSION_PSQLODBC" > $WD/psqlODBC/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_PSQLODBC=$PG_BUILDNUM_PSQLODBC" >> $WD/psqlODBC/staging/linux/versions-linux.sh echo "END BUILD psqlODBC Linux" } @@ -202,6 +211,9 @@ _postprocess_psqlODBC_linux() { echo "BEGIN POST psqlODBC Linux" + source $WD/psqlODBC/staging/linux/versions-linux.sh + PG_BUILD_PSQLODBC=$(expr $PG_BUILD_PSQLODBC + $SKIPBUILD) + cd $WD/psqlODBC pushd staging/linux @@ -248,6 +260,16 @@ _postprocess_psqlODBC_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PSQLODBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-linux.run $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}linux.run + cd $WD echo "END POST psqlODBC Linux" diff --git a/psqlODBC/build-osx.sh b/psqlODBC/build-osx.sh index 03a68d098..5f18e9187 100644 --- a/psqlODBC/build-osx.sh +++ b/psqlODBC/build-osx.sh @@ -47,7 +47,11 @@ _prep_psqlODBC_osx() { chmod ugo+w $WD/psqlODBC/staging/osx || _die "Couldn't set the permissions on the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/psqlODBC ]; then rm -rf $PG_PATH_OSX/psqlODBC/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/source" || _die "Falied to clean the psqlODBC/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/scripts" || _die "Falied to clean the psqlODBC/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/*.bz2" || _die "Falied to clean the psqlODBC/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/*.sh" || _die "Falied to clean the psqlODBC/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/staging/osx.build" || _die "Falied to clean the psqlODBC/staging/osx.build directory on Mac OS X VM" echo "Copy the sources to the build VM" ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/psqlODBC/source" || _die "Failed to create the source dircetory on the build VM" @@ -78,7 +82,7 @@ _build_psqlODBC_osx() { echo " Build : psqlODBC(OSX)" echo "*******************************************************" - PG_STAGING=$PG_PATH_OSX/psqlODBC/staging/osx + PG_STAGING=$PG_PATH_OSX/psqlODBC/staging/osx.build SOURCE_DIR=$PG_PATH_OSX/psqlODBC/source/psqlODBC.osx #cd $SOURCE_DIR @@ -94,7 +98,7 @@ _build_psqlODBC_osx() { for ARCH in \${ARCHS} do echo "Configuring psqlODBC sources for \${ARCH}" - CFLAGS="$PG_ARCH_OSX_CFLAGS -arch \${ARCH}" LDFLAGS="-lssl" PATH="$PG_PGHOME_OSX/bin:$PATH" sh -x ./configure --disable-dependency-tracking --with-iodbc --with-libpq=$PG_PGHOME_OSX --prefix="$PG_STAGING" || _die "Could not configuring psqlODBC sources for intel" + CFLAGS="$PG_ARCH_OSX_CFLAGS -arch \${ARCH}" LDFLAGS="-lssl" PATH="$PG_PGHOME_OSX/bin:$PATH" sh -x ./configure --disable-dependency-tracking --with-iodbc --with-libpq=$PG_PATH_OSX/server/staging/osx --prefix="$PG_STAGING" || _die "Could not configuring psqlODBC sources for intel" ARCH_FLAGS="\${ARCH_FLAGS} -arch \${ARCH}" for configFile in \${CONFIG_FILES} do @@ -105,7 +109,7 @@ _build_psqlODBC_osx() { done echo "Configuring psqlODBC sources for Universal" - CFLAGS="$PG_ARCH_OSX_CFLAGS \${ARCH_FLAGS}" LDFLAGS="-lssl" PATH="$PG_PGHOME_OSX/bin:$PATH" ./configure --disable-dependency-tracking --with-iodbc --with-libpq=$PG_PGHOME_OSX --prefix="$PG_STAGING" || _die "Could not configuring psqlODBC sources for Universal" + CFLAGS="$PG_ARCH_OSX_CFLAGS \${ARCH_FLAGS}" LDFLAGS="-lssl" PATH="$PG_PGHOME_OSX/bin:$PATH" ./configure --disable-dependency-tracking --with-iodbc --with-libpq=$PG_PATH_OSX/server/staging/osx --prefix="$PG_STAGING" || _die "Could not configuring psqlODBC sources for Universal" # Create a replacement config.h's that will pull in the appropriate architecture-specific one: for configFile in \${CONFIG_FILES} @@ -139,7 +143,7 @@ EOT cp -R $PG_PGHOME_OSX/lib/libssl.*dylib $PG_STAGING/lib || _die "Failed to copy the dependency library" cp -R $PG_PGHOME_OSX/lib/libcrypto.*dylib $PG_STAGING/lib || _die "Failed to copy the dependency library" - _rewrite_so_refs $PG_PATH_OSX/psqlODBC/staging/osx lib @loader_path/.. + _rewrite_so_refs $PG_PATH_OSX/psqlODBC/staging/osx.build lib @loader_path/.. install_name_tool -change "libpq.5.dylib" "@loader_path/../lib/libpq.5.dylib" "$PG_STAGING/lib/psqlodbcw.so" install_name_tool -change "libssl.1.0.0.dylib" "@loader_path/../lib/libssl.1.0.0.dylib" "$PG_STAGING/lib/psqlodbcw.so" @@ -149,14 +153,16 @@ EOT-PSQLODBC scp psqlODBC/build-psqlodbc.sh $PG_SSH_OSX:$PG_PATH_OSX/psqlODBC ssh $PG_SSH_OSX "cd $PG_PATH_OSX/psqlODBC; sh ./build-psqlodbc.sh" || _die "Failed to build the psqlODBC on OSX VM" - # Copy the staging to controller to build the installers - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/psqlODBC/staging/osx; tar -jcvf psqlodbc-staging.tar.bz2 *" || _die "Failed to create archive of the psqlodbc staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/psqlODBC/staging/osx/psqlodbc-staging.tar.bz2 $WD/psqlODBC/staging/osx || _die "Failed to scp psqlodbc staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/psqlODBC/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/psqlODBC/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/psqlODBC/staging/osx" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR psqlODBC/staging/osx.build/* psqlODBC/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_PSQLODBC=$PG_VERSION_PSQLODBC > $PG_PATH_OSX/psqlODBC/staging/osx/versions-osx.sh" || _die "Failed to write psqlODBC version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_PSQLODBC=$PG_BUILDNUM_PSQLODBC >> $PG_PATH_OSX/psqlODBC/staging/osx/versions-osx.sh" || _die "Failed to write psqlODBC build number into versions-osx.sh" - # Extract the staging archive - cd $WD/psqlODBC/staging/osx - tar -jxvf psqlodbc-staging.tar.bz2 || _die "Failed to extract the psqlodbc staging archive" - rm -f psqlodbc-staging.tar.bz2 echo "END BUILD psqlODBC OSX" } @@ -173,6 +179,36 @@ _postprocess_psqlODBC_osx() { echo " Post Process : psqlODBC(OSX)" echo "*******************************************************" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/psqlODBC/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/psqlODBC/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/psqlODBC/staging/osx)" + mkdir -p $WD/psqlODBC/staging/osx || _die "Couldn't create the staging directory" + chmod ugo+w $WD/psqlODBC/staging/osx || _die "Couldn't set the permissions on the staging directory" + + # Copy the staging to controller to build the installers + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/psqlODBC/staging/osx; rm -f psqlodbc-staging.tar.bz2" || _die "Failed to remove archive of the psqlODBC staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/psqlODBC/staging/osx; tar -jcvf psqlodbc-staging.tar.bz2 *" || _die "Failed to create archive of the psqlodbc staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/psqlODBC/staging/osx/psqlodbc-staging.tar.bz2 $WD/psqlODBC/staging/osx || _die "Failed to scp psqlodbc staging" + + # Extract the staging archive + cd $WD/psqlODBC/staging/osx + tar -jxvf psqlodbc-staging.tar.bz2 || _die "Failed to extract the psqlodbc staging archive" + rm -f psqlodbc-staging.tar.bz2 + + source $WD/psqlODBC/staging/osx/versions-osx.sh + PG_BUILD_PSQLODBC=$(expr $PG_BUILD_PSQLODBC + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PSQLODBC -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/psqlODBC pushd staging/osx @@ -217,12 +253,15 @@ _postprocess_psqlODBC_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + # Rename the installer + mv $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app + # Using own scripts for extract-only mode - cp -f $WD/scripts/risePrivileges $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/psqlODBC - chmod a+x $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/psqlODBC - cp -f $WD/resources/extract_installbuilder.osx $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/installbuilder.sh - _replace @@PROJECTNAME@@ psqlODBC $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with psqlODBC ($WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/installbuilder.sh)" - chmod a+x $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app/Contents/MacOS/installbuilder.sh + cp -f $WD/scripts/risePrivileges $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/psqlODBC + chmod a+x $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/psqlODBC + cp -f $WD/resources/extract_installbuilder.osx $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh + _replace @@PROJECTNAME@@ psqlODBC $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh || _die "Failed to replace @@PROJECTNAME@@ with psqlODBC ($WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh)" + chmod a+x $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app/Contents/MacOS/installbuilder.sh cd $WD/output @@ -230,18 +269,18 @@ _postprocess_psqlODBC_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app.tar.bz2 psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app || _die "Failed to create the archive." + tar -jcvf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app.tar.bz2 psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf psqlodbc*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app* || _die "Failed to clean the output directory." + scp psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app; mv psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx-signed.app psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app; mv psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx-signed.app psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.zip psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.zip psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD diff --git a/psqlODBC/build-windows-x64.sh b/psqlODBC/build-windows-x64.sh index 42d5648f3..d32131095 100644 --- a/psqlODBC/build-windows-x64.sh +++ b/psqlODBC/build-windows-x64.sh @@ -49,7 +49,7 @@ _prep_psqlODBC_windows_x64() { ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC.zip del /S /Q psqlODBC.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC.zip on Windows VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST build-psqlODBC.bat del /S /Q build-psqlODBC.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\build-psqlODBC.bat on Windows VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC.windows-x64 rd /S /Q psqlODBC.windows-x64" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC.windows-x64 directory on Windows VM" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC.staging rd /S /Q psqlODBC.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC.staging.build rd /S /Q psqlODBC.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC.staging.build directory on Windows VM" # Copy sources on windows-x64 VM echo "Copying psqlODBC sources to Windows VM" @@ -88,25 +88,51 @@ EOT scp build-psqlODBC.bat $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64 ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c build-psqlODBC.bat" || _die "Failed to build psqlODBC" - # Zip up the installed code, copy it back here, and unpack. + echo "Removing last successful staging directory ($PG_PATH_WINDOWS_X64\\\\psqlODBC.staging)" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC.staging rd /S /Q psqlODBC.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\psqlODBC.staging" || _die "Couldn't create the last successful staging directory" - PSQLODBC_MAJOR_VERSION=`echo $PG_VERSION_PSQLODBC | cut -f1,2 -d "." | sed -e 's:\.::g'` + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c xcopy /E /Q /Y psqlODBC.windows-x64\\\\_Unicode_Release\\\\*.dll psqlODBC.staging" || _die "Couldn't copy the existing staging directory (Unicode Release)" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c xcopy /E /Q /Y psqlODBC.windows-x64\\\\_ANSI_Release\\\\*.dll psqlODBC.staging" || _die "Couldn't copy the existing staging directory (ANSI Release)" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_VERSION_PSQLODBC=$PG_VERSION_PSQLODBC > $PG_PATH_WINDOWS_X64\\\\psqlODBC.staging/versions-windows-x64.sh" || _die "Failed to write psqlODBC version number into versions-windows-x64.sh" + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_BUILDNUM_PSQLODBC=$PG_BUILDNUM_PSQLODBC >> $PG_PATH_WINDOWS_X64\\\\psqlODBC.staging/versions-windows-x64.sh" || _die "Failed to write psqlODBC build number into versions-windows-x64.sh" + +} + + +################################################################################ +# PG Build +################################################################################ + +_postprocess_psqlODBC_windows_x64() { + if [ -e $WD/psqlODBC/staging/windows-x64 ]; + then + echo "Removing existing staging directory" + rm -rf $WD/psqlODBC/staging/windows-x64 || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/psqlODBC/staging/windows-x64)" + mkdir -p $WD/psqlODBC/staging/windows-x64 || _die "Couldn't create the staging directory" + chmod ugo+w $WD/psqlODBC/staging/windows-x64 || _die "Couldn't set the permissions on the staging directory" mkdir -p $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to create directory for psqlODBC" mkdir -p $WD/psqlODBC/staging/windows-x64/etc || _die "Failed to create etc directory for psqlODBC" - echo "Copying psqlODBC built tree to Unix host" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\psqlODBC.windows-x64\\\\_ANSI_Release; zip -r ..\\\\..\\\\psqlODBC-windows-x64.zip *.dll" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC.windows-x64)" - scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-windows-x64.zip $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-windows-x64.zip)" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC-windows-x64.zip del /S /Q psqlODBC-windows-x64.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC-windows-x64.zip on Windows VM" - unzip -o $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-windows-x64.zip -d $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/psqlODBC-windows-x64.zip)" - rm $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-windows-x64.zip + + # Zip up the installed code, copy it back here, and unpack. + PSQLODBC_MAJOR_VERSION=`echo $PG_VERSION_PSQLODBC | cut -f1,2 -d "." | sed -e 's:\.::g'` echo "Copying psqlODBC built tree to Unix host" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\psqlODBC.windows-x64\\\\_Unicode_Release; zip -r ..\\\\..\\\\psqlODBC-windows-x64.zip *.dll" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC.windows-x64)" - scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-windows-x64.zip $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-windows-x64.zip)" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC-windows-x64.zip del /S /Q psqlODBC-windows-x64.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC-windows-x64.zip on Windows VM" - unzip -o $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-windows-x64.zip -d $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/psqlODBC-windows-x64.zip)" - rm $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-windows-x64.zip + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST psqlODBC-staging.zip del /S /Q psqlODBC-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\psqlODBC-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\psqlODBC.staging; cmd /c zip -r ..\\\\psqlODBC-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC.staging)" + scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-staging.zip $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/psqlODBC-staging.zip)" + unzip -o $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-staging.zip -d $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/bin/psqlODBC-staging.zip)" + rm $WD/psqlODBC/staging/windows-x64/bin/psqlODBC-staging.zip + mv $WD/psqlODBC/staging/windows-x64/bin/versions-windows-x64.sh $WD/psqlODBC/staging/windows-x64 || _die "Failed to move versions-windows-x64.sh" + + dos2unix $WD/psqlODBC/staging/windows-x64/versions-windows-x64.sh || _die "Failed to convert format of versions-windows-x64.sh from dos to unix" + source $WD/psqlODBC/staging/windows-x64/versions-windows-x64.sh + PG_BUILD_PSQLODBC=$(expr $PG_BUILD_PSQLODBC + $SKIPBUILD) scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/output/lib/libpq.dll $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to copy the dependent dll" scp $PG_SSH_WINDOWS_X64:$PG_PGBUILD_WINDOWS_X64/bin/ssleay32.dll $WD/psqlODBC/staging/windows-x64/bin || _die "Failed to copy the dependent dll" @@ -118,15 +144,6 @@ EOT scp $PG_SSH_WINDOWS_X64:$PG_PGBUILD_WINDOWS_X64/ssl/openssl.cnf $WD/psqlODBC/staging/windows-x64/etc || _die "Failed to copy the openssl.cnf" scp $PG_SSH_WINDOWS_X64:$PG_PGBUILD_WINDOWS_X64/vcredist/vcredist_x64.exe $WD/psqlODBC/staging/windows-x64/ || _die "Failed to copy the vcredist" -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_psqlODBC_windows_x64() { - cd $WD/psqlODBC pushd staging/windows-x64 @@ -147,8 +164,18 @@ _postprocess_psqlODBC_windows_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win64.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PSQLODBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-windows-x64.exe $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}windows-x64.exe + # Sign the installer - win32_sign "psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-windows-x64.exe" + win32_sign "psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}windows-x64.exe" cd $WD diff --git a/psqlODBC/build-windows.sh b/psqlODBC/build-windows.sh index 356d25a5e..e8f9f48f0 100755 --- a/psqlODBC/build-windows.sh +++ b/psqlODBC/build-windows.sh @@ -6,7 +6,7 @@ ################################################################################ _prep_psqlODBC_windows() { - + echo "BEGIN PREP psqlODBC Windows" # Enter the source directory and cleanup if required @@ -48,7 +48,7 @@ _prep_psqlODBC_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC.zip del /S /Q psqlODBC.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC.zip on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-psqlODBC.bat del /S /Q build-psqlODBC.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-psqlODBC.bat on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC.windows rd /S /Q psqlODBC.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC.staging rd /S /Q psqlODBC.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC.staging.build rd /S /Q psqlODBC.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC.staging.build directory on Windows VM" # Copy sources on windows VM echo "Copying psqlODBC sources to Windows VM" @@ -90,25 +90,54 @@ EOT scp build-psqlODBC.bat $PG_SSH_WINDOWS:$PG_PATH_WINDOWS ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c build-psqlODBC.bat" || _die "Failed to build psqlODBC" - # Zip up the installed code, copy it back here, and unpack. + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\psqlODBC.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC.staging rd /S /Q psqlODBC.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\psqlODBC.staging" || _die "Couldn't create the last successful staging directory" - PSQLODBC_MAJOR_VERSION=`echo $PG_VERSION_PSQLODBC | cut -f1,2 -d "." | sed -e 's:\.::g'` + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y psqlODBC.windows\\\\_Unicode_Release\\\\*.dll psqlODBC.staging" || _die "Couldn't copy the existing staging directory (Unicode Release)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y psqlODBC.windows\\\\_ANSI_Release\\\\*.dll psqlODBC.staging" || _die "Couldn't copy the existing staging directory (ANSI Release)" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_PSQLODBC=$PG_VERSION_PSQLODBC > $PG_PATH_WINDOWS\\\\psqlODBC.staging/versions-windows.sh" || _die "Failed to write psqlODBC version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_PSQLODBC=$PG_BUILDNUM_PSQLODBC >> $PG_PATH_WINDOWS\\\\psqlODBC.staging/versions-windows.sh" || _die "Failed to write psqlODBC build number into versions-windows.sh" + echo "END BUILD psqlODBC Windows" +} + + +################################################################################ +# PG Build +################################################################################ + +_postprocess_psqlODBC_windows() { + + echo "BEGIN POST psqlODBC Windows" + + if [ -e $WD/psqlODBC/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/psqlODBC/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/psqlODBC/staging/windows)" + mkdir -p $WD/psqlODBC/staging/windows || _die "Couldn't create the staging directory" + chmod ugo+w $WD/psqlODBC/staging/windows || _die "Couldn't set the permissions on the staging directory" mkdir -p $WD/psqlODBC/staging/windows/bin || _die "Failed to create directory for psqlODBC" mkdir -p $WD/psqlODBC/staging/windows/etc || _die "Failed to create etc directory for psqlODBC" - echo "Copying psqlODBC built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\psqlODBC.windows\\\\_Unicode_Release; cmd /c zip -r ..\\\\..\\\\psqlODBC-windows.zip *.dll" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC.windows)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-windows.zip $WD/psqlODBC/staging/windows/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-windows.zip)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC-windows.zip del /S /Q psqlODBC-windows.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC-windows.zip on Windows VM" - unzip -o $WD/psqlODBC/staging/windows/bin/psqlODBC-windows.zip -d $WD/psqlODBC/staging/windows/bin || _die "Failed to unpack the built source tree ($WD/staging/windows/psqlODBC-windows.zip)" - rm $WD/psqlODBC/staging/windows/bin/psqlODBC-windows.zip + + # Zip up the installed code, copy it back here, and unpack. + PSQLODBC_MAJOR_VERSION=`echo $PG_VERSION_PSQLODBC | cut -f1,2 -d "." | sed -e 's:\.::g'` echo "Copying psqlODBC built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\psqlODBC.windows\\\\_ANSI_Release; cmd /c zip -r ..\\\\..\\\\psqlODBC-windows.zip *.dll" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC.windows)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-windows.zip $WD/psqlODBC/staging/windows/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-windows.zip)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC-windows.zip del /S /Q psqlODBC-windows.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC-windows.zip on Windows VM" - unzip -o $WD/psqlODBC/staging/windows/bin/psqlODBC-windows.zip -d $WD/psqlODBC/staging/windows/bin || _die "Failed to unpack the built source tree ($WD/staging/windows/psqlODBC-windows.zip)" - rm $WD/psqlODBC/staging/windows/bin/psqlODBC-windows.zip + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST psqlODBC-staging.zip del /S /Q psqlODBC-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\psqlODBC-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\psqlODBC.staging; cmd /c zip -r ..\\\\psqlODBC-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-staging.zip $WD/psqlODBC/staging/windows/bin || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/psqlODBC-staging.zip)" + unzip -o $WD/psqlODBC/staging/windows/bin/psqlODBC-staging.zip -d $WD/psqlODBC/staging/windows/bin || _die "Failed to unpack the built source tree ($WD/staging/windows/bin/psqlODBC-staging.zip)" + rm $WD/psqlODBC/staging/windows/bin/psqlODBC-staging.zip + mv $WD/psqlODBC/staging/windows/bin/versions-windows.sh $WD/psqlODBC/staging/windows || _die "Failed to move versions-windows.sh" + + dos2unix $WD/psqlODBC/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/psqlODBC/staging/windows/versions-windows.sh + PG_BUILD_PSQLODBC=$(expr $PG_BUILD_PSQLODBC + $SKIPBUILD) scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/lib/libpq.dll $WD/psqlODBC/staging/windows/bin || _die "Failed to copy the dependent dll" scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/bin/ssleay32.dll $WD/psqlODBC/staging/windows/bin || _die "Failed to copy the dependent dll" @@ -121,18 +150,6 @@ EOT scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/ssl/openssl.cnf $WD/psqlODBC/staging/windows/etc || _die "Failed to copy the openssl.cnf" scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/vcredist/vcredist_x86.exe $WD/psqlODBC/staging/windows/ || _die "Failed to copy the vcredist" - echo "END BUILD psqlODBC Windows" -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_psqlODBC_windows() { - - echo "BEGIN POST psqlODBC Windows" - cd $WD/psqlODBC pushd staging/windows @@ -153,8 +170,18 @@ _postprocess_psqlODBC_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_PSQLODBC -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-windows.exe $WD/output/psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}windows.exe + # Sign the installer - win32_sign "psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-windows.exe" + win32_sign "psqlodbc-$PG_VERSION_PSQLODBC-$PG_BUILDNUM_PSQLODBC-${BUILD_FAILED}windows.exe" cd $WD diff --git a/server/build-linux-x64.sh b/server/build-linux-x64.sh index ceb8ae42e..171366544 100755 --- a/server/build-linux-x64.sh +++ b/server/build-linux-x64.sh @@ -44,12 +44,12 @@ _prep_server_linux_x64() { rm -rf $WD/server/staging_cache/linux-x64 || _die "Couldn't remove the existing staging_cache directory" fi - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/server/staging/linux-x64 ]; - then - echo "Removing existing staging directory" - rm -rf $WD/server/staging/linux-x64 || _die "Couldn't remove the existing staging directory" - fi + ## Remove any existing staging directory that might exist, and create a clean one + #if [ -e $WD/server/staging/linux-x64 ]; + #then + # echo "Removing existing staging directory" + # rm -rf $WD/server/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + #fi echo "Creating staging_cache directory ($WD/server/staging_cache/linux-x64)" mkdir -p $WD/server/staging_cache/linux-x64 || _die "Couldn't create the staging directory" @@ -511,6 +511,22 @@ EOT-PGADMIN mv $WD/server/staging_cache/linux-x64/pgAdmin4 $WD/server/staging_cache/linux-x64/pgAdmin\ 4/ touch $WD/server/staging_cache/linux-x64/pgAdmin\ 4/venv/lib/python2.7/site-packages/backports/__init__.py || _die "Failed to tocuh the __init__.py" + + echo "Removing last successful staging directory ($WD/server/staging/linux-x64)" + rm -rf $WD/server/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/server/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/server/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + mkdir -p $PGSERVER_STAGING_X64 || _die "Couldn't create the staging directory $PGSERVER_STAGING_X64" + mkdir -p $PGADMIN_STAGING_X64 || _die "Couldn't create the staging directory $PGADMIN_STAGING_X64" + mkdir -p $SB_STAGING_X64 || _die "Couldn't create the staging directory $SB_STAGING_X64" + mkdir -p $CLT_STAGING_X64 || _die "Couldn't create the staging directory $CLT_STAGING_X64" + chmod ugo+w $PGSERVER_STAGING_X64 $PGADMIN_STAGING_X64 $SB_STAGING_X64 $CLT_STAGING_X64 || _die "Couldn't set the permissions on the staging directory" + + echo "Copying the complete build to the successful staging directory" + echo "PG_MAJOR_VERSION=$PG_MAJOR_VERSION" > $WD/server/staging/linux-x64/versions-linux-x64.sh + echo "PG_MINOR_VERSION=$PG_MINOR_VERSION" >> $WD/server/staging/linux-x64/versions-linux-x64.sh + echo "PG_PACKAGE_VERSION=$PG_PACKAGE_VERSION" >> $WD/server/staging/linux-x64/versions-linux-x64.sh + echo "Preparing restructured staging for pgAdmin" cp -r "$WD/server/staging_cache/linux-x64/pgAdmin 4" $PGADMIN_STAGING_X64/ || _die "Failed to copy $WD/server/staging_cache/linux/pgAdmin\ 4" @@ -581,6 +597,9 @@ EOT-PGADMIN _postprocess_server_linux_x64() { echo "BEGIN POST Server Linux-x64" + source $WD/server/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_SERVER=$(expr $PG_BUILD_SERVER + $SKIPBUILD) + cd $WD/server #generate commandlinetools license file @@ -781,8 +800,15 @@ _postprocess_server_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-lin64.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SERVER -gt 0 ]; + then + BUILD_FAILED="" + fi + # Rename the installer - mv $WD/output/postgresql-$PG_MAJOR_VERSION-linux-x64-installer.run $WD/output/postgresql-$PG_PACKAGE_VERSION-linux-x64.run || _die "Failed to rename the installer" + mv $WD/output/postgresql-$PG_MAJOR_VERSION-linux-x64-installer.run $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}linux-x64.run || _die "Failed to rename the installer" cd $WD echo "END POST Server Linux-x64" diff --git a/server/build-linux.sh b/server/build-linux.sh index 1ac12a917..d4d64c211 100755 --- a/server/build-linux.sh +++ b/server/build-linux.sh @@ -44,12 +44,12 @@ _prep_server_linux() { rm -rf $WD/server/staging_cache/linux || _die "Couldn't remove the existing staging_cache directory" fi - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/server/staging/linux ]; - then - echo "Removing existing staging directory" - rm -rf $WD/server/staging/linux || _die "Couldn't remove the existing staging directory" - fi + ## Remove any existing staging directory that might exist, and create a clean one + #if [ -e $WD/server/staging/linux ]; + #then + # echo "Removing existing staging directory" + # rm -rf $WD/server/staging/linux || _die "Couldn't remove the existing staging directory" + #fi echo "Creating staging_cache directory ($WD/server/staging_cache/linux)" mkdir -p $WD/server/staging_cache/linux || _die "Couldn't create the staging directory" @@ -516,6 +516,21 @@ EOT-PGADMIN #PARESH cp -r "$WD/server/staging_cache/linux/pgAdmin 4" $PGADMIN_STAGING/ || _die "Failed to copy $WD/server/staging_cache/linux/pgAdmin\ 4" cp -r "$WD/server/staging_cache/linux/pgAdmin 4" $PGADMIN_STAGING/ + echo "Removing last successful staging directory ($WD/server/staging/linux)" + rm -rf $WD/server/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/server/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/server/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + mkdir -p $PGSERVER_STAGING || _die "Couldn't create the staging directory $PGSERVER_STAGING" + mkdir -p $PGADMIN_STAGING || _die "Couldn't create the staging directory $PGADMIN_STAGING" + mkdir -p $SB_STAGING || _die "Couldn't create the staging directory $SB_STAGING" + mkdir -p $CLT_STAGING || _die "Couldn't create the staging directory $CLT_STAGING" + chmod ugo+w $PGSERVER_STAGING $PGADMIN_STAGING $SB_STAGING $CLT_STAGING || _die "Couldn't set the permissions on the staging directory" + + echo "Copying the complete build to the successful staging directory" + echo "PG_MAJOR_VERSION=$PG_MAJOR_VERSION" > $WD/server/staging/linux/versions-linux.sh + echo "PG_MINOR_VERSION=$PG_MINOR_VERSION" >> $WD/server/staging/linux/versions-linux.sh + echo "PG_PACKAGE_VERSION=$PG_PACKAGE_VERSION" >> $WD/server/staging/linux/versions-linux.sh + echo "Preparing restructured staging for server" cp -r $WD/server/staging_cache/linux/bin $PGSERVER_STAGING || _die "Failed to copy $WD/server/staging_cache/linux/bin" cp -r $WD/server/staging_cache/linux/lib $PGSERVER_STAGING || _die "Failed to copy $WD/server/staging_cache/linux/lib" @@ -581,6 +596,9 @@ EOT-PGADMIN _postprocess_server_linux() { echo "BEGIN POST Server Linux" + source $WD/server/staging/linux/versions-linux.sh + PG_BUILD_SERVER=$(expr $PG_BUILD_SERVER + $SKIPBUILD) + cd $WD/server #generate commandlinetools license file @@ -771,9 +789,16 @@ _postprocess_server_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-linux.xml linux || _die "Failed to build the installer" - + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SERVER -gt 0 ]; + then + BUILD_FAILED="" + fi + # Rename the installer - mv $WD/output/postgresql-$PG_MAJOR_VERSION-linux-installer.run $WD/output/postgresql-$PG_PACKAGE_VERSION-linux.run || _die "Failed to rename the installer" + mv $WD/output/postgresql-$PG_MAJOR_VERSION-linux-installer.run $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}linux.run || _die "Failed to rename the installer" cd $WD echo "END POST Server Linux" diff --git a/server/build-osx.sh b/server/build-osx.sh index b8032436d..84c327d3c 100755 --- a/server/build-osx.sh +++ b/server/build-osx.sh @@ -78,7 +78,12 @@ _prep_server_osx() { fi echo "Cleaning the files in remote server directory" - ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/*" || _die "Falied to clean the server directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/source" || _die "Falied to clean the server/source directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/scripts" || _die "Falied to clean the server/scripts directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/resources" || _die "Falied to clean the server/resources directory on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/*.bz2" || _die "Falied to clean the server/*.bz2 files on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/*.sh" || _die "Falied to clean the server/*.sh scripts on Mac OS X VM" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/staging_cache/osx.build" || _die "Falied to clean the server directory on Mac OS X VM" echo "Creating staging_cache directory ($WD/server/staging/osx)" mkdir -p $WD/server/staging_cache/osx || _die "Couldn't create the staging_cache directory" @@ -126,7 +131,7 @@ _build_server_osx() { echo "*******************************************************" # First, build the server - PG_STAGING=$PG_PATH_OSX/server/staging_cache/osx + PG_STAGING=$PG_PATH_OSX/server/staging_cache/osx.build cd $WD/server/source/postgres.osx @@ -181,28 +186,11 @@ EOT echo "Building pldebugger module" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/postgres.osx/contrib/pldebugger; CFLAGS='$PG_ARCH_OSX_CFLAGS -arch i386 -arch x86_64' make -j4" || _die "Failed to build the debugger module" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/postgres.osx/contrib/pldebugger; make install" || _die "Failed to install the debugger module" - if [ ! -e $WD/server/staging_cache/osx/doc ]; - then - mkdir -p $WD/server/staging_cache/osx/doc || _die "Failed to create the doc directory" - fi - cp $WD/server/source/postgres.osx/contrib/pldebugger/README.pldebugger $WD/server/staging_cache/osx/doc || _die "Failed to copy the debugger README into the staging_cache directory" echo "Building uuid-ossp module" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/postgres.osx/contrib/uuid-ossp; CFLAGS='$PG_ARCH_OSX_CFLAGS -arch i386 -arch x86_64' make -j4" || _die "Failed to build the uuid-ossp module" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/postgres.osx/contrib/uuid-ossp; make install" || _die "Failed to install the uuid-ossp module" - # Install the PostgreSQL docs - mkdir -p $WD/server/staging_cache/osx/doc/postgresql/html || _die "Failed to create the doc directory" - cd $WD/server/staging_cache/osx/doc/postgresql/html || _die "Failed to change to the doc directory" - cp -pR $WD/server/source/postgres.osx/doc/src/sgml/html/* . || _die "Failed to copy the PostgreSQL documentation" - - # Install the PostgreSQL man pages - mkdir -p $WD/server/staging_cache/osx/share/man || _die "Failed to create the man directory" - cd $WD/server/staging_cache/osx/share/man || _die "Failed to change to the man directory" - cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man1 man1 || _die "Failed to copy the PostgreSQL man pages (osx)" - cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man3 man3 || _die "Failed to copy the PostgreSQL man pages (osx)" - cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man7 man7 || _die "Failed to copy the PostgreSQL man pages (osx)" - # Now, build pgAdmin #cd $WD/server/source/pgadmin.osx @@ -303,7 +291,7 @@ cat < $WD/server/build-pgadmin.sh cd $PG_PATH_OSX/server/resources/ # run complete-bundle to copy the dependent libraries and frameworks and fix the rpaths - PGDIR=$PG_PATH_OSX/server/staging_cache/osx QTDIR="`dirname $PG_QMAKE_OSX`/.." sh ./complete-bundle.sh "\$BUILDROOT/$APP_BUNDLE_NAME" || _die "complete-bundle.sh failed" + PGDIR=$PG_PATH_OSX/server/staging_cache/osx.build QTDIR="`dirname $PG_QMAKE_OSX`/.." sh ./complete-bundle.sh "\$BUILDROOT/$APP_BUNDLE_NAME" || _die "complete-bundle.sh failed" # copy the web directory to the bundle as it is required by runtime cp -r $PG_PATH_OSX/server/source/pgadmin.osx/web "\$BUILDROOT/$APP_BUNDLE_NAME/Contents/Resources/" @@ -327,7 +315,7 @@ cat < $WD/server/build-pgadmin.sh find . \( -name "*.pyc" -o -name "*.pyo" \) -delete # Copy the app bundle into place - cp -pR "\$BUILDROOT/$APP_BUNDLE_NAME" $PG_PATH_OSX/server/staging_cache/osx || _die "Failed to copy pgAdmin into the staging_cache directory" + cp -pR "\$BUILDROOT/$APP_BUNDLE_NAME" $PG_PATH_OSX/server/staging_cache/osx.build || _die "Failed to copy pgAdmin into the staging_cache directory" EOT-PGADMIN cd $WD @@ -336,7 +324,7 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server; sh -x ./build-pgadmin.sh" || _die "Failed to build pgadmin on OSX" #Fix permission in the staging/osx/share - ssh $PG_SSH_OSX "chmod -R a+r $PG_PATH_OSX/server/staging_cache/osx/share/postgresql/timezone/*" + ssh $PG_SSH_OSX "chmod -R a+r $PG_PATH_OSX/server/staging_cache/osx.build/share/postgresql/timezone/*" # Stackbuilder #cd $WD/server/source/stackbuilder.osx @@ -349,7 +337,7 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cp /opt/local/Current/certs/ca-bundle.crt $PG_PATH_OSX/server/source/stackbuilder.osx/stackbuilder.app/Contents/Resources/certs/ " || _die "Failed to copy certs bundle" # Copy the StackBuilder app bundle into place - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/stackbuilder.osx; cp -pR stackbuilder.app $PG_PATH_OSX/server/staging_cache/osx" || _die "Failed to copy StackBuilder into the staging_cache directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/stackbuilder.osx; cp -pR stackbuilder.app $PG_PATH_OSX/server/staging_cache/osx.build" || _die "Failed to copy StackBuilder into the staging_cache directory" # Copy the third party headers ssh $PG_SSH_OSX "cp -r /opt/local/Current/include/openssl $PG_STAGING/include" || _die "Failed to copy the required header" @@ -384,7 +372,7 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cp -pR /opt/local/Current/lib/libwx_base_carbonu_xml-*.dylib $PG_STAGING/lib/" || _die "Failed to copy the latest libuuid" # Copying plperl to staging/osx directory as we would not like to update the _rewrite_so_refs for it. - ssh $PG_SSH_OSX "cp -f $PG_PATH_OSX/server/staging_cache/osx/lib/postgresql/plperl.so $PG_PATH_OSX/server/staging_cache/osx/" + ssh $PG_SSH_OSX "cp -f $PG_PATH_OSX/server/staging_cache/osx.build/lib/postgresql/plperl.so $PG_PATH_OSX/server/staging_cache/osx.build/" # Rewrite shared library references (assumes that we only ever reference libraries in lib/) echo "Rewrite shared library references" @@ -400,10 +388,10 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cd $PG_STAGING; install_name_tool -id libpq.5.dylib \"$APP_BUNDLE_NAME/Contents/Frameworks/libpq.5.dylib\"" # Copying back plperl to staging/osx/lib/postgresql directory as we would not like to update the _rewrite_so_refs for it. - ssh $PG_SSH_OSX "mv -f $PG_PATH_OSX/server/staging_cache/osx/plperl.so $PG_PATH_OSX/server/staging_cache/osx/lib/postgresql/plperl.so" + ssh $PG_SSH_OSX "mv -f $PG_PATH_OSX/server/staging_cache/osx.build/plperl.so $PG_PATH_OSX/server/staging_cache/osx.build/lib/postgresql/plperl.so" # Changing loader path of plpython3.so - ssh $PG_SSH_OSX "install_name_tool -change libpython$PG_VERSION_PYTHON\m.dylib $PG_PYTHON_OSX/lib/libpython$PG_VERSION_PYTHON\m.dylib $PG_PATH_OSX/server/staging_cache/osx/lib/postgresql/plpython3.so" + ssh $PG_SSH_OSX "install_name_tool -change libpython$PG_VERSION_PYTHON\m.dylib $PG_PYTHON_OSX/lib/libpython$PG_VERSION_PYTHON\m.dylib $PG_PATH_OSX/server/staging_cache/osx.build/lib/postgresql/plpython3.so" ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/scripts/osx/getlocales; gcc -no-cpp-precomp $PG_ARCH_OSX_CFLAGS -arch i386 -arch x86_64 -o getlocales.osx -O0 getlocales.c" || _die "Failed to build getlocales utility" @@ -428,7 +416,49 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cp -pR $PG_STAGING/lib/libiconv*.dylib $PG_STAGING/stackbuilder/Frameworks/" || _die "Failed to copy the latest libiconv" ssh $PG_SSH_OSX "cp -pR $PG_STAGING/lib/libexpat*.dylib $PG_STAGING/stackbuilder/Frameworks/" || _die "Failed to copy the latest libexpat" + echo "Removing last successful staging directory ($PG_PATH_OSX/server/staging_cache/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/server/staging_cache/osx" || _die "Couldn't remove the last successful staging_cache directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/server/staging_cache/osx" || _die "Couldn't create the last successful staging_cache directory" + + echo "Copying the complete build to the successful staging_cache directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR server/staging_cache/osx.build/* server/staging_cache/osx" || _die "Couldn't copy the existing staging_cache directory" + + ssh $PG_SSH_OSX "echo PG_MAJOR_VERSION=$PG_MAJOR_VERSION > $PG_PATH_OSX/server/staging_cache/osx/versions-osx.sh" || _die "Failed to write server version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_MINOR_VERSION=$PG_MINOR_VERSION >> $PG_PATH_OSX/server/staging_cache/osx/versions-osx.sh" || _die "Failed to write server build number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_PACKAGE_VERSION=$PG_PACKAGE_VERSION >> $PG_PATH_OSX/server/staging_cache/osx/versions-osx.sh" || _die "Failed to write server build number into versions-osx.sh" + cd $WD + echo "END BUILD Server OSX" +} + + +################################################################################ +# Post process +################################################################################ + +_postprocess_server_osx() { + + echo "BEGIN POST Server OSX" + + echo "*******************************************************" + echo " Post Process : Server (OSX)" + echo "*******************************************************" + + PG_STAGING=$PG_PATH_OSX/server/staging_cache/osx + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/server/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/server/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/server/staging/osx)" + mkdir -p $WD/server/staging/osx || _die "Couldn't create the staging directory" + mkdir -p $PGSERVER_STAGING_OSX || _die "Couldn't create the staging directory $PGSERVER_STAGING_OSX" + mkdir -p $PGADMIN_STAGING_OSX || _die "Couldn't create the staging directory $PGADMIN_STAGING_OSX" + mkdir -p $SB_STAGING_OSX || _die "Couldn't create the staging directory $SB_STAGING_OSX" + mkdir -p $CLT_STAGING_OSX || _die "Couldn't create the staging directory $CLT_STAGING_OSX" + # Copy the staging to controller to build the installers ssh $PG_SSH_OSX "cd $PG_STAGING; tar -jcvf server-staging.tar.bz2 *" || _die "Failed to create archive of the server staging_cache" scp $PG_SSH_OSX:$PG_STAGING/server-staging.tar.bz2 $WD/server/staging_cache/osx || _die "Failed to scp server staging_cache" @@ -439,6 +469,31 @@ EOT-PGADMIN tar -jxvf server-staging.tar.bz2 || _die "Failed to extract the server staging archive" rm -f server-staging.tar.bz2 + mkdir -p $WD/server/staging_cache/osx/doc || _die "Failed to create the doc directory" + cp $WD/server/source/postgres.osx/contrib/pldebugger/README.pldebugger $WD/server/staging_cache/osx/doc || _die "Failed to copy the debugger README into the staging_cache directory" + + # Install the PostgreSQL docs + mkdir -p $WD/server/staging_cache/osx/doc/postgresql/html || _die "Failed to create the doc directory" + cd $WD/server/staging_cache/osx/doc/postgresql/html || _die "Failed to change to the doc directory" + cp -pR $WD/server/source/postgres.osx/doc/src/sgml/html/* . || _die "Failed to copy the PostgreSQL documentation" + + # Install the PostgreSQL man pages + mkdir -p $WD/server/staging_cache/osx/share/man || _die "Failed to create the man directory" + cd $WD/server/staging_cache/osx/share/man || _die "Failed to change to the man directory" + cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man1 man1 || _die "Failed to copy the PostgreSQL man pages (osx)" + cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man3 man3 || _die "Failed to copy the PostgreSQL man pages (osx)" + cp -pR $WD/server/source/postgres.osx/doc/src/sgml/man7 man7 || _die "Failed to copy the PostgreSQL man pages (osx)" + + source $WD/server/staging_cache/osx/versions-osx.sh + PG_BUILD_SERVER=$(expr $PG_BUILD_SERVER + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SERVER -gt 0 ]; + then + BUILD_FAILED="" + fi + # Copy the required Python executables scp $PG_SSH_OSX:$PGADMIN_PYTHON_OSX/Python $WD/server/staging_cache/osx/pgAdmin\ 4.app/Contents/Resources/venv/.Python @@ -502,22 +557,6 @@ EOT-PGADMIN ssh $PG_SSH_OSX "cd $PG_PATH_OSX; set -x; source settings.sh; source common.sh; cd $PG_STAGING; \ _rewrite_so_refs $PG_STAGING stackbuilder.app/Contents/Frameworks @loader_path/..; _rewrite_so_refs $PG_STAGING stackbuilder.app/Contents/MacOS @loader_path/../../.." - echo "END BUILD Server OSX" -} - - -################################################################################ -# Post process -################################################################################ - -_postprocess_server_osx() { - - echo "BEGIN POST Server OSX" - - echo "*******************************************************" - echo " Post Process : Server (OSX)" - echo "*******************************************************" - cd $WD/server #generate commandlinetools license file @@ -657,7 +696,7 @@ _postprocess_server_osx() { chmod a+x $WD/output/postgresql-$PG_MAJOR_VERSION-osx-installer.app/Contents/MacOS/installbuilder.sh # Rename the installer - mv $WD/output/postgresql-$PG_MAJOR_VERSION-osx-installer.app $WD/output/postgresql-$PG_PACKAGE_VERSION-osx.app || _die "Failed to rename the installer" + mv $WD/output/postgresql-$PG_MAJOR_VERSION-osx-installer.app $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app || _die "Failed to rename the installer" # Now we need to turn this into a DMG file echo "Creating disk image" @@ -665,7 +704,7 @@ _postprocess_server_osx() { # Clean existing source image directory if any rm -rf server.img* mkdir server.img || _die "Failed to create DMG staging directory" - mv postgresql-$PG_PACKAGE_VERSION-osx.app server.img || _die "Failed to copy the installer bundle into the DMG staging directory" + mv postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app server.img || _die "Failed to copy the installer bundle into the DMG staging directory" cp $WD/server/resources/README.osx server.img/README || _die "Failed to copy the installer README file into the DMG staging directory" tar -jcvf server.img.tar.bz2 server.img || _die "Failed to create the archive." @@ -677,9 +716,9 @@ _postprocess_server_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # sign the .app, create the DMG - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf server.img.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' --output ./server.img server.img/postgresql-$PG_PACKAGE_VERSION-osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX_SIGN/versions.sh; tar -jxvf server.img.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' --output ./server.img server.img/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output/server.img; rm -rf postgresql-$PG_PACKAGE_VERSION-osx.app; mv postgresql-$PG_PACKAGE_VERSION-osx-signed.app postgresql-$PG_PACKAGE_VERSION-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output/server.img; rm -rf postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app; mv postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx-signed.app postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; tar -jcvf server.img.tar.bz2 server.img;" || _die "faled to create server.img.tar.bz2 on $PG_SSH_OSX_SIGN" # Remove the existing source image archive before copying the signed image @@ -691,16 +730,16 @@ _postprocess_server_osx() { scp server.img.tar.bz2 $PG_SSH_OSX:$PG_PATH_OSX/output || _die "faled to copy server.img.tar.bz2 to $PG_PATH_OSX/output" rm -rf server.img* || _die "Failed to remove server.img from output directory." - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/output; source $PG_PATH_OSX/versions.sh; tar -jxvf server.img.tar.bz2; hdiutil create -quiet -anyowners -srcfolder server.img -format UDZO -volname 'PostgreSQL $PG_PACKAGE_VERSION' -ov 'postgresql-$PG_PACKAGE_VERSION-osx.dmg'" || _die "Failed to create the disk image (postgresql-$PG_PACKAGE_VERSION-osx.dmg)" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/output; source $PG_PATH_OSX/versions.sh; tar -jxvf server.img.tar.bz2; hdiutil create -quiet -anyowners -srcfolder server.img -format UDZO -volname 'PostgreSQL $PG_PACKAGE_VERSION' -ov 'postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.dmg'" || _die "Failed to create the disk image (postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.dmg)" echo "Attach the disk image, create zip and then detach the image" - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/output; hdid postgresql-$PG_PACKAGE_VERSION-osx.dmg" || _die "Failed to open the disk image (postgresql-$PG_PACKAGE_VERSION-osx.dmg in remote host.)" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/output; hdid postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.dmg" || _die "Failed to open the disk image (postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.dmg in remote host.)" - ssh $PG_SSH_OSX "cd '/Volumes/PostgreSQL $PG_PACKAGE_VERSION'; zip -r $PG_PATH_OSX/output/postgresql-$PG_PACKAGE_VERSION-osx.zip postgresql-$PG_PACKAGE_VERSION-osx.app" || _die "Failed to create the installer zip file (postgresql-$PG_PACKAGE_VERSION-osx.zip) in remote host." + ssh $PG_SSH_OSX "cd '/Volumes/PostgreSQL $PG_PACKAGE_VERSION'; zip -r $PG_PATH_OSX/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.zip postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.app" || _die "Failed to create the installer zip file (postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.zip) in remote host." ssh $PG_SSH_OSX "cd $PG_PATH_OSX; sleep 2; echo 'Detaching /Volumes/PostgreSQL $PG_PACKAGE_VERSION...' ; hdiutil detach '/Volumes/PostgreSQL $PG_PACKAGE_VERSION'" || _die "Failed to detach the /Volumes/PostgreSQL $PG_PACKAGE_VERSION in remote host." - scp $PG_SSH_OSX:$PG_PATH_OSX/output/postgresql-$PG_PACKAGE_VERSION-osx.* $WD/output || _die "Failed to copy installers to $WD/output." + scp $PG_SSH_OSX:$PG_PATH_OSX/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}osx.* $WD/output || _die "Failed to copy installers to $WD/output." # Delete the old installer from regression setup ssh $PG_SSH_OSX "cd /buildfarm/installers; rm -rf postgresql-*.dmg" || _die "Failed to remove the installer from regression installer directory" diff --git a/server/build-windows-x64.sh b/server/build-windows-x64.sh index 617bbb976..27525143b 100755 --- a/server/build-windows-x64.sh +++ b/server/build-windows-x64.sh @@ -65,7 +65,7 @@ _prep_server_windows_x64() { ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c del /S /Q vc-build.bat" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c del /S /Q vc-build-doc.bat" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c del /S /Q mingw-build-pgadmin4.bat" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q output" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q output.build" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q postgres.windows-x64" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q pgadmin.windows-x64" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q stackbuilder.windows-x64" @@ -144,7 +144,7 @@ CALL "$PG_VSINSTALLDIR_WINDOWS_X64\VC\vcvarsall.bat" x86 @SET WXWIN=$PG_WXWIN_WINDOWS @SET INCLUDE=$PG_PGBUILD_WINDOWS\\include;%INCLUDE% @SET LIB=$PG_PGBUILD_WINDOWS\\lib;%LIB% -@SET PGDIR=$PG_PATH_WINDOWS\\output +@SET PGDIR=$PG_PATH_WINDOWS\\output.build @SET SPHINXBUILD=$PG_PYTHON_WINDOWS_X64\\Scripts\\sphinx-build.exe IF "%2" == "UPGRADE" GOTO upgrade @@ -169,7 +169,7 @@ CALL "$PG_VSINSTALLDIR_WINDOWS_X64\VC\vcvarsall.bat" amd64 @SET WXWIN=$PG_WXWIN_WINDOWS_X64 @SET INCLUDE=$PG_PGBUILD_WINDOWS_X64\\include;%INCLUDE% @SET LIB=$PG_PGBUILD_WINDOWS_X64\\lib;%LIB% -@SET PGDIR=$PG_PATH_WINDOWS_X64\\output +@SET PGDIR=$PG_PATH_WINDOWS_X64\\output.build @SET SPHINXBUILD=$PG_PYTHON_WINDOWS_X64\\Scripts\\sphinx-build.exe REM batch file splits single argument containing "=" sign into two @@ -222,7 +222,7 @@ CALL "$PG_VSINSTALLDIR_WINDOWS_X64\VC\vcvarsall.bat" x86 @SET WXWIN=$PG_WXWIN_WINDOWS_X64 @SET INCLUDE=$PG_PGBUILD_WINDOWS_X64\\include;%INCLUDE% @SET LIB=$PG_PGBUILD_WINDOWS_X64\\lib;%LIB% -@SET PGDIR=$PG_PATH_WINDOWS_X64\\output +@SET PGDIR=$PG_PATH_WINDOWS_X64\\output.build @SET SPHINXBUILD=$PG_PYTHON_WINDOWS_X64\\Scripts\\sphinx-build.exe REM batch file splits single argument containing "=" sign into two @@ -380,10 +380,10 @@ EOT ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\validateuser; cmd /c $PG_PATH_WINDOWS_X64\\\\vc-build-x64.bat validateuser.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to build validateuser on the windows-x64 build host" # Move the resulting binaries into place - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\output\\\\installer\\\\server" || _die "Failed to create the server directory on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\createuser\\\\x64\\\\release\\\\createuser.exe $PG_PATH_WINDOWS_X64\\\\output\\\\installer\\\\server" || _die "Failed to copy the createuser proglet on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\getlocales\\\\x64\\\\release\\\\getlocales.exe $PG_PATH_WINDOWS_X64\\\\output\\\\installer\\\\server" || _die "Failed to copy the getlocales proglet on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\validateuser\\\\x64\\\\release\\\\validateuser.exe $PG_PATH_WINDOWS_X64\\\\output\\\\installer\\\\server" || _die "Failed to copy the validateuser proglet on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\output.build\\\\installer\\\\server" || _die "Failed to create the server directory on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\createuser\\\\x64\\\\release\\\\createuser.exe $PG_PATH_WINDOWS_X64\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the createuser proglet on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\getlocales\\\\x64\\\\release\\\\getlocales.exe $PG_PATH_WINDOWS_X64\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the getlocales proglet on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\validateuser\\\\x64\\\\release\\\\validateuser.exe $PG_PATH_WINDOWS_X64\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the validateuser proglet on the windows-x64 build host" # Zip up the source directory and copy it to the build host, then unzip cd $WD/server/source/ @@ -403,71 +403,71 @@ EOT # Build the code and install into a temporary directory ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/postgres.windows-x64/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS_X64/bin:$PG_CYGWIN_PYTHON_WINDOWS_X64:$PG_CYGWIN_TCL_WINDOWS_X64/bin:$PG_CYGWIN_PGBUILD_WINDOWS_X64/bin; export M4=$PG_CYGWIN_PGBUILD_WINDOWS_X64/bin/m4.exe; export VisualStudioVersion=12.0; ./build.bat RELEASE" || _die "Failed to build postgres on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/postgres.windows-x64/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS_X64/bin:$PG_CYGWIN_PYTHON_WINDOWS_X64:$PG_CYGWIN_TCL_WINDOWS_X64/bin; ./install.bat $PG_PATH_WINDOWS_X64\\\\output" || _die "Failed to install postgres on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/postgres.windows-x64/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS_X64/bin:$PG_CYGWIN_PYTHON_WINDOWS_X64:$PG_CYGWIN_TCL_WINDOWS_X64/bin; ./install.bat $PG_PATH_WINDOWS_X64\\\\output.build" || _die "Failed to install postgres on the windows-x64 build host" # Build the debugger plugins ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/postgres.windows-x64/contrib/pldebugger; cmd /c $PG_PATH_WINDOWS_X64\\\\vc-build-x64.bat pldebugger.proj" || _die "Failed to build the pldebugger plugin" # Copy the debugger plugins into place - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\postgres.windows-x64\\\\contrib\\\\pldebugger\\\\plugin_debugger.dll $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy the debugger plugin on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\postgres.windows-x64\\\\contrib\\\\pldebugger\\\\plugin_debugger.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy the debugger plugin on the windows-x64 build host" # Copy the various support files into place - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\vcredist\\\\vcredist_x64.exe $PG_PATH_WINDOWS_X64\\\\output\\\\installer" || _die "Failed to copy the VC++ runtimes on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libcurl.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\icu*.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\vcredist\\\\vcredist_x64.exe $PG_PATH_WINDOWS_X64\\\\output.build\\\\installer" || _die "Failed to copy the VC++ runtimes on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libcurl.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\icu*.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\ssleay32.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libeay32.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\VC\\\\libeay32MD.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\VC\\\\ssleay32MD.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\iconv.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libintl.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libxml2.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libxslt.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\zlib.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libcurl.lib $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\ssleay32.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libeay32.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\VC\\\\libeay32MD.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\VC\\\\ssleay32MD.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\iconv.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libintl.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libxml2.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libxslt.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\zlib.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\lib\\\\libcurl.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" # Copy the third party headers except GPL license headers mkdir $WD/server/staging_cache/windows-x64/3rdinclude/ scp $PG_SSH_WINDOWS_X64:$PG_PGBUILD_WINDOWS_X64/include/*.h $WD/server/staging_cache/windows-x64/3rdinclude/ || _die "Failed to copy the third party headers to $WD/server/staging_cache/windows-x64/3rdinclude/ )" find $WD/server/staging_cache/windows-x64/3rdinclude/ -name "*.h" -exec grep -rwl "GNU General Public License" {} \; -exec rm {} \; || _die "Failed to remove the GPL license header files." - scp -r $WD/server/staging_cache/windows-x64/3rdinclude/* $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64\\\\output\\\\include || _die "Failed to copy the third party headers to ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/output/include)" + scp -r $WD/server/staging_cache/windows-x64/3rdinclude/* $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64\\\\output.build\\\\include || _die "Failed to copy the third party headers to ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/output.build/include)" rm -rf $WD/server/staging_cache/windows-x64/3rdinclude || _die "Failed to remove the third party headers directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\openssl\"" || _die "Failed to create openssl directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\openssl\\\\*.h $PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\openssl" || _die "Failed to copy third party headers on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\libxml\"" || _die "Failed to create libxml directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\libxml\\\\*.h $PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\libxml" || _die "Failed to copy third party headers on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\libxslt\"" || _die "Failed to create libxslt directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\libxslt\\\\*.h $PG_PATH_WINDOWS_X64\\\\output\\\\include\\\\libxslt" || _die "Failed to copy third party headers on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\openssl\"" || _die "Failed to create openssl directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\openssl\\\\*.h $PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\openssl" || _die "Failed to copy third party headers on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\libxml\"" || _die "Failed to create libxml directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\libxml\\\\*.h $PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\libxml" || _die "Failed to copy third party headers on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\libxslt\"" || _die "Failed to create libxslt directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\include\\\\libxslt\\\\*.h $PG_PATH_WINDOWS_X64\\\\output.build\\\\include\\\\libxslt" || _die "Failed to copy third party headers on the windows-x64 build host" # Copy the wxWidgets libraries - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_net_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_xml_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_adv_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_aui_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_core_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_html_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_stc_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" - - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_net.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_xml.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_adv.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_aui.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_core.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_html.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_stc.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc.lib $PG_PATH_WINDOWS_X64\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_net_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_xml_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_adv_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_aui_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_core_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_html_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_stc_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc_vc_custom.dll $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows-x64 build host" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_net.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxbase28u_xml.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_adv.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_aui.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_core.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_html.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_stc.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_WXWIN_WINDOWS_X64\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc.lib $PG_PATH_WINDOWS_X64\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows-x64 build host" ##################### # pgAdmin ##################### @@ -477,11 +477,11 @@ EOT ssh -v $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c unzip -o pgadmin-win64.zip" || _die "Failed to unpack the source tree on the windows-x64 build host (pgadmin-win64.zip)" - #Create pgAdmin4 folder inside the output - ssh $PG_SSH_WINDOWS_X64 "mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to create a bin directory on the windows build host" + #Create pgAdmin4 folder inside the output.build + ssh $PG_SSH_WINDOWS_X64 "mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to create a bin directory on the windows build host" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\web; echo SERVER_MODE = False > config_distro.py; echo HELP_PATH = \'../../../docs/en_US/html/\' >> config_distro.py" || _die "Failed to copy config_distro.py on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cp -R $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\web \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\"" || _die "Failed to copy web folder on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cp -R $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\web \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\"" || _die "Failed to copy web folder on the windows build host" #create virtualenv and install required components using pip and compile documents and runtime ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; $PGADMIN_PYTHON_WINDOWS_X64/Scripts/virtualenv.exe venv" || _die "Failed to create venv"; @@ -489,67 +489,67 @@ EOT # and requires a two digit version. Hence, use 9.6 installation to build pgAdmin ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; source $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/activate; export PATH=$PG_PGBUILD_WINDOWS_X64\\\\pg96-windows-x64:\$PATH; $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/pip install -r requirements.txt --no-cache-dir" || _die "pip install failed" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; source $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/activate; $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/pip install sphinx" || _die "pip install sphinx failed" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/sphinx-build $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/docs/en_US \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\docs\\\\en_US\\\\html\"" || _die "Failed to compile html docs" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/sphinx-build $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/docs/en_US \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\docs\\\\en_US\\\\html\"" || _die "Failed to compile html docs" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/pgadmin.windows-x64; source $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/activate; $PG_PATH_WINDOWS_X64/pgadmin.windows-x64/venv/Scripts/pip uninstall -y sphinx" || _die "pip uninstall sphinx failed" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c $PG_PATH_WINDOWS_X64\\\\mingw-build-pgadmin4.bat" || _die "Failed to buildi pgadmin4 on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\runtime\\\Release\\\\pgAdmin4.exe \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a program file on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\runtime\\\Release\\\\pgAdmin4.exe \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a program file on the windows build host" #QT related libs - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icudt57.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icudt54.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icuin57.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuin54.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icuuc57.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuuc54.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Core.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Core.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Sql.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sql.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Gui.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Gui.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Qml.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Qml.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5OpenGL.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5OpenGL.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Quick.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Quick.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Sensors.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sensors.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Widgets.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Widgets.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebKit.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebKit.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebKitWidgets.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebKitWidgets.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libgcc_s_dw2-1.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libgcc_s_dw2-1.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libst* \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libstdc++-6.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libwinpthread-1.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libwinpthread-1.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libxml2-2.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxml2-2.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libxslt-1.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxslt-1.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Network.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Network.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Multimedia.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Multimedia.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebChannel.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebChannel.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Positioning.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Positioning.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5PrintSupport.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5PrintSupport.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5MultimediaWidgets.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5MultimediaWidgets.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\opengl32sw.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy opengl32sw.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libEGL.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libEGL.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libGLESv2.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libGLESv2.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Svg.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Svg.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to create a directory platforms on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to create bearer directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\qtwebengine\"" || _die "Failed to create qtwebengine directory" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\plugins\\\\platforms\\\\qwindows.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to copy qwindows.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\plugins\\\\bearer\\\\qnativewifibearer.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" - ssh $PG_SSH_WINDOWS_X64 "cmd /c cd \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"; echo [Paths] > qt.conf; echo Plugins=plugins >> qt.conf" || _die "Failed to create qt.conf" - ssh $PG_SSH_WINDOWS_X64 "cp $PGADMIN_PYTHON_DLL_WINDOWS_X64 \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a dependency $PGADMIN_PYTHON_DLL_WINDOWS_X64" - - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\ssleay32.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy sleay32.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libeay32.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libeay32.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libiconv-2.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libiconv-2.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libintl-8.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libintl-8.dll" - ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\output\\\\bin\\\\libpq.dll \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libpq.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icudt57.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icudt54.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icuin57.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuin54.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\icuuc57.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuuc54.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Core.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Core.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Sql.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sql.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Gui.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Gui.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Qml.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Qml.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5OpenGL.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5OpenGL.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Quick.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Quick.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Sensors.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sensors.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Widgets.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Widgets.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebKit.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebKit.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebKitWidgets.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebKitWidgets.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libgcc_s_dw2-1.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libgcc_s_dw2-1.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libst* \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libstdc++-6.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libwinpthread-1.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libwinpthread-1.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libxml2-2.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxml2-2.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libxslt-1.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxslt-1.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Network.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Network.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Multimedia.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Multimedia.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5WebChannel.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebChannel.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Positioning.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Positioning.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5PrintSupport.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5PrintSupport.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5MultimediaWidgets.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5MultimediaWidgets.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\opengl32sw.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy opengl32sw.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libEGL.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libEGL.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libGLESv2.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libGLESv2.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\Qt5Svg.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Svg.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to create a directory platforms on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to create bearer directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\qtwebengine\"" || _die "Failed to create qtwebengine directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\plugins\\\\platforms\\\\qwindows.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to copy qwindows.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\plugins\\\\bearer\\\\qnativewifibearer.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" + ssh $PG_SSH_WINDOWS_X64 "cmd /c cd \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"; echo [Paths] > qt.conf; echo Plugins=plugins >> qt.conf" || _die "Failed to create qt.conf" + ssh $PG_SSH_WINDOWS_X64 "cp $PGADMIN_PYTHON_DLL_WINDOWS_X64 \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a dependency $PGADMIN_PYTHON_DLL_WINDOWS_X64" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\ssleay32.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy sleay32.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_MINGW_QTPATH_WINDOWS_X64\\\\bin\\\\libeay32.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libeay32.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libiconv-2.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libiconv-2.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PGBUILD_WINDOWS_X64\\\\bin\\\\libintl-8.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libintl-8.dll" + ssh $PG_SSH_WINDOWS_X64 "cmd /c copy $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin\\\\libpq.dll \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libpq.dll" ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\Scripts" || _die "Failed to remove the venv\scripts directory on the build host" ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\tcl" || _die "Failed to remove the venv\tcl directory on the build host" ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\Include" || _die "Failed to remove the venv\Include directory on the build host" ssh $PG_SSH_WINDOWS_X64 "cmd /c del $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\pip-selfcheck.json" || _die "Failed to remove venn\pip-selfcheck.json on the build host" - ssh $PG_SSH_WINDOWS_X64 "cp -R $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\ \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\\"" || _die "Failed to copy venv folder on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\DLLs \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy DLLs folder on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\Lib \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy Lib folder on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c del /Q $PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin\ 4\\\\\venv\\\\Lib\\\\*.pyc" || _die "Failed to remove the pyc files on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin\ 4\\\\web\\\\regression" || _die "Failed to remove the regression directory on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin\ 4\\\\web\\\\pgadmin\\\feature_tests" || _die "Failed to remove the feature_tests directory on the windows build host" - ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\pythonw.exe \"$PG_PATH_WINDOWS_X64\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy pythonw.exe binary on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cp -R $PG_PATH_WINDOWS_X64\\\\pgadmin.windows-x64\\\\venv\\\\ \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\\"" || _die "Failed to copy venv folder on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\DLLs \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy DLLs folder on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\Lib \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy Lib folder on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c del /Q $PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin\ 4\\\\\venv\\\\Lib\\\\*.pyc" || _die "Failed to remove the pyc files on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin\ 4\\\\web\\\\regression" || _die "Failed to remove the regression directory on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c rd /S /Q $PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin\ 4\\\\web\\\\pgadmin\\\feature_tests" || _die "Failed to remove the feature_tests directory on the windows build host" + ssh $PG_SSH_WINDOWS_X64 "cp -R $PGADMIN_PYTHON_WINDOWS_X64\\\\pythonw.exe \"$PG_PATH_WINDOWS_X64\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy pythonw.exe binary on the windows build host" ##################### # StackBuilder @@ -561,19 +561,56 @@ EOT ssh -v $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c unzip -o stackbuilder-win64.zip" || _die "Failed to unpack the source tree on the windows-x64 build host (stackbuilder-win64.zip)" # Build the code - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/stackbuilder.windows-x64; cmd /c $PG_CMAKE_WINDOWS_X64/bin/cmake -G \"Visual Studio 12 Win64\" -D MS_VS_10=1 -D CURL_ROOT:PATH=$PG_PGBUILD_WINDOWS_X64 -D WX_ROOT_DIR=$PG_WXWIN_WINDOWS_X64 -D MSGFMT_EXECUTABLE=$PG_PGBUILD_WINDOWS_X64\\\\bin\\\\msgfmt -D CMAKE_INSTALL_PREFIX=$PG_PATH_WINDOWS_X64\\\\output\\\\StackBuilder -D CMAKE_CXX_FLAGS=\"/D _UNICODE /EHsc\" ." || _die "Failed to configure stackbuilder on the build host" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/stackbuilder.windows-x64; cmd /c $PG_CMAKE_WINDOWS_X64/bin/cmake -G \"Visual Studio 12 Win64\" -D MS_VS_10=1 -D CURL_ROOT:PATH=$PG_PGBUILD_WINDOWS_X64 -D WX_ROOT_DIR=$PG_WXWIN_WINDOWS_X64 -D MSGFMT_EXECUTABLE=$PG_PGBUILD_WINDOWS_X64\\\\bin\\\\msgfmt -D CMAKE_INSTALL_PREFIX=$PG_PATH_WINDOWS_X64\\\\output.build\\\\StackBuilder -D CMAKE_CXX_FLAGS=\"/D _UNICODE /EHsc\" ." || _die "Failed to configure stackbuilder on the build host" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/stackbuilder.windows-x64; cmd /c $PG_PATH_WINDOWS_X64\\\\vc-build-x64.bat stackbuilder.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to build stackbuilder on the build host" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/stackbuilder.windows-x64; cmd /c $PG_PATH_WINDOWS_X64\\\\vc-build-x64.bat INSTALL.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to install stackbuilder on the build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c mv $PG_PATH_WINDOWS_X64\\\\output\\\\StackBuilder\\\\bin\\\\stackbuilder.exe $PG_PATH_WINDOWS_X64\\\\output\\\\bin" || _die "Failed to relocate the stackbuilder executable on the build host" - ssh $PG_SSH_WINDOWS_X64 "cmd /c rd $PG_PATH_WINDOWS_X64\\\\output\\\\StackBuilder\\\\bin" || _die "Failed to remove the stackbuilder bin directory on the build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mv $PG_PATH_WINDOWS_X64\\\\output.build\\\\StackBuilder\\\\bin\\\\stackbuilder.exe $PG_PATH_WINDOWS_X64\\\\output.build\\\\bin" || _die "Failed to relocate the stackbuilder executable on the build host" + ssh $PG_SSH_WINDOWS_X64 "cmd /c rd $PG_PATH_WINDOWS_X64\\\\output.build\\\\StackBuilder\\\\bin" || _die "Failed to remove the stackbuilder bin directory on the build host" + echo "Removing last successful staging directory ($PG_PATH_WINDOWS_X64\\\\output)" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST output rd /S /Q output" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\output" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c xcopy /E /Q /Y output.build\\\\* output\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_MAJOR_VERSION=$PG_MAJOR_VERSION > $PG_PATH_WINDOWS_X64\\\\output/versions-windows-x64.sh" || _die "Failed to write server version number into versions-windows-x64.sh" + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_MINOR_VERSION=$PG_MINOR_VERSION >> $PG_PATH_WINDOWS_X64\\\\output/versions-windows-x64.sh" || _die "Failed to write server build number into versions-windows-x64.sh" + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_PACKAGE_VERSION=$PG_PACKAGE_VERSION >> $PG_PATH_WINDOWS_X64\\\\output/versions-windows-x64.sh" || _die "Failed to write server build number into versions-windows-x64.sh" + + cd $WD + echo "END BUILD Server Windows-x64" +} + + +################################################################################ +# Post process +################################################################################ + +_postprocess_server_windows_x64() { + echo "BEGIN POST Server Windows-x64" + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/server/staging/windows-x64 ]; + then + echo "Removing existing staging directory" + rm -rf $WD/server/staging/windows-x64 || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/server/staging/windows-x64)" + mkdir -p $WD/server/staging/windows-x64 || _die "Couldn't create the staging directory" # Zip up the installed code, copy it back here, and unpack. echo "Copying built tree to Unix host" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST output.zip del /S /Q output.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\output.zip on Windows VM" ssh -v $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\output; zip -r ..\\\\output.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/output)" rsync -av $PG_SSH_WINDOWS_X64:$PG_CYGWIN_PATH_WINDOWS_X64/output.zip $WD/server/staging_cache/windows-x64 || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/output.zip)" unzip -o $WD/server/staging_cache/windows-x64/output.zip -d $WD/server/staging_cache/windows-x64/ || _die "Failed to unpack the built source tree ($WD/staging_cache/windows-x64/output.zip)" rm $WD/server/staging_cache/windows-x64/output.zip + + dos2unix $WD/server/staging/windows-x64/versions-windows-x64.sh || _die "Failed to convert format of versions-windows-x64.sh from dos to unix" + source $WD/server/staging/windows-x64/versions-windows-x64.sh + PG_BUILD_SERVER=$(expr $PG_BUILD_SERVER + $SKIPBUILD) + scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/vcredist/vcredist_x86.exe $WD/server/staging_cache/windows-x64/installer || _die "Failed to copy the vcredist_x86.exe to windows-x64 staging_cache" # fixes #35408. In 9.5, some modules were moved from contrib to src/test/modules. They are meant for server testing @@ -663,18 +700,6 @@ EOT touch $PGADMIN_STAGING_WINDOWS_X64/pgAdmin\ 4/venv/Lib/site-packages/backports/__init__.py || _die "Failed to touch the __init__.py" - cd $WD - echo "END BUILD Server Windows-x64" -} - - -################################################################################ -# Post process -################################################################################ - -_postprocess_server_windows_x64() { - echo "BEGIN POST Server Windows-x64" - cd $WD/server #generate commandlinetools license file @@ -751,17 +776,24 @@ _postprocess_server_windows_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win64.xml windows || _die "Failed to build the installer" - + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SERVER -gt 0 ]; + then + BUILD_FAILED="" + fi + # Rename the installer - mv $WD/output/postgresql-$PG_MAJOR_VERSION-windows-installer.exe $WD/output/postgresql-$PG_PACKAGE_VERSION-windows-x64.exe || _die "Failed to rename the installer" + mv $WD/output/postgresql-$PG_MAJOR_VERSION-windows-installer.exe $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows-x64.exe || _die "Failed to rename the installer" # Sign the installer - win32_sign "postgresql-$PG_PACKAGE_VERSION-windows-x64.exe" + win32_sign "postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows-x64.exe" # Copy installer onto the build system ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c rd /S /Q component_installers" ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\component_installers" || _die "Failed to create the component_installers directory on the windows-x64 build host" - rsync -av $WD/output/postgresql-$PG_PACKAGE_VERSION-windows-x64.exe $PG_SSH_WINDOWS_X64:$PG_CYGWIN_PATH_WINDOWS_X64/component_installers || _die "Unable to copy installers at windows-x64 build machine." + rsync -av $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows-x64.exe $PG_SSH_WINDOWS_X64:$PG_CYGWIN_PATH_WINDOWS_X64/component_installers || _die "Unable to copy installers at windows-x64 build machine." cd $WD echo "END POST Server Windows-x64" diff --git a/server/build-windows.sh b/server/build-windows.sh index 06eb1d1d2..4952e2cab 100755 --- a/server/build-windows.sh +++ b/server/build-windows.sh @@ -63,7 +63,7 @@ _prep_server_windows() { ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c del /S /Q output.zip" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c del /S /Q vc-build.bat" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c del /S /Q mingw-build-pgadmin4.bat" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q output" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q output.build" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q postgres.windows" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q pgadmin.windows" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q stackbuilder.windows" @@ -143,7 +143,7 @@ CALL "$PG_VSINSTALLDIR_WINDOWS\VC\vcvarsall.bat" x86 @SET WXWIN=$PG_WXWIN_WINDOWS @SET INCLUDE=$PG_PGBUILD_WINDOWS\\include;%INCLUDE% @SET LIB=$PG_PGBUILD_WINDOWS\\lib;%LIB% -@SET PGDIR=$PG_PATH_WINDOWS\\output +@SET PGDIR=$PG_PATH_WINDOWS\\output.build @SET SPHINXBUILD=$PG_PYTHON_WINDOWS\\Scripts\\sphinx-build.exe REM batch file splits single argument containing "=" sign into two @@ -315,10 +315,10 @@ EOT ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\validateuser; cmd /c $PG_PATH_WINDOWS\\\\vc-build.bat validateuser.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to build validateuser on the windows build host" # Move the resulting binaries into place - ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\output\\\\installer\\\\server" || _die "Failed to create the server directory on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\createuser\\\\release\\\\createuser.exe $PG_PATH_WINDOWS\\\\output\\\\installer\\\\server" || _die "Failed to copy the createuser proglet on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\getlocales\\\\release\\\\getlocales.exe $PG_PATH_WINDOWS\\\\output\\\\installer\\\\server" || _die "Failed to copy the getlocales proglet on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\validateuser\\\\release\\\\validateuser.exe $PG_PATH_WINDOWS\\\\output\\\\installer\\\\server" || _die "Failed to copy the validateuser proglet on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\output.build\\\\installer\\\\server" || _die "Failed to create the server directory on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\createuser\\\\release\\\\createuser.exe $PG_PATH_WINDOWS\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the createuser proglet on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\getlocales\\\\release\\\\getlocales.exe $PG_PATH_WINDOWS\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the getlocales proglet on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\validateuser\\\\release\\\\validateuser.exe $PG_PATH_WINDOWS\\\\output.build\\\\installer\\\\server" || _die "Failed to copy the validateuser proglet on the windows build host" # Zip up the source directory and copy it to the build host, then unzip cd $WD/server/source/ @@ -335,71 +335,71 @@ EOT # Build the code and install into a temporary directory ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS/bin:$PG_CYGWIN_PYTHON_WINDOWS:$PG_CYGWIN_TCL_WINDOWS/bin; export VisualStudioVersion=12.0; ./build.bat " || _die "Failed to build postgres on the windows build host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS/bin:$PG_CYGWIN_PYTHON_WINDOWS:$PG_CYGWIN_TCL_WINDOWS/bin; ./install.bat $PG_PATH_WINDOWS\\\\output" || _die "Failed to install postgres on the windows build host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/src/tools/msvc; export PATH=\$PATH:$PG_CYGWIN_PERL_WINDOWS/bin:$PG_CYGWIN_PYTHON_WINDOWS:$PG_CYGWIN_TCL_WINDOWS/bin; ./install.bat $PG_PATH_WINDOWS\\\\output.build" || _die "Failed to install postgres on the windows build host" # Build the debugger plugins ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/contrib/pldebugger; cmd /c $PG_PATH_WINDOWS\\\\vc-build.bat pldebugger.proj Release" || _die "Failed to build the pldebugger plugin" # Copy the debugger plugins into place - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\postgres.windows\\\\contrib\\\\pldebugger\\\\plugin_debugger.dll $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy the debugger plugin on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\postgres.windows\\\\contrib\\\\pldebugger\\\\plugin_debugger.dll $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy the debugger plugin on the windows build host" # Copy the various support files into place - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\vcredist\\\\vcredist_x86.exe $PG_PATH_WINDOWS\\\\output\\\\installer" || _die "Failed to copy the VC++ runtimes on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (ssleay32.dd)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libeay32.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (iconv.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (intl.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libxml2.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libxslt.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (zlib1.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libcurl.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libcurl)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\icu*.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (icu*.dll)" - - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\ssleay32.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libeay32.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\VC\\\\libeay32MD.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\VC\\\\ssleay32MD.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\iconv.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libintl.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libxml2.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libxslt.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libcurl.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\vcredist\\\\vcredist_x86.exe $PG_PATH_WINDOWS\\\\output.build\\\\installer" || _die "Failed to copy the VC++ runtimes on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (ssleay32.dd)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libeay32.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (iconv.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (intl.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxml2.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libxml2.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libxslt.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libxslt.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib1.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (zlib1.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libcurl.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (libcurl)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\icu*.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (icu*.dll)" + + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\ssleay32.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libeay32.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\VC\\\\libeay32MD.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\VC\\\\ssleay32MD.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\iconv.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libintl.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libxml2.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libxslt.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\zlib.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\lib\\\\libcurl.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" # Copy the third party headers except GPL license headers mkdir $WD/server/staging_cache/windows/3rdinclude/ scp $PG_SSH_WINDOWS:$PG_PGBUILD_WINDOWS/include/*.h $WD/server/staging_cache/windows/3rdinclude/ || _die "Failed to copy the third party headers to $WD/server/staging_cache/windows/3rdinclude/ )" find $WD/server/staging_cache/windows/3rdinclude/ -name "*.h" -exec grep -rwl "GNU General Public License" {} \; -exec rm {} \; || _die "Failed to remove the GPL license header files." - scp -r $WD/server/staging_cache/windows/3rdinclude/* $PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\output\\\\include || _die "Failed to copy the third party headers to ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output/include)" + scp -r $WD/server/staging_cache/windows/3rdinclude/* $PG_SSH_WINDOWS:$PG_PATH_WINDOWS\\\\output.build\\\\include || _die "Failed to copy the third party headers to ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output.build/include)" rm -rf $WD/server/staging_cache/windows/3rdinclude || _die "Failed to remove the third party headers directory" - ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output\\\\include\\\\openssl\"" || _die "Failed to create openssl directory" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\openssl\\\\*.h $PG_PATH_WINDOWS\\\\output\\\\include\\\\openssl" || _die "Failed to copy third party headers on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output\\\\include\\\\libxml\"" || _die "Failed to create libxml directory" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\libxml\\\\*.h $PG_PATH_WINDOWS\\\\output\\\\include\\\\libxml" || _die "Failed to copy third party headers on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output\\\\include\\\\libxslt\"" || _die "Failed to create libxslt directory" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\libxslt\\\\*.h $PG_PATH_WINDOWS\\\\output\\\\include\\\\libxslt" || _die "Failed to copy third party headers on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\include\\\\openssl\"" || _die "Failed to create openssl directory" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\openssl\\\\*.h $PG_PATH_WINDOWS\\\\output.build\\\\include\\\\openssl" || _die "Failed to copy third party headers on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\include\\\\libxml\"" || _die "Failed to create libxml directory" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\libxml\\\\*.h $PG_PATH_WINDOWS\\\\output.build\\\\include\\\\libxml" || _die "Failed to copy third party headers on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\include\\\\libxslt\"" || _die "Failed to create libxslt directory" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\include\\\\libxslt\\\\*.h $PG_PATH_WINDOWS\\\\output.build\\\\include\\\\libxslt" || _die "Failed to copy third party headers on the windows build host" # Copy the wxWidgets libraries - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_net_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_net_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_xml_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_xml_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_adv_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_adv_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_aui_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_aui_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_core_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_core_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_html_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_html_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_stc_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_stc_vc_custom.dll)" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc_vc_custom.dll $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_xrc_vc_custom.dll)" - - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_net.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_xml.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_adv.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_aui.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_core.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_html.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_stc.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc.lib $PG_PATH_WINDOWS\\\\output\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_net_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_net_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_xml_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxbase28u_xml_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_adv_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_adv_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_aui_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_aui_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_core_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_core_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_html_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_html_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_stc_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_stc_vc_custom.dll)" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc_vc_custom.dll $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to copy a dependency DLL on the windows build host (wxmsw28u_xrc_vc_custom.dll)" + + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_net.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxbase28u_xml.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_adv.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_aui.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_core.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_html.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_stc.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_WXWIN_WINDOWS\\\\lib\\\\vc_dll\\\\wxmsw28u_xrc.lib $PG_PATH_WINDOWS\\\\output.build\\\\lib" || _die "Failed to copy a dependency lib on the windows build host" ##################### @@ -410,80 +410,80 @@ EOT rsync -av pgadmin.zip $PG_SSH_WINDOWS:$PG_CYGWIN_PATH_WINDOWS || _die "Failed to copy the source tree to the windows build host (pgadmin.zip)" ssh -v $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip -o pgadmin.zip" || _die "Failed to unpack the source tree on the windows build host (pgadmin.zip)" - #Create pgAdmin4 folder inside the output - ssh $PG_SSH_WINDOWS "mkdir \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" - ssh $PG_SSH_WINDOWS "mkdir \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" + #Create pgAdmin4 folder inside the output.build + ssh $PG_SSH_WINDOWS "mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" + ssh $PG_SSH_WINDOWS "mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to create a pgAdmin 4 directory on the windows build host" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\web; echo SERVER_MODE = False > config_distro.py; echo HELP_PATH = \'../../../docs/en_US/html/\' >> config_distro.py" || _die "Failed to copy config_distro.py on the windows build host" - ssh $PG_SSH_WINDOWS "cp -R $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\web \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\"" || _die "Failed to copy web folder on the windows build host" + ssh $PG_SSH_WINDOWS "cp -R $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\web \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\"" || _die "Failed to copy web folder on the windows build host" #create virtualenv and install required components using pip and compile documents and runtime ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; $PGADMIN_PYTHON_WINDOWS/Scripts/virtualenv.exe venv" || _die "Failed to create venv"; # In PG10, the version numbering scheme got changed and adopted a single digit major version (10) instead of two which is not supported by psycopg2 # and requires a two digit version. Hence, use 9.6 installation to build pgAdmin - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; source $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/activate; export PATH=$PG_PGBUILD_WINDOWS\\pg96-windows:$PG_CYGWIN_PATH_WINDOWS/output/lib:$PATH; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/pip install -r requirements.txt" || _die "pip install failed" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; source $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/activate; export PATH=$PG_PGBUILD_WINDOWS\\pg96-windows:$PG_CYGWIN_PATH_WINDOWS/output.build/lib:$PATH; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/pip install -r requirements.txt" || _die "pip install failed" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; source $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/activate; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/pip install sphinx" || _die "pip install sphinx failed" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/sphinx-build $PG_PATH_WINDOWS/pgadmin.windows/docs/en_US \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\docs\\\\en_US\\\\html\"" || _die "Failed to compile html docs" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/sphinx-build $PG_PATH_WINDOWS/pgadmin.windows/docs/en_US \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\docs\\\\en_US\\\\html\"" || _die "Failed to compile html docs" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/pgadmin.windows; source $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/activate; $PG_PATH_WINDOWS/pgadmin.windows/venv/Scripts/pip uninstall -y sphinx" || _die "pip uninstall sphinx failed" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c $PG_PATH_WINDOWS\\\\mingw-build-pgadmin4.bat" || _die "Failed to buildi pgadmin4 on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\runtime\\\Release\\\\pgAdmin4.exe \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a program file on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\runtime\\\Release\\\\pgAdmin4.exe \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a program file on the windows build host" #QT related libs - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icudt57.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icudt57.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icuin57.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuin57.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icuuc57.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuuc57.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Core.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Core.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Sql.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sql.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Gui.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Gui.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Qml.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Qml.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5OpenGL.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5OpenGL.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Quick.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Quick.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Sensors.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sensors.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Widgets.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Widgets.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebKit.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libQt5WebKit.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebKitWidgets.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libQt5WebKitWidgets.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libgcc_s_dw2-1.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libgcc_s_dw2-1.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libst* \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libstdc++-6.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libwinpthread-1.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libwinpthread-1.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libxml2-2.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxml2-2.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libxslt-1.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxslt-1.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Network.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Network.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Multimedia.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Multimedia.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\opengl32sw.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy opengl32sw.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libEGL.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libEGL.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libGLESv2.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libGLESv2.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Svg.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Svg.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebChannel.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebChannel.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Positioning.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Positioning.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5PrintSupport.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5PrintSupport.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5MultimediaWidgets.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5MultimediaWidgets.dll" - ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to create a directory platforms on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to create a directory bearer on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\platforms\\\\qwindows.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to copy qwindows.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\bearer\\\\qgenericbearer.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\bearer\\\\qnativewifibearer.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" - ssh $PG_SSH_WINDOWS "cmd /c cd \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"; echo [Paths] > qt.conf; echo Plugins=plugins >> qt.conf" || _die "Failed to create qt.conf" - - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy sleay32.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libeay32.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libiconv-2.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libintl-8.dll" - ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output\\\\bin\\\\libpq.dll \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libpq.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icudt57.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icudt57.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icuin57.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuin57.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\icuuc57.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy icuuc57.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Core.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Core.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Sql.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sql.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Gui.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Gui.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Qml.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Qml.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5OpenGL.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5OpenGL.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Quick.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Quick.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Sensors.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Sensors.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Widgets.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Widgets.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebKit.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libQt5WebKit.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebKitWidgets.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libQt5WebKitWidgets.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libgcc_s_dw2-1.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libgcc_s_dw2-1.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libst* \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libstdc++-6.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libwinpthread-1.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libwinpthread-1.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libxml2-2.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxml2-2.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libxslt-1.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libxslt-1.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Network.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Network.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Multimedia.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Multimedia.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\opengl32sw.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy opengl32sw.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libEGL.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libEGL.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\libGLESv2.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libGLESv2.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Svg.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Svg.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5WebChannel.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5WebChannel.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5Positioning.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5Positioning.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5PrintSupport.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5PrintSupport.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\bin\\\\Qt5MultimediaWidgets.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy Qt5MultimediaWidgets.dll" + ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to create a directory platforms on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c mkdir \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to create a directory bearer on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\platforms\\\\qwindows.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\"" || _die "Failed to copy qwindows.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\bearer\\\\qgenericbearer.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_MINGW_QTPATH_WINDOWS\\\\plugins\\\\bearer\\\\qnativewifibearer.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\\\\platforms\\\\bearer\"" || _die "Failed to copy bearer" + ssh $PG_SSH_WINDOWS "cmd /c cd \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"; echo [Paths] > qt.conf; echo Plugins=plugins >> qt.conf" || _die "Failed to create qt.conf" + + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\ssleay32.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy sleay32.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libeay32.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libeay32.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libiconv-2.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libiconv-2.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PGBUILD_WINDOWS\\\\bin\\\\libintl-8.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libintl-8.dll" + ssh $PG_SSH_WINDOWS "cmd /c copy $PG_PATH_WINDOWS\\\\output.build\\\\bin\\\\libpq.dll \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy libpq.dll" ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\Scripts" || _die "Failed to remove the venv\scripts directory on the build host" ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\tcl" || _die "Failed to remove the venv\tcl directory on the build host" ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\Include" || _die "Failed to remove the venv\Include directory on the build host" ssh $PG_SSH_WINDOWS "cmd /c del $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\pip-selfcheck.json" || _die "Failed to remove venn\pip-selfcheck.json on the build host" - ssh $PG_SSH_WINDOWS "cp -R $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\ \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\\"" || _die "Failed to copy venv folder on the windows build host" - ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\pythonw.exe \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy pythonw.exe binary on the windows build host" - ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\DLLs \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy DLLs folder on the windows build host" - ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\Lib \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy Lib folder on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c del /Q $PG_PATH_WINDOWS\\\\output\\\\pgAdmin\ 4\\\\venv\\\\Lib\\\\*.pyc" || _die "Failed to remove the pyc files on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\output\\\\pgAdmin\ 4\\\\web\\\\regression" || _die "Failed to remove the regression directory on the windows build host" - ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\output\\\\pgAdmin\ 4\\\\web\\\\pgadmin\\\\feature_tests" || _die "Failed to remove the feature_tests directory on the windows build host" - ssh $PG_SSH_WINDOWS "cp $PGADMIN_PYTHON_DLL_WINDOWS \"$PG_PATH_WINDOWS\\\\output\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a dependency $PGADMIN_PYTHON_DLL_WINDOWS" + ssh $PG_SSH_WINDOWS "cp -R $PG_PATH_WINDOWS\\\\pgadmin.windows\\\\venv\\\\ \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\\"" || _die "Failed to copy venv folder on the windows build host" + ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\pythonw.exe \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy pythonw.exe binary on the windows build host" + ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\DLLs \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy DLLs folder on the windows build host" + ssh $PG_SSH_WINDOWS "cp -R $PGADMIN_PYTHON_WINDOWS\\\\Lib \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\\venv\\\\\"" || _die "Failed to copy Lib folder on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c del /Q $PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin\ 4\\\\venv\\\\Lib\\\\*.pyc" || _die "Failed to remove the pyc files on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin\ 4\\\\web\\\\regression" || _die "Failed to remove the regression directory on the windows build host" + ssh $PG_SSH_WINDOWS "cmd /c rd /S /Q $PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin\ 4\\\\web\\\\pgadmin\\\\feature_tests" || _die "Failed to remove the feature_tests directory on the windows build host" + ssh $PG_SSH_WINDOWS "cp $PGADMIN_PYTHON_DLL_WINDOWS \"$PG_PATH_WINDOWS\\\\output.build\\\\pgAdmin 4\\\\bin\"" || _die "Failed to copy a dependency $PGADMIN_PYTHON_DLL_WINDOWS" ##################### # StackBuilder @@ -495,19 +495,55 @@ EOT ssh -v $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip -o stackbuilder.zip" || _die "Failed to unpack the source tree on the windows build host (stackbuilder.zip)" # Build the code - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/stackbuilder.windows; cmd /c cmake -D MS_VS_10=1 -D CURL_ROOT:PATH=$PG_PGBUILD_WINDOWS -D WX_ROOT_DIR=$PG_WXWIN_WINDOWS -D MSGFMT_EXECUTABLE=$PG_PGBUILD_WINDOWS\\\\bin\\\\msgfmt -D CMAKE_INSTALL_PREFIX=$PG_PATH_WINDOWS\\\\output\\\\StackBuilder -D CMAKE_CXX_FLAGS=\"/D _UNICODE /EHsc\" ." || _die "Failed to configure pgAdmin on the build host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/stackbuilder.windows; cmd /c cmake -D MS_VS_10=1 -D CURL_ROOT:PATH=$PG_PGBUILD_WINDOWS -D WX_ROOT_DIR=$PG_WXWIN_WINDOWS -D MSGFMT_EXECUTABLE=$PG_PGBUILD_WINDOWS\\\\bin\\\\msgfmt -D CMAKE_INSTALL_PREFIX=$PG_PATH_WINDOWS\\\\output.build\\\\StackBuilder -D CMAKE_CXX_FLAGS=\"/D _UNICODE /EHsc\" ." || _die "Failed to configure pgAdmin on the build host" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/stackbuilder.windows; cmd /c $PG_PATH_WINDOWS\\\\vc-build.bat stackbuilder.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to build stackbuilder on the build host" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/stackbuilder.windows; cmd /c $PG_PATH_WINDOWS\\\\vc-build.bat INSTALL.vcxproj Release $PLATFORM_TOOLSET" || _die "Failed to install stackbuilder on the build host" - ssh $PG_SSH_WINDOWS "cmd /c mv $PG_PATH_WINDOWS\\\\output\\\\StackBuilder\\\\bin\\\\stackbuilder.exe $PG_PATH_WINDOWS\\\\output\\\\bin" || _die "Failed to relocate the stackbuilder executable on the build host" - ssh $PG_SSH_WINDOWS "cmd /c rd $PG_PATH_WINDOWS\\\\output\\\\StackBuilder\\\\bin" || _die "Failed to remove the stackbuilder bin directory on the build host" + ssh $PG_SSH_WINDOWS "cmd /c mv $PG_PATH_WINDOWS\\\\output.build\\\\StackBuilder\\\\bin\\\\stackbuilder.exe $PG_PATH_WINDOWS\\\\output.build\\\\bin" || _die "Failed to relocate the stackbuilder executable on the build host" + ssh $PG_SSH_WINDOWS "cmd /c rd $PG_PATH_WINDOWS\\\\output.build\\\\StackBuilder\\\\bin" || _die "Failed to remove the stackbuilder bin directory on the build host" + + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\output)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST output rd /S /Q output" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\output" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y output.build\\\\* output\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_MAJOR_VERSION=$PG_MAJOR_VERSION > $PG_PATH_WINDOWS\\\\output/versions-windows.sh" || _die "Failed to write server version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_MINOR_VERSION=$PG_MINOR_VERSION >> $PG_PATH_WINDOWS\\\\output/versions-windows.sh" || _die "Failed to write server build number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_PACKAGE_VERSION=$PG_PACKAGE_VERSION >> $PG_PATH_WINDOWS\\\\output/versions-windows.sh" || _die "Failed to write server build number into versions-windows.sh" + + cd $WD + echo "END BUILD Server Windows" +} + +################################################################################ +# Post process +################################################################################ + +_postprocess_server_windows() { + echo "BEGIN POST Server Windows" + + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/server/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/server/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/server/staging/windows)" + mkdir -p $WD/server/staging/windows || _die "Couldn't create the staging directory" # Zip up the installed code, copy it back here, and unpack. echo "Copying built tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST output.zip del /S /Q output.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\output.zip on Windows VM" ssh -v $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\output; cmd /c zip -r ..\\\\output.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output)" rsync -av $PG_SSH_WINDOWS:$PG_CYGWIN_PATH_WINDOWS/output.zip $WD/server/staging_cache/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/output.zip)" unzip $WD/server/staging_cache/windows/output.zip -d $WD/server/staging_cache/windows/ || _die "Failed to unpack the built source tree ($WD/staging_cache/windows/output.zip)" rm $WD/server/staging_cache/windows/output.zip + dos2unix $WD/server/staging_cache/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/server/staging_cache/windows/versions-windows.sh + PG_BUILD_SERVER=$(expr $PG_BUILD_SERVER + $SKIPBUILD) + # fixes #35408. In 9.5, some modules were moved from contrib to src/test/modules. They are meant for server testing # and should not be packaged for distribution. On Unix, the top level make does not build these, but on windows it does. # Hence, removing the files of these modules from the staging_cache @@ -596,17 +632,6 @@ EOT touch $PGADMIN_STAGING_WINDOWS/pgAdmin\ 4/venv/Lib/site-packages/backports/__init__.py || _die "Failed to tocuh the __init__.py" - cd $WD - echo "END BUILD Server Windows" -} - -################################################################################ -# Post process -################################################################################ - -_postprocess_server_windows() { - echo "BEGIN POST Server Windows" - cd $WD/server #generate commandlinetools license file @@ -684,17 +709,24 @@ _postprocess_server_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" - + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SERVER -gt 0 ]; + then + BUILD_FAILED="" + fi + # Rename the installer - mv $WD/output/postgresql-$PG_MAJOR_VERSION-windows-installer.exe $WD/output/postgresql-$PG_PACKAGE_VERSION-windows.exe || _die "Failed to rename the installer" + mv $WD/output/postgresql-$PG_MAJOR_VERSION-windows-installer.exe $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows.exe || _die "Failed to rename the installer" # Sign the installer - win32_sign "postgresql-$PG_PACKAGE_VERSION-windows.exe" + win32_sign "postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows.exe" # Copy installer onto the build system ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c rd /S /Q component_installers" ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\component_installers" || _die "Failed to create the component_installers directory on the windows build host" - rsync -av $WD/output/postgresql-$PG_PACKAGE_VERSION-windows.exe $PG_SSH_WINDOWS:$PG_CYGWIN_PATH_WINDOWS/component_installers || _die "Unable to copy installers at windows build machine." + rsync -av $WD/output/postgresql-$PG_PACKAGE_VERSION-${BUILD_FAILED}windows.exe $PG_SSH_WINDOWS:$PG_CYGWIN_PATH_WINDOWS/component_installers || _die "Unable to copy installers at windows build machine." cd $WD echo "END POST Server Windows" diff --git a/sqlprotect/build-linux-x64.sh b/sqlprotect/build-linux-x64.sh index 7d96bd94c..8605563d9 100644 --- a/sqlprotect/build-linux-x64.sh +++ b/sqlprotect/build-linux-x64.sh @@ -23,15 +23,15 @@ _prep_sqlprotect_linux_x64() { git clone ssh://pginstaller@cvs.enterprisedb.com/git/SQLPROTECT # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/linux-x64 ]; + if [ -e $WD/sqlprotect/staging/linux-x64.build ]; then echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/linux-x64 || _die "Couldn't remove the existing staging directory" + rm -rf $WD/sqlprotect/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/sqlprotect/staging/linux-x64)" - mkdir -p $WD/sqlprotect/staging/linux-x64/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux-x64 || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/sqlprotect/staging/linux-x64.build)" + mkdir -p $WD/sqlprotect/staging/linux-x64.build/sqlprotect || _die "Couldn't create the staging directory" + chmod ugo+w $WD/sqlprotect/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP sqlprotect Linux-x64" } @@ -42,23 +42,23 @@ _prep_sqlprotect_linux_x64() { _build_sqlprotect_linux_x64() { - PG_STAGING=$PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64 + PG_STAGING=$PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build echo "BEGIN BUILD sqlprotect Linux-x64" ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/; make distclean ; make" || _die "Failed to build sqlprotect" - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/lib/postgresql" || _die "Failed to create staging/linux-x64/lib/postgresql" - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/share" || _die "Failed to create staging/linux-x64/share" - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/doc" || _die "Failed to create staging/linux-x64/doc" + ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/lib/postgresql" || _die "Failed to create staging/linux-x64.build/lib/postgresql" + ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/share" || _die "Failed to create staging/linux-x64.build/share" + ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/doc" || _die "Failed to create staging/linux-x64.build/doc" - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/share/" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - chmod -R ugo+r $WD/sqlprotect/staging/linux-x64 + ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" + ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/share/" || _die "Failed to copy sqlprotect.sql to staging directory" + ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" + chmod -R ugo+r $WD/sqlprotect/staging/linux-x64.build - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux-x64/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/linux-x64/sqlprotect_license.txt || _die "Unable to change permissions for license file" + cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux-x64.build/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" + chmod 444 $WD/sqlprotect/staging/linux-x64.build/sqlprotect_license.txt || _die "Unable to change permissions for license file" # Generate debug symbols ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" @@ -72,7 +72,17 @@ _build_sqlprotect_linux_x64() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/sqlprotect/staging/linux-x64/symbols $WD/output/symbols/linux-x64/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux-x64/symbols to $WD/output/symbols/linux-x64/sqlprotect directory" + mv $WD/sqlprotect/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/sqlprotect directory" + + echo "Removing last successful staging directory ($WD/sqlprotect/staging/linux-x64)" + rm -rf $WD/sqlprotect/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/sqlprotect/staging/linux-x64 || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/sqlprotect/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/sqlprotect/staging/linux-x64.build/* $WD/sqlprotect/staging/linux-x64 || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT" > $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh + echo "PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT" >> $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh echo "END BUILD sqlprotect Linux-x64" } @@ -86,6 +96,11 @@ _postprocess_sqlprotect_linux_x64() { echo "BEGIN POST sqlprotect Linux-x64" + source $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh + PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) + + _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + cd $WD/sqlprotect # Set permissions to all files and folders in staging @@ -94,6 +109,16 @@ _postprocess_sqlprotect_linux_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SQLPROTECT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-linux-x64.run $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}linux-x64.run + cd $WD echo "END POST sqlprotect Linux-x64" diff --git a/sqlprotect/build-linux.sh b/sqlprotect/build-linux.sh index cce835eb4..2a4cd4572 100644 --- a/sqlprotect/build-linux.sh +++ b/sqlprotect/build-linux.sh @@ -23,15 +23,15 @@ _prep_sqlprotect_linux() { git clone ssh://pginstaller@cvs.enterprisedb.com/git/SQLPROTECT # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/linux ]; + if [ -e $WD/sqlprotect/staging/linux.build ]; then echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/linux || _die "Couldn't remove the existing staging directory" + rm -rf $WD/sqlprotect/staging/linux.build || _die "Couldn't remove the existing staging directory" fi - echo "Creating staging directory ($WD/sqlprotect/staging/linux)" - mkdir -p $WD/sqlprotect/staging/linux/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux || _die "Couldn't set the permissions on the staging directory" + echo "Creating staging directory ($WD/sqlprotect/staging/linux.build)" + mkdir -p $WD/sqlprotect/staging/linux.build/sqlprotect || _die "Couldn't create the staging directory" + chmod ugo+w $WD/sqlprotect/staging/linux.build || _die "Couldn't set the permissions on the staging directory" echo "END PREP sqlprotect Linux" } @@ -42,24 +42,24 @@ _prep_sqlprotect_linux() { _build_sqlprotect_linux() { - PG_STAGING=$PG_PATH_LINUX/sqlprotect/staging/linux + PG_STAGING=$PG_PATH_LINUX/sqlprotect/staging/linux.build echo "BEGIN BUILD sqlprotect Linux" ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/; make distclean ; make" || _die "Failed to build sqlprotect" - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux/lib/postgresql" || _die "Failed to create staging/linux/lib/postgresql" - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux/share" || _die "Failed to create staging/linux/share" - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux/doc" || _die "Failed to create staging/linux/doc" + ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/lib/postgresql" || _die "Failed to create staging/linux.build/lib/postgresql" + ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/share" || _die "Failed to create staging/linux.build/share" + ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/doc" || _die "Failed to create staging/linux.build/doc" - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX/sqlprotect/staging/linux/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX/sqlprotect/staging/linux/share/" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX/sqlprotect/staging/linux/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" + ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX/sqlprotect/staging/linux.build/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" + ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX/sqlprotect/staging/linux.build/share/" || _die "Failed to copy sqlprotect.sql to staging directory" + ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX/sqlprotect/staging/linux.build/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - chmod -R ugo+r $WD/sqlprotect/staging/linux + chmod -R ugo+r $WD/sqlprotect/staging/linux.build - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/linux/sqlprotect_license.txt || _die "Unable to change permissions for license file" + cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux.build/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" + chmod 444 $WD/sqlprotect/staging/linux.build/sqlprotect_license.txt || _die "Unable to change permissions for license file" #Generate debug symbols ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" @@ -73,7 +73,17 @@ _build_sqlprotect_linux() { # Move symbols directory in output mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/sqlprotect/staging/linux/symbols $WD/output/symbols/linux/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux/symbols to $WD/output/symbols/linux/sqlprotect directory" + mv $WD/sqlprotect/staging/linux.build/symbols $WD/output/symbols/linux/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux.build/symbols to $WD/output/symbols/linux/sqlprotect directory" + + echo "Removing last successful staging directory ($WD/sqlprotect/staging/linux)" + rm -rf $WD/sqlprotect/staging/linux || _die "Couldn't remove the last successful staging directory" + mkdir -p $WD/sqlprotect/staging/linux || _die "Couldn't create the last successful staging directory" + chmod ugo+w $WD/sqlprotect/staging/linux || _die "Couldn't set the permissions on the successful staging directory" + + echo "Copying the complete build to the successful staging directory" + cp -rp $WD/sqlprotect/staging/linux.build/* $WD/sqlprotect/staging/linux || _die "Couldn't copy the existing staging directory" + echo "PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT" > $WD/sqlprotect/staging/linux/versions-linux.sh + echo "PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT" >> $WD/sqlprotect/staging/linux/versions-linux.sh echo "END BUILD sqlprotect Linux" } @@ -87,6 +97,11 @@ _postprocess_sqlprotect_linux() { echo "BEGIN POST sqlprotect Linux" + source $WD/sqlprotect/staging/linux/versions-linux.sh + PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) + + _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + cd $WD/sqlprotect # Set permissions to all files and folders in staging @@ -95,6 +110,16 @@ _postprocess_sqlprotect_linux() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SQLPROTECT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-linux.run $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}linux.run + cd $WD echo "END POST sqlprotect Linux" diff --git a/sqlprotect/build-osx.sh b/sqlprotect/build-osx.sh index ec7e27de4..0eedd058e 100644 --- a/sqlprotect/build-osx.sh +++ b/sqlprotect/build-osx.sh @@ -36,7 +36,7 @@ _prep_sqlprotect_osx() { chmod ugo+w $WD/sqlprotect/staging/osx || _die "Couldn't set the permissions on the staging directory" # Remove existing source and staging directories - ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/sqlprotect ]; then rm -rf $PG_PATH_OSX/sqlprotect/*; fi" || _die "Couldn't remove the existing files on OS X build server" + ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/sqlprotect ]; then rm -rf $PG_PATH_OSX/sqlprotect/staging/osx.build; fi" || _die "Couldn't remove sqlprotect/staging/osx.build on OS X build server" ssh $PG_SSH_OSX "if [ -d $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT ]; then rm -rf $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT; fi" || _die "Couldn't remove the existing files on OS X build server" echo "Copy the sources to the build VM" @@ -60,26 +60,24 @@ _build_sqlprotect_osx() { ssh $PG_SSH_OSX "cd $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/; make distclean ; make" || _die "Failed to build sqlprotect" - ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx/lib/postgresql" || _die "Failed to create staging/osx/lib/postgresql" - ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx/share" || _die "Failed to create staging/osx/share" - ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx/doc" || _die "Failed to create staging/osx/doc" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx.build/lib/postgresql" || _die "Failed to create staging/osx/lib/postgresql" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx.build/share" || _die "Failed to create staging/osx/share" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx.build/doc" || _die "Failed to create staging/osx/doc" - ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_OSX/sqlprotect/staging/osx/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" - ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_OSX/sqlprotect/staging/osx/share/" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_OSX/sqlprotect/staging/osx/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - chmod -R ugo+r $WD/sqlprotect/staging/osx + ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_OSX/sqlprotect/staging/osx.build/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" + ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_OSX/sqlprotect/staging/osx.build/share/" || _die "Failed to copy sqlprotect.sql to staging directory" + ssh $PG_SSH_OSX "cp $PG_PATH_OSX/server/source/postgres.osx/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_OSX/sqlprotect/staging/osx.build/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - ssh $PG_SSH_OSX "cd $PG_PATH_OSX/sqlprotect/staging/osx; tar -jcvf sqlprotect-staging.tar.bz2 *" || _die "Failed to create archive of the sqlprotect staging" - scp $PG_SSH_OSX:$PG_PATH_OSX/sqlprotect/staging/osx/sqlprotect-staging.tar.bz2 $WD/sqlprotect/staging/osx || _die "Failed to scp sqlprotect staging" + echo "Removing last successful staging directory ($PG_PATH_OSX/sqlprotect/staging/osx)" + ssh $PG_SSH_OSX "rm -rf $PG_PATH_OSX/sqlprotect/staging/osx" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_OSX "mkdir -p $PG_PATH_OSX/sqlprotect/staging/osx" || _die "Couldn't create the last successful staging directory" - # Extract the staging archive - cd $WD/sqlprotect/staging/osx - tar -jxvf sqlprotect-staging.tar.bz2 || _die "Failed to extract the sqlprotect staging archive" - rm -f sqlprotect-staging.tar.bz2 + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX; cp -PR sqlprotect/staging/osx.build/* sqlprotect/staging/osx" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_OSX "echo PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT > $PG_PATH_OSX/sqlprotect/staging/osx/versions-osx.sh" || _die "Failed to write sqlprotect version number into versions-osx.sh" + ssh $PG_SSH_OSX "echo PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT >> $PG_PATH_OSX/sqlprotect/staging/osx/versions-osx.sh" || _die "Failed to write sqlprotect build number into versions-osx.sh" - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/osx/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/osx/sqlprotect_license.txt || _die "Unable to change permissions for license file" - echo "END BUILD sqlprotect OSX" } @@ -92,6 +90,41 @@ _postprocess_sqlprotect_osx() { echo "BEGIN POST sqlprotect OSX" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/sqlprotect/staging/osx ]; + then + echo "Removing existing staging directory" + rm -rf $WD/sqlprotect/staging/osx || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/sqlprotect/staging/osx)" + mkdir -p $WD/sqlprotect/staging/osx/sqlprotect || _die "Couldn't create the staging directory" + chmod ugo+w $WD/sqlprotect/staging/osx || _die "Couldn't set the permissions on the staging directory" + + _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + + chmod -R ugo+r $WD/sqlprotect/staging/osx.build + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/sqlprotect/staging/osx; rm -f sqlprotect-staging.tar.bz2" || _die "Failed to remove archive of the sqlprotect staging" + ssh $PG_SSH_OSX "cd $PG_PATH_OSX/sqlprotect/staging/osx; tar -jcvf sqlprotect-staging.tar.bz2 *" || _die "Failed to create archive of the sqlprotect staging" + scp $PG_SSH_OSX:$PG_PATH_OSX/sqlprotect/staging/osx/sqlprotect-staging.tar.bz2 $WD/sqlprotect/staging/osx || _die "Failed to scp sqlprotect staging" + + # Extract the staging archive + cd $WD/sqlprotect/staging/osx + tar -jxvf sqlprotect-staging.tar.bz2 || _die "Failed to extract the sqlprotect staging archive" + rm -f sqlprotect-staging.tar.bz2 + + cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/osx/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" + chmod 444 $WD/sqlprotect/staging/osx/sqlprotect_license.txt || _die "Unable to change permissions for license file" + + source $WD/sqlprotect/staging/osx/versions-osx.sh + PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) + + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SQLPROTECT -gt 0 ]; + then + BUILD_FAILED="" + fi + cd $WD/sqlprotect # Set permissions to all files and folders in staging @@ -99,6 +132,9 @@ _postprocess_sqlprotect_osx() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer.xml osx || _die "Failed to build the installer" + + # Rename the installer + mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app cd $WD/output @@ -106,18 +142,18 @@ _postprocess_sqlprotect_osx() { scp ../versions.sh $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN # Scp the app bundle to the signing machine for signing - tar -jcvf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app.tar.bz2 edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app || _die "Failed to create the archive." + tar -jcvf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app.tar.bz2 edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app || _die "Failed to create the archive." ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf apache*" || _die "Failed to clean the $PG_PATH_OSX_SIGN/output directory on sign server." - scp edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." - rm -fr edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app* || _die "Failed to clean the output directory." + scp edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app.tar.bz2 $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/ || _die "Failed to copy the archive to sign server." + rm -fr edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app* || _die "Failed to clean the output directory." # Sign the app - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX/versions.sh; tar -jxvf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app;" || _die "Failed to sign the code" - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app; mv edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx-signed.app edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app;" || _die "could not move the signed app" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; source $PG_PATH_OSX/versions.sh; tar -jxvf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app.tar.bz2; security unlock-keychain -p $KEYCHAIN_PASSWD ~/Library/Keychains/login.keychain; $PG_PATH_OSX_SIGNTOOL --keychain ~/Library/Keychains/login.keychain --keychain-password $KEYCHAIN_PASSWD --identity 'Developer ID Application' --identifier 'com.edb.postgresql' edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app;" || _die "Failed to sign the code" + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; rm -rf edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app; mv edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx-signed.app edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app;" || _die "could not move the signed app" # Archive the .app and copy back to controller - ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.zip edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.app" || _die "Failed to zip the installer bundle" - scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-osx.zip $WD/output || _die "Failed to copy installers to $WD/output." + ssh $PG_SSH_OSX_SIGN "cd $PG_PATH_OSX_SIGN/output; zip -r edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.zip edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.app" || _die "Failed to zip the installer bundle" + scp $PG_SSH_OSX_SIGN:$PG_PATH_OSX_SIGN/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}osx.zip $WD/output || _die "Failed to copy installers to $WD/output." cd $WD echo "END POST sqlprotect OSX" diff --git a/sqlprotect/build-windows-x64.sh b/sqlprotect/build-windows-x64.sh index 144454255..38f76e077 100755 --- a/sqlprotect/build-windows-x64.sh +++ b/sqlprotect/build-windows-x64.sh @@ -43,7 +43,7 @@ _prep_sqlprotect_windows_x64() { zip sqlprotect.zip postgres.windows-x64/contrib/SQLPROTECT/* || _die "Couldn't create archive of the sqlprotect sources (sqlprotect.zip)" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect.zip del /S /Q sqlprotect.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\sqlprotect.zip on Windows VM" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect.staging rd /S /Q sqlprotect.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\sqlprotect.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect.staging.build rd /S /Q sqlprotect.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\sqlprotect.staging.build directory on Windows VM" ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\\sqlprotect-staging.zip on Windows VM" # Removing sqlprotect if it already exists @@ -83,20 +83,23 @@ EOT ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64/postgres.windows-x64/src/tools/msvc; ./build64-sqlprotect.bat" || _die "could not build sqlprotect on windows vm" # We need to copy shared objects to staging directory - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging/lib/postgresql" || _die "Failed to create the lib directory" - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging/share" || _die "Failed to create the share directory" - ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging/doc" || _die "Failed to create the doc directory" + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/lib/postgresql" || _die "Failed to create the lib directory" + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/share" || _die "Failed to create the share directory" + ssh $PG_SSH_WINDOWS_X64 "mkdir -p $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/doc" || _die "Failed to create the doc directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/release/sqlprotect/sqlprotect.dll $PG_PATH_WINDOWS_X64/sqlprotect.staging/lib/postgresql" || _die "Failed to copy sqlprotect.dll to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_WINDOWS_X64/sqlprotect.staging/share" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_WINDOWS_X64/sqlprotect.staging/doc" || _die "Failed to copy README-sqlprotect.txt to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/release/sqlprotect/sqlprotect.dll $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/lib/postgresql" || _die "Failed to copy sqlprotect.dll to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/share" || _die "Failed to copy sqlprotect.sql to staging directory" + ssh $PG_SSH_WINDOWS_X64 "cp $PG_PATH_WINDOWS_X64/postgres.windows-x64/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_WINDOWS_X64/sqlprotect.staging.build/doc" || _die "Failed to copy README-sqlprotect.txt to staging directory" - # Zip up the installed code, copy it back here, and unpack. - echo "Copying sqlprotect build tree to Unix host" - ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\sqlprotect.staging; zip -r ..\\\\sqlprotect-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect.staging)" - scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect-staging.zip $WD/sqlprotect/staging/windows-x64 || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect-staging.zip)" - unzip $WD/sqlprotect/staging/windows-x64/sqlprotect-staging.zip -d $WD/sqlprotect/staging/windows-x64 || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/sqlprotect-staging.zip)" - rm $WD/sqlprotect/staging/windows-x64/sqlprotect-staging.zip + echo "Removing last successful staging directory ($PG_PATH_WINDOWS_X64\\\\sqlprotect.staging)" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect.staging rd /S /Q sqlprotect.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS_X64 "cmd /c mkdir $PG_PATH_WINDOWS_X64\\\\sqlprotect.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c xcopy /E /Q /Y sqlprotect.staging.build\\\\* sqlprotect.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT > $PG_PATH_WINDOWS_X64\\\\sqlprotect.staging/versions-windows-x64.sh" || _die "Failed to write sqlprotect version number into versions-windows-x64.sh" + ssh $PG_SSH_WINDOWS_X64 "cmd /c echo PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT >> $PG_PATH_WINDOWS_X64\\\\sqlprotect.staging/versions-windows-x64.sh" || _die "Failed to write sqlprotect build number into versions-windows-x64.sh" # Remove the existing sqlprotect directory in server if [ -e postgres.windows-x64/contrib/SQLPROTECT ]; @@ -105,10 +108,6 @@ EOT rm -rf postgres.windows-x64/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" fi - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/windows-x64/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/windows-x64/sqlprotect_license.txt || _die "Unable to change permissions for license file" - - echo "END BUILD sqlprotect Windows-x64" } @@ -122,6 +121,33 @@ _postprocess_sqlprotect_windows_x64() { echo "BEGIN POST sqlprotect Windows-x64" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/sqlprotect/staging/windows-x64 ]; + then + echo "Removing existing staging directory" + rm -rf $WD/sqlprotect/staging/windows-x64 || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/sqlprotect/staging/windows-x64)" + mkdir -p $WD/sqlprotect/staging/windows-x64/sqlprotect || _die "Couldn't create the staging directory" + chmod ugo+w $WD/sqlprotect/staging/windows-x64 || _die "Couldn't set the permissions on the staging directory" + + _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying sqlprotect build tree to Unix host" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS_X64\sqlprotect-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS_X64 "cd $PG_PATH_WINDOWS_X64\\\\sqlprotect.staging; zip -r ..\\\\sqlprotect-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect.staging)" + scp $PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect-staging.zip $WD/sqlprotect/staging/windows-x64 || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS_X64:$PG_PATH_WINDOWS_X64/sqlprotect-staging.zip)" + unzip $WD/sqlprotect/staging/windows-x64/sqlprotect-staging.zip -d $WD/sqlprotect/staging/windows-x64 || _die "Failed to unpack the built source tree ($WD/staging/windows-x64/sqlprotect-staging.zip)" + rm $WD/sqlprotect/staging/windows-x64/sqlprotect-staging.zip + + dos2unix $WD/sqlprotect/staging/windows-x64/versions-windows-x64.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/sqlprotect/staging/windows-x64/versions-windows-x64.sh + PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) + + cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/windows-x64/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" + chmod 444 $WD/sqlprotect/staging/windows-x64/sqlprotect_license.txt || _die "Unable to change permissions for license file" + cd $WD/sqlprotect if [ -f installer-win-x64.xml ]; then @@ -137,11 +163,21 @@ _postprocess_sqlprotect_windows_x64() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win-x64.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SQLPROTECT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-windows-x64.exe $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows-x64.exe || _die "Failed to rename the installer" + # Sign the installer - win32_sign "edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-windows-x64.exe" + win32_sign "edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows-x64.exe" cd $WD - + echo "END POST sqlprotect Windows-x64" } diff --git a/sqlprotect/build-windows.sh b/sqlprotect/build-windows.sh index 100d36439..2f84b7d05 100755 --- a/sqlprotect/build-windows.sh +++ b/sqlprotect/build-windows.sh @@ -6,7 +6,7 @@ ################################################################################ _prep_sqlprotect_windows() { - + echo "BEGIN PREP sqlprotect Windows" cd $WD/server/source @@ -43,7 +43,7 @@ _prep_sqlprotect_windows() { zip sqlprotect.zip postgres.windows/contrib/SQLPROTECT/* || _die "Couldn't create archive of the sqlprotect sources (sqlprotect.zip)" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.zip del /S /Q sqlprotect.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.staging rd /S /Q sqlprotect.staging" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect.staging directory on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.staging.build rd /S /Q sqlprotect.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect.staging.build directory on Windows VM" ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect-staging.zip on Windows VM" # Removing sqlprotect if it already exists @@ -79,20 +79,13 @@ EOT ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/src/tools/msvc; ./build32-sqlprotect.bat " || _die "could not build sqlprotect on windows vm" # We need to copy shared objects to staging directory - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging/lib/postgresql" || _die "Failed to create the lib directory" - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging/share" || _die "Failed to create the share directory" - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging/doc" || _die "Failed to create the doc directory" + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/lib/postgresql" || _die "Failed to create the lib directory" + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/share" || _die "Failed to create the share directory" + ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/doc" || _die "Failed to create the doc directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/release/sqlprotect/sqlprotect.dll $PG_PATH_WINDOWS/sqlprotect.staging/lib/postgresql" || _die "Failed to copy sqlprotect.dll to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_WINDOWS/sqlprotect.staging/share" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_WINDOWS/sqlprotect.staging/doc" || _die "Failed to copy README-sqlprotect.txt to staging directory" - - # Zip up the installed code, copy it back here, and unpack. - echo "Copying sqlprotect build tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\sqlprotect.staging; cmd /c zip -r ..\\\\sqlprotect-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip $WD/sqlprotect/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip)" - unzip $WD/sqlprotect/staging/windows/sqlprotect-staging.zip -d $WD/sqlprotect/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/sqlprotect-staging.zip)" - rm $WD/sqlprotect/staging/windows/sqlprotect-staging.zip + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/release/sqlprotect/sqlprotect.dll $PG_PATH_WINDOWS/sqlprotect.staging.build/lib/postgresql" || _die "Failed to copy sqlprotect.dll to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_WINDOWS/sqlprotect.staging.build/share" || _die "Failed to copy sqlprotect.sql to staging directory" + ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_WINDOWS/sqlprotect.staging.build/doc" || _die "Failed to copy README-sqlprotect.txt to staging directory" # Remove any existing sqlprotect directory that might exist, in server if [ -e postgres.windows/contrib/SQLPROTECT ]; @@ -100,9 +93,16 @@ EOT echo "Removing existing sqlprotect directory" rm -rf postgres.windows/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" fi - - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to change permissions for license file" + + echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\sqlprotect.staging)" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.staging rd /S /Q sqlprotect.staging" || _die "Couldn't remove the last successful staging directory directory" + ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\sqlprotect.staging" || _die "Couldn't create the last successful staging directory" + + echo "Copying the complete build to the successful staging directory" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y sqlprotect.staging.build\\\\* sqlprotect.staging\\\\" || _die "Couldn't copy the existing staging directory" + + ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT > $PG_PATH_WINDOWS\\\\sqlprotect.staging/versions-windows.sh" || _die "Failed to write sqlprotect version number into versions-windows.sh" + ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT >> $PG_PATH_WINDOWS\\\\sqlprotect.staging/versions-windows.sh" || _die "Failed to write sqlprotect build number into versions-windows.sh" echo "END BUILD sqlprotect Windows" @@ -118,6 +118,33 @@ _postprocess_sqlprotect_windows() { echo "BEGIN POST sqlprotect Windows" + # Remove any existing staging directory that might exist, and create a clean one + if [ -e $WD/sqlprotect/staging/windows ]; + then + echo "Removing existing staging directory" + rm -rf $WD/sqlprotect/staging/windows || _die "Couldn't remove the existing staging directory" + fi + echo "Creating staging directory ($WD/sqlprotect/staging/windows)" + mkdir -p $WD/sqlprotect/staging/windows/sqlprotect || _die "Couldn't create the staging directory" + chmod ugo+w $WD/sqlprotect/staging/windows || _die "Couldn't set the permissions on the staging directory" + + _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + + # Zip up the installed code, copy it back here, and unpack. + echo "Copying sqlprotect build tree to Unix host" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\sqlprotect-staging.zip on Windows VM" + ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\sqlprotect.staging; cmd /c zip -r ..\\\\sqlprotect-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect.staging)" + scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip $WD/sqlprotect/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip)" + unzip $WD/sqlprotect/staging/windows/sqlprotect-staging.zip -d $WD/sqlprotect/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/sqlprotect-staging.zip)" + rm $WD/sqlprotect/staging/windows/sqlprotect-staging.zip + + dos2unix $WD/sqlprotect/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" + source $WD/sqlprotect/staging/windows/versions-windows.sh + PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) + + cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" + chmod 444 $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to change permissions for license file" + cd $WD/sqlprotect if [ -f installer-win.xml ]; @@ -134,8 +161,18 @@ _postprocess_sqlprotect_windows() { # Build the installer "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" + # If build passed empty this variable + BUILD_FAILED="build_failed-" + if [ $PG_BUILD_SQLPROTECT -gt 0 ]; + then + BUILD_FAILED="" + fi + + # Rename the installer + mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-windows.exe $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows.exe || _die "Failed to rename the installer" + # Sign the installer - win32_sign "edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-windows.exe" + win32_sign "edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows.exe" cd $WD diff --git a/sqlprotect/build.sh b/sqlprotect/build.sh index 33903903f..a3936162b 100644 --- a/sqlprotect/build.sh +++ b/sqlprotect/build.sh @@ -137,7 +137,7 @@ _postprocess_sqlprotect() { _replace PG_MAJOR_VERSION $PG_MAJOR_VERSION installer.xml || _die "Failed to set the version in the installer project file (sqlprotect/installer.xml)" #_registration_plus_postprocess(STAGING DIRECTORY, COMPONENT NAME, VERSION VARIABLE, INI, REGISTRY_PREFIX, REGISTRY_PREFIX_WIN, PRODUCT_DESCRIPTION, PRODUCT_VERSION) - _registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" + ##_registration_plus_postprocess "$WD/sqlprotect/staging" "SQL Protect" "sqlprotectVersion" "/etc/postgres-reg.ini" "sqlprotect-PG_$PG_MAJOR_VERSION" "sqlprotect-PG_$PG_MAJOR_VERSION" "SQL Protect" "$PG_VERSION_SQLPROTECT" # Mac OSX if [ $PG_ARCH_OSX = 1 ];