Monasca REST API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_maven.sh 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. set -x
  3. env
  4. # Download maven 3 if the system maven isn't maven 3
  5. VERSION=`mvn -v | grep "Apache Maven 3"`
  6. if [ -z "${VERSION}" ]; then
  7. curl http://archive.apache.org/dist/maven/binaries/apache-maven-3.2.1-bin.tar.gz > apache-maven-3.2.1-bin.tar.gz
  8. tar -xvzf apache-maven-3.2.1-bin.tar.gz
  9. MVN=${PWD}/apache-maven-3.2.1/bin/mvn
  10. else
  11. MVN=mvn
  12. fi
  13. # Get the expected common version
  14. COMMON_VERSION=$1
  15. # Get rid of the version argument
  16. shift
  17. # Get rid of the java property name containing the args
  18. shift
  19. RUN_BUILD=false
  20. for ARG in $*; do
  21. if [ "$ARG" = "package" ]; then
  22. RUN_BUILD=true
  23. fi
  24. if [ "$ARG" = "install" ]; then
  25. RUN_BUILD=true
  26. fi
  27. done
  28. if [ $RUN_BUILD = "true" ]; then
  29. if [ ! -z "$ZUUL_BRANCH" ]; then
  30. BRANCH=${ZUUL_BRANCH}
  31. else
  32. BRANCH=${ZUUL_REF}
  33. fi
  34. ( cd common; ./build_common.sh ${MVN} ${COMMON_VERSION} ${BRANCH} )
  35. RC=$?
  36. if [ $RC != 0 ]; then
  37. exit $RC
  38. fi
  39. fi
  40. # Invoke the maven 3 on the real pom.xml
  41. ( cd java; ${MVN} -DgitRevision=`git rev-list HEAD --max-count 1 --abbrev=0 --abbrev-commit` $* )
  42. RC=$?
  43. # Copy the jars where the publisher will find them
  44. if [ $RUN_BUILD = "true" ]; then
  45. if [ ! -L target ]; then
  46. ln -sf java/target target
  47. fi
  48. fi
  49. rm -fr apache-maven-3.2.1*
  50. exit $RC