Skip to content

Instantly share code, notes, and snippets.

@josteinaj
Last active December 26, 2015 18:39
Show Gist options
  • Save josteinaj/7196381 to your computer and use it in GitHub Desktop.
Save josteinaj/7196381 to your computer and use it in GitHub Desktop.
Bash script for building DAISY Pipeline 2.
#!/bin/bash
# WARNING: this will git pull all projects, which may overwrite any unstaged file changes! I've added "git add -A" to the script to avoid this, but try commiting any changes before running this script just to be safe.
# Convenience script that builds all Pipeline 2 projects
#
# To clean all projects:
# ./pipeline-build.sh clean
#
# To checkout, pull and install all projects:
# ./pipeline-build.sh
#
if [ "$1" = "clean" ]; then
COMMAND="clean"
else
if [ "$1" = "" ] || [ "$1" = "install" ]; then
COMMAND="install"
else
echo "Invalid command: $1"
exit 1
fi
fi
function assertSuccess(){
if [ $? -ne 0 ]; then echo "Pipeline 2 compilation failed" && exit 1; fi
}
function build(){
echo "cd $1"
cd "$1"; assertSuccess
if [ $COMMAND != "clean" ]; then
echo "git add -A"
git add -A; assertSuccess
echo "git pull"
git pull #; assertSuccess
echo "git checkout $2"
git checkout $2; assertSuccess
echo "git pull"
git pull; assertSuccess
fi
echo "mvn $COMMAND"
mvn $COMMAND; assertSuccess
}
# Dependencies
build ~/pipeline-maven-parents/daisy-parent "master"
build ~/pipeline-build-utils "master"
build ~/pipeline-osgi-libs "master"
# CLI
build ~/pipeline-cli "master"
#cd ~/pipeline-clientlib-go && build "master"
build ~/pipeline-cli-go "master"
# Web UI
build ~/pipeline-clientlib-java "master"
if [ "$PLAY2_HOME" = "" ]; then echo "You must set PLAY2_HOME to compile the Web UI" && exit 1; fi
cd "$PLAY2_HOME/repository/cache/" && rm -rfv org.daisy*
build ~/pipeline-webui "master"
# Framework
build ~/pipeline-framework "master"
# Modules
build ~/pipeline-mod-audio "master"
build ~/pipeline-mod-braille "master"
build ~/pipeline-mod-tts "master"
build ~/pipeline-modules/scripts "master"
build ~/pipeline-modules/scripts-utils "master"
build ~/pipeline-modules/common-utils "master"
# Assembly
build ~/pipeline-assembly "master"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment