diff --git a/.travis.yml b/.travis.yml index 25972ae0..d47673ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,12 @@ branches: env: matrix: - - ORIENTDB_VERSION=2.2.9 - - ORIENTDB_VERSION=2.1.23 + - ORIENTDB_VERSION=3.0.0-SNAPSHOT + - ORIENTDB_VERSION=2.2.14-SNAPSHOT + - ORIENTDB_VERSION=2.2.13 + - ORIENTDB_VERSION=2.2.12 + - ORIENTDB_VERSION=2.1.25 + - ORIENTDB_VERSION=2.1.24 + - ORIENTDB_VERSION=2.0.18 global: - secure: "FfqHFu2i1X5dIqzIxIGraEZrGSswSE4XVR7Ig9fkfYhbQfhFfZCOaRG95tyoZW7g5S0K2Kiw/oDyIKMPC+5g5PfMv2uvI/LZtokOy5ZewF0SHMjuCA54P+y83uindQMfb6KvPc9h/6tV2eogQGZ1y+juXteb4NRDUxt27NppRwM=" diff --git a/ci/_bash_utils.sh b/ci/_bash_utils.sh index 78b16a39..b88c2401 100755 --- a/ci/_bash_utils.sh +++ b/ci/_bash_utils.sh @@ -2,17 +2,20 @@ build(){ -# if command_exists "mvn" && [[ "$1" != *"-"* ]] && [[ "$1" != *"SNAPSHOT"* ]] && [[ "$1" != *"2.0"* ]]; then -# echo "Build started with MAVEN" -# build_via_mvn $1 $2 -# el - if [[ "$1" == *"SNAPSHOT"* ]]; then - echo "Build by clone/pull github develop branch" - build_via_git $1 $2 + ODB_VERSION=$1 + ODB_COMPILED_NAME="orientdb-community-${ODB_VERSION}" + ODB_ARCHIVED_NAME="orientdb-${ODB_VERSION}" + ODB_PACKAGE_EXT="tar.gz" + ODB_COMPRESSED=${ODB_COMPILED_NAME}.${ODB_PACKAGE_EXT} + OUTPUT_DIR="${2:-$(pwd)}" + + if [[ "${ODB_VERSION}" == *"SNAPSHOT"* ]]; then + download "https://oss.sonatype.org/service/local/artifact/maven/content?r=snapshots&g=com.orientechnologies&a=orientdb-community&v=${ODB_VERSION}&e=tar.gz" $OUTPUT_DIR ${ODB_COMPRESSED} else - echo "Build by download from github repository" - build_via_github $1 $2 + download "http://central.maven.org/maven2/com/orientechnologies/orientdb-community/${ODB_VERSION}/orientdb-community-${ODB_VERSION}.tar.gz" $OUTPUT_DIR ${ODB_COMPRESSED} fi + extract "$OUTPUT_DIR/$ODB_COMPRESSED" $OUTPUT_DIR + } @@ -20,6 +23,28 @@ command_exists () { type "$1" >/dev/null 2>&1 ; } +download () { + OUTPUT_DIR=$2 + PACKAGE_NAME=$3 + + if [ ! -d "$OUTPUT_DIR" ]; then + mkdir "$OUTPUT_DIR" + fi + + if command_exists "wget" ; then + echo "wget -q -O $OUTPUT_DIR/$PACKAGE_NAME $1" + wget -q -O "$OUTPUT_DIR/$PACKAGE_NAME" "$1" + elif command_exists "curl" ; then + echo "cd ${OUTPUT_DIR}" + cd ${OUTPUT_DIR} + echo "curl --silent -L $1 \"$OUTPUT_DIR/$PACKAGE_NAME\"" + curl --silent -L $1 --output "$OUTPUT_DIR/$PACKAGE_NAME" + else + echo "Cannot download $1 [missing wget or curl]" + exit 1 + fi +} + extract(){ ODB_PACKAGE_PATH=$1 @@ -59,8 +84,8 @@ download () { elif command_exists "curl" ; then echo "cd ${OUTPUT_DIR}" cd ${OUTPUT_DIR} - echo "curl --silent -L $1 \"$OUTPUT_DIR/$PACKAGE_NAME\"" - curl --silent -L $1 --output "$OUTPUT_DIR/$PACKAGE_NAME" + echo "curl --silent -LO $1" + curl --silent -LO $1 else echo "Cannot download $1 [missing wget or curl]" exit 1 @@ -71,7 +96,6 @@ build_via_git (){ ODB_VERSION=$1 CI_DIR=$2 - ODB_ARCHIVED_NAME="orientdb-${ODB_VERSION}" cd ${CI_DIR} if [ ! -d "orientdb-develop" ]; then @@ -87,6 +111,7 @@ build_via_git (){ fi git pull origin develop + ant clean install echo "mvn clean install -DskipTests" mvn clean install -DskipTests