Skip to content

Commit

Permalink
Adding changes to contain the last successful staging directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
talha-edb committed Jul 18, 2017
1 parent e4dd33a commit cca1823
Show file tree
Hide file tree
Showing 47 changed files with 2,670 additions and 1,313 deletions.
57 changes: 46 additions & 11 deletions Npgsql/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

Expand Down
54 changes: 39 additions & 15 deletions PostGIS/build-linux-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "."`

Expand Down Expand Up @@ -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 <<EOT > "build-postgis-$PLATFORM.sh"
#!/bin/bash
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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"

Expand Down Expand Up @@ -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"
Expand Down
56 changes: 40 additions & 16 deletions PostGIS/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "."`

Expand All @@ -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"

}
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -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

Expand All @@ -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"

Expand Down Expand Up @@ -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"
Expand Down
Loading

0 comments on commit cca1823

Please sign in to comment.