Skip to content

Commit

Permalink
#1137 binary package build under release profile (#1419)
Browse files Browse the repository at this point in the history
* #1137 binary package build under release profile

* #1137 Added embedded JRE for Win and Linux

* #1137 Added precooked geostore database to binary release

* #1137 Download prepacked JRE from demo server instead

* #1137 Missing goto on Win bash scripts
  • Loading branch information
fernandinand authored and mbarto committed Feb 6, 2017
1 parent cb1fafa commit 231244d
Show file tree
Hide file tree
Showing 31 changed files with 7,180 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ coverage/
web/client/libs/Cesium/
web/cesium.zip
web/.classpath
web/.project
web/.project
.idea
*.iml
30 changes: 18 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.geosolutions.mapstore</groupId>
<artifactId>mapstore-root</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>MapStore 2</name>
<url>http://www.geo-solutions.it</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>



<dependencies>


</dependencies>

<build>

</build>

<profiles>
<profile>
<id>default</id>
Expand All @@ -32,12 +30,20 @@
<modules>
<module>web</module>
</modules>


</profile>
<profile>
<id>release</id>
<activation>
<property>
<name>release</name>
</property>
</activation>
<modules>
<module>release</module>
</modules>
</profile>
</profiles>





</project>
80 changes: 80 additions & 0 deletions release/bin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<assembly>
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<!-- the main webapp -->
<directory>../web/target/mapstore</directory>
<outputDirectory>mapstore2/webapps/mapstore</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<!-- the main database -->
<directory>target</directory>
<outputDirectory>mapstore2/webapps/mapstore</outputDirectory>
<includes>
<include>geostore.h2.db</include>
</includes>
</fileSet>
<fileSet>
<!-- JRE's -->
<directory>target/jre</directory>
<outputDirectory>mapstore2/jre</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<!-- the libs needed to run tomcat -->
<directory>target/dependency</directory>
<outputDirectory>mapstore2/lib</outputDirectory>
<includes>
<include>tomcat-*.jar</include>
<include>ecj-*.jar</include>
</includes>
</fileSet>
<fileSet>
<!-- windows batch files -->
<directory>bin</directory>
<lineEnding>keep</lineEnding>
<outputDirectory>mapstore2/</outputDirectory>
<includes>
<include>mapstore2-*.bat</include>
</includes>
</fileSet>
<fileSet>
<!-- unix shell scripts -->
<directory>bin</directory>
<lineEnding>unix</lineEnding>
<outputDirectory>mapstore2/</outputDirectory>
<fileMode>0755</fileMode>
<directoryMode>0755</directoryMode>
<includes>
<include>mapstore2-*.sh</include>
</includes>
</fileSet>
<fileSet>
<!-- tomcat configuration -->
<directory>tomcat</directory>
<outputDirectory>mapstore2</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<!-- empty log directory -->
<directory>logs</directory>
<outputDirectory>mapstore2</outputDirectory>
</fileSet>
<fileSet>
<!-- empty work directory -->
<directory>work</directory>
<outputDirectory>mapstore2</outputDirectory>
</fileSet>
</fileSets>
</assembly>
60 changes: 60 additions & 0 deletions release/bin/mapstore2-shutdown.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@echo off
REM -----------------------------------------------------------------------------
REM Shutdown Script for MapStore
REM -----------------------------------------------------------------------------


cls
echo Shutting down MapStore2...
echo.
set error=0

set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%"

set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"
set CMD_LINE_ARGS=
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1

rem JAVA_HOME not defined
if "%JAVA_HOME%" == "" goto nativeJava

echo JAVA_HOME: %JAVA_HOME%
echo.

rem No errors
goto shutdown

:nativeJava
set "JAVA_HOME=%CURRENT_DIR%\jre\win"

rem JAVA_HOME defined incorrectly
:checkJava
if not exist "%JAVA_HOME%\bin\java.exe" goto badJava
goto shutdown

:badJava
echo The JAVA_HOME environment variable is not defined correctly.
goto JavaFail

:JavaFail
echo Java 7 is needed to run MapStore2.
echo.
echo Install it from:
echo http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
echo.
set error=1
goto end

:shutdown
echo Shutting down MapStore2...
echo.
call "%EXECUTABLE%" stop %CMD_LINE_ARGS%
echo.
echo Thank you for using MapStore2!
goto end

:end
if %error% == 1 echo Shutting down MapStore2 was unsuccessful.
echo.
pause
26 changes: 26 additions & 0 deletions release/bin/mapstore2-shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for MapStore2
#
# $Id$
# -----------------------------------------------------------------------------

# Make sure catalina scripts are executable
chmod +x bin/*.sh

PRGDIR=`pwd`
EXECUTABLE=shutdown.sh
CATALINA_HOME="$PRGDIR"

if [ ! -x "$CATALINA_HOME"/bin/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi

sh "$CATALINA_HOME"/bin/"$EXECUTABLE" stop "$@"

echo "Waiting for services to stop..."
sleep 4
echo "Thank you for using MapStore2!"
62 changes: 62 additions & 0 deletions release/bin/mapstore2-startup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@echo off
rem -----------------------------------------------------------------------------
rem Startup Script for MapStore2
rem -----------------------------------------------------------------------------

cls
echo Welcome to MapStore2!
echo.
set error=0

set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%"

set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"
set CMD_LINE_ARGS=
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1

rem JAVA_HOME not defined
if "%JAVA_HOME%" == "" goto nativeJava

echo JAVA_HOME: %JAVA_HOME%
echo.

rem No errors
goto run

:nativeJava
set "JAVA_HOME=%CURRENT_DIR%\jre\win"

rem JAVA_HOME defined incorrectly
:checkJava
if not exist "%JAVA_HOME%\bin\java.exe" goto badJava
goto run

:badJava
echo The JAVA_HOME environment variable is not defined correctly.
goto JavaFail

:JavaFail
echo Java 7 is needed to run MapStore2.
echo.
echo Install it from:
echo http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
echo.
set error=1
goto end


:run
echo Please wait while loading MapStore2...
echo.
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
echo Point you browser to: http://localhost:8800/mapstore
echo.
echo Enjoy MapStore2!
goto end


:end
if %error% == 1 echo Startup of MapStore2 was unsuccessful.
echo.
pause
41 changes: 41 additions & 0 deletions release/bin/mapstore2-startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for MapStore2
#
# $Id$
# -----------------------------------------------------------------------------

# Make sure catalina scripts are executable
chmod +x bin/*.sh

# Set local JAVA_HOME
PRGDIR=`pwd`
if [ -z "$JAVA_HOME" ]; then
export JAVA_HOME="$PRGDIR/jre/linux"
export JRE_HOME="$PRGDIR/jre/linux"
chmod +x jre/linux/bin/*
fi

echo "Welcome to MapStore2!"

# if not told otherwise pump up the permgen
if [ -z "$JAVA_OPTS" ]; then
export JAVA_OPTS="-XX:MaxPermSize=128m"
fi

EXECUTABLE=startup.sh
CATALINA_HOME="$PRGDIR"

if [ ! -x "$CATALINA_HOME"/bin/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi

sh "$CATALINA_HOME"/bin/"$EXECUTABLE" start "$@"
echo "Waiting for Tomcat start and MapStore2 deploy..."
sleep 4
echo "Point you browser to: http://localhost:8800/mapstore"
sleep 1
echo "Enjoy MapStore2!"
Binary file added release/data/geostore.h2.db
Binary file not shown.
Loading

0 comments on commit 231244d

Please sign in to comment.