Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add saiku script and modify buildall.sh, update ui submodule
- Loading branch information
1 parent
b10f8f7
commit 6260a1e
Showing
3 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (c) 2011 OSBI Ltd. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | ||
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | ||
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | ||
# Software is furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
# | ||
|
||
|
||
function usageBuild() { | ||
cat <<eom | ||
Usage: saiku build <all | project> | ||
Builds all or an individual saiku project | ||
Example: | ||
saiku build all | ||
Others: | ||
saiku build < all | ui | server | webapp | bi-platform-plugin > | ||
eom | ||
} | ||
|
||
function usageRun() { | ||
cat <<eom | ||
Usage: saiku run <package> | ||
package can be: | ||
server | ||
Executes dist/saiku-server/start-saiku.sh | ||
ui [port] [backend_host] [backend_port] | ||
Executes node saiku-ui/server.js [port] [backend_host] [backend_port] | ||
Default is: | ||
node server.js 8080 dev.analytical-labs.com 80 | ||
eom | ||
} | ||
|
||
case $1 in | ||
"build") | ||
if [[ -z $2 ]]; then | ||
usageBuild | ||
exit 1 | ||
fi | ||
case $2 in | ||
"all") | ||
sh buildall.sh | ||
;; | ||
"ui") | ||
cd saiku-ui | ||
mvn clean package install:install-file -Dfile=target/saiku-ui-2.2-SNAPSHOT.war -DgroupId=org.saiku -DartifactId=saiku-ui -Dversion=2.2-SNAPSHOT -Dpackaging=war | ||
;; | ||
*) | ||
cd saiku-$2 | ||
mvn clean package | ||
;; | ||
esac | ||
;; | ||
"run") | ||
if [[ -z $2 ]]; then | ||
usageRun | ||
exit 1 | ||
fi | ||
case $2 in | ||
"server") | ||
echo "" | ||
echo "Running Server....." | ||
cd saiku-server/target/dist/saiku-server/ | ||
sh start-saiku.sh | ||
;; | ||
"ui") | ||
cd saiku-ui | ||
if [ ! -d ./node_modules ]; then | ||
echo "module 'express' not found in saiku-ui/node_modules" | ||
echo "installing express ...." | ||
npm install express | ||
fi | ||
echo "Running UI.... " | ||
node server.js $3 $4 $5 | ||
;; | ||
*) | ||
echo "-----------------------------------------------------" | ||
echo " E R R O R : Invalid option: $2" | ||
echo "-----------------------------------------------------" | ||
echo "" | ||
usageRun | ||
exit 1 | ||
;; | ||
esac | ||
|
||
;; | ||
*) | ||
echo "-----------------------------------------------------" | ||
echo " E R R O R : Invalid option: $1" >&2 | ||
echo "-----------------------------------------------------" | ||
echo "" | ||
usageBuild | ||
usageRun | ||
exit 1 | ||
;; | ||
|
||
esac | ||
|