KingWilliam

UMSBuilder Linux script

May 3rd, 2014
337
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env sh
  2.  
  3. #Setup env
  4. set -e
  5. CUR_DIR=`pwd`
  6. JAVA_HOME=$CUR_DIR\JDK-1.7.25
  7. M2_HOME=$CUR_DIR\Maven-3.1.0
  8. M2=$M2_HOME\bin
  9. PATH=$M2:$JAVA_HOME\bin:$PATH
  10.  
  11.  
  12. if [ -d code ]
  13. then
  14.   #Update git repo
  15.   cd $CUR_DIR/code
  16.   java -jar ../jgit-cli.jar fetch origin
  17.   java -jar ../jgit-cli.jar merge origin/master -s theirs
  18.   cd ..
  19. else
  20.   #Clone new repo
  21.   java -jar jgit-cli.jar clone https://github.com/UniversalMediaServer/UniversalMediaServer.git code
  22. fi
  23.  
  24. #Clean and build package
  25. cd code
  26. mvn com.savage7.maven.plugins:maven-external-dependency-plugin:resolve-external
  27. mvn com.savage7.maven.plugins:maven-external-dependency-plugin:install-external
  28. mvn clean
  29. mvn -P linux package
  30. cd ..
  31.  
  32. #Fetch result
  33. mv $CUR_DIR/code/target/ums-*-distribution.tar.gz $CUR_DIR
  34.  
  35. #Cleanup
  36. rm -rf $CUR_DIR/code/target
RAW Paste Data