diff --git a/Installation/release.sh b/Installation/release.sh index 7f8473a7b6..7bd1a0f335 100755 --- a/Installation/release.sh +++ b/Installation/release.sh @@ -1,5 +1,9 @@ #!/bin/bash -set -e +set -ex + +SCRIPT_DIR=`dirname $0` +SRC_DIR="${SCRIPT_DIR}/../" +ENTERPRISE_SRC_DIR=${SRC_DIR}/enterprise TAG=1 BOOK=1 @@ -7,15 +11,22 @@ BUILD=1 SWAGGER=1 EXAMPLES=1 LINT=1 +PARALLEL=8 if [ "$#" -lt 1 ]; then - echo "usage: $0 .." - exit 1 + echo "usage: $0 .." + exit 1 fi while [ "$#" -gt 0 ]; do echo "$1" case "$1" in + --parallel) + shift + PARALLEL=$1 + shift + ;; + --no-lint) LINT=0 shift @@ -61,21 +72,25 @@ while [ "$#" -gt 0 ]; do esac done +if [ -d ${ENTERPRISE_SRC_DIR} ]; then + echo "enterprise directory missing" +fi + if echo ${VERSION} | grep -q -- '-'; then echo "${VERSION} mustn't contain minuses! " exit 1 fi if git tag | grep -q "^v$VERSION$"; then - echo "$0: version $VERSION already defined" - exit 1 + echo "$0: version $VERSION already defined" + exit 1 fi if fgrep -q "v$VERSION" CHANGELOG; then - echo "version $VERSION defined in CHANGELOG" + echo "version $VERSION defined in CHANGELOG" else - echo "$0: version $VERSION not defined in CHANGELOG" - exit 1 + echo "$0: version $VERSION not defined in CHANGELOG" + exit 1 fi VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'` @@ -83,127 +98,107 @@ VERSION_MINOR=`echo $VERSION | awk -F. '{print $2}'` VERSION_REVISION=`echo $VERSION | awk -F. '{print $3}'` cat CMakeLists.txt \ - | sed -e "s~set(ARANGODB_VERSION_MAJOR.*~set(ARANGODB_VERSION_MAJOR \"$VERSION_MAJOR\")~" \ - | sed -e "s~set(ARANGODB_VERSION_MINOR.*~set(ARANGODB_VERSION_MINOR \"$VERSION_MINOR\")~" \ - | sed -e "s~set(ARANGODB_VERSION_REVISION.*~set(ARANGODB_VERSION_REVISION \"$VERSION_REVISION\")~" \ - > CMakeLists.txt.tmp + | sed -e "s~set(ARANGODB_VERSION_MAJOR.*~set(ARANGODB_VERSION_MAJOR \"$VERSION_MAJOR\")~" \ + | sed -e "s~set(ARANGODB_VERSION_MINOR.*~set(ARANGODB_VERSION_MINOR \"$VERSION_MINOR\")~" \ + | sed -e "s~set(ARANGODB_VERSION_REVISION.*~set(ARANGODB_VERSION_REVISION \"$VERSION_REVISION\")~" \ + > CMakeLists.txt.tmp mv CMakeLists.txt.tmp CMakeLists.txt CMAKE_CONFIGURE="-DUSE_MAINTAINER_MODE=ON" if [ `uname` == "Darwin" ]; then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11" -fi - -ENTERPRISE=0 - -if [ -d enterprise ]; then - ENTERPRISE=1 + CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11" fi if [ "$BUILD" != "0" ]; then - echo "COMPILING COMMUNITY" - - if [ "$BUILD" == "1" ]; then + echo "COMPILING COMMUNITY" rm -rf build && mkdir build - fi - - ( - cd build - cmake .. ${CMAKE_CONFIGURE} - make clean_autogenerated_files - cmake .. ${CMAKE_CONFIGURE} - make -j 8 - ) - - if [ "$ENTERPRISE" == "1" ]; then - echo "COMPILING ENTERPRISE" - - if [ "$BUILD" == "1" ]; then - rm -rf build-enterprise && mkdir build-enterprise - fi - ( - cd build-enterprise - cmake .. ${CMAKE_CONFIGURE} -DUSE_ENTERPRISE=ON - make -j 8 + cd build + cmake .. ${CMAKE_CONFIGURE} + make clean_autogenerated_files + cmake .. ${CMAKE_CONFIGURE} + make -j ${PARALLEL} + ) + + echo "COMPILING ENTERPRISE" + rm -rf build-enterprise && mkdir build-enterprise + ( + cd build-enterprise + cmake .. ${CMAKE_CONFIGURE} -DUSE_ENTERPRISE=ON + make -j ${PARALLEL} ) - fi fi if [ "$LINT" == "1" ]; then - echo "LINTING" - ./utils/jslint.sh + echo "LINTING" + ./utils/jslint.sh fi git add -f \ - README \ - arangod/Aql/tokens.cpp \ - arangod/Aql/grammar.cpp \ - arangod/Aql/grammar.h \ - lib/V8/v8-json.cpp \ - lib/Basics/voc-errors.h \ - lib/Basics/voc-errors.cpp \ - js/common/bootstrap/errors.js \ - CMakeLists.txt + README \ + arangod/Aql/tokens.cpp \ + arangod/Aql/grammar.cpp \ + arangod/Aql/grammar.h \ + lib/V8/v8-json.cpp \ + lib/Basics/voc-errors.h \ + lib/Basics/voc-errors.cpp \ + js/common/bootstrap/errors.js \ + CMakeLists.txt if [ "$EXAMPLES" == "1" ]; then - echo "EXAMPLES" - ./utils/generateExamples.sh + echo "EXAMPLES" + ./utils/generateExamples.sh fi if [ "$SWAGGER" == "1" ]; then - echo "SWAGGER" - ./utils/generateSwagger.sh + echo "SWAGGER" + ./utils/generateSwagger.sh fi echo "GRUNT" ( - cd js/apps/system/_admin/aardvark/APP - rm -rf node_modules - npm install - grunt deploy + cd js/apps/system/_admin/aardvark/APP + rm -rf node_modules + npm install + grunt deploy ) git add -f Documentation/Examples/*.generated if [ "$BOOK" == "1" ]; then - echo "DOCUMENTATION" - (cd Documentation/Books; make) + echo "DOCUMENTATION" + (cd Documentation/Books; make) fi case "$TAG" in - *-alpha*|*-beta*|devel) + *-alpha*|*-beta*|devel) ;; - *) - if test -f EXPERIMENTAL; then git rm -f EXPERIMENTAL; fi - ;; + *) + if test -f EXPERIMENTAL; then git rm -f EXPERIMENTAL; fi + ;; esac if [ "$TAG" == "1" ]; then - echo "COMMIT" + echo "COMMIT" - git commit -m "release version $VERSION" -a - git push + git commit -m "release version $VERSION" -a + git push - git tag "v$VERSION" - git push --tags + git tag "v$VERSION" + git push --tags - if [ "$ENTERPRISE" == "1" ]; then - ( - cd enterprise - git commit -m "release version $VERSION enterprise" -a - git push + cd ${ENTERPRISE_SRC_DIR} + git commit -m "release version $VERSION enterprise" -a + git push - git tag "v$VERSION" - git push --tags - ) - fi + git tag "v$VERSION" + git push --tags - echo - echo "--------------------------------------------------" - echo "Remember to update the VERSION in 'devel' as well." - echo "--------------------------------------------------" + echo + echo "--------------------------------------------------" + echo "Remember to update the VERSION in 'devel' as well." + echo "--------------------------------------------------" fi