diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd076ea4182573382bb0ac12a65aa10070e8437e..600e72deb845de442e4d8b9f1b4e5e940a185c2d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,9 @@ # Definition of our build pipeline stages: - - build - - test - - wheels + - build_bob + - test_bob + - wheels_bob # --------- @@ -16,8 +16,8 @@ stages: # Template for the build stage # Needs to run on all supported architectures, platforms and python versions -.build_template: &build_job - stage: build +.build_bob_template: &build_job + stage: build_bob before_script: - git clean -ffdx #- mkdir _ci @@ -26,7 +26,7 @@ stages: #- ./_ci/install.sh _ci #updates - ./_ci/before_build.sh script: - - ./_ci/build.sh 1 + - ./_ci/build.sh buildout-bob.cfg requirements-bob.txt after_script: - ./_ci/after_build.sh artifacts: @@ -38,24 +38,24 @@ stages: # Template for the test stage - re-installs from uploaded wheels # Needs to run on all supported architectures, platforms and python versions -.test_template: &test_job - stage: test +.test_bob_template: &test_job + stage: test_bob before_script: #- ./_ci/install.sh _ci #updates - ./_ci/before_test.sh script: - - ./_ci/test.sh 1 + - ./_ci/test.sh buildout-bob.cfg after_script: - ./_ci/after_test.sh # Template for the wheel uploading stage # Needs to run against all combinations of python and operating systems -.wheels_template: &wheels_job - stage: wheels +.wheels_bob_template: &wheels_job + stage: wheels_bob environment: intranet only: - - master + - new_ci - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) before_script: #- ./_ci/install.sh _ci #updates @@ -72,14 +72,14 @@ stages: # ------------- # Linux + Python 2.7: Builds, tests, uploads wheel and deploys (if needed) -build_linux_27: +build_bob_linux_27: <<: *build_job variables: &linux_27_build_variables PYTHON_VERSION: "2.7" tags: - conda-linux -test_linux_27: +test_bob_linux_27: <<: *test_job variables: *linux_27_build_variables dependencies: @@ -87,134 +87,11 @@ test_linux_27: tags: - conda-linux -wheels_linux_27: +wheels_bob_linux_27: <<: *wheels_job variables: *linux_27_build_variables dependencies: - build_linux_27 tags: - conda-linux - -# Linux + Python 3.4: Builds and tests -build_linux_34: - <<: *build_job - variables: &linux_34_build_variables - PYTHON_VERSION: "3.4" - tags: - - conda-linux - -test_linux_34: - <<: *test_job - variables: *linux_34_build_variables - dependencies: - - build_linux_34 - tags: - - conda-linux - -wheels_linux_34: - <<: *wheels_job - variables: *linux_34_build_variables - dependencies: - - build_linux_34 - tags: - - conda-linux - - -# Linux + Python 3.5: Builds, tests and uploads wheel -build_linux_35: - <<: *build_job - variables: &linux_35_build_variables - PYTHON_VERSION: "3.5" - tags: - - conda-linux - -test_linux_35: - <<: *test_job - variables: *linux_35_build_variables - dependencies: - - build_linux_35 - tags: - - conda-linux - -wheels_linux_35: - <<: *wheels_job - variables: *linux_35_build_variables - dependencies: - - build_linux_35 - tags: - - conda-linux - -# Mac OSX + Python 2.7: Builds and tests -build_macosx_27: - <<: *build_job - variables: &macosx_27_build_variables - PYTHON_VERSION: "2.7" - tags: - - conda-macosx - -test_macosx_27: - <<: *test_job - variables: *macosx_27_build_variables - dependencies: - - build_macosx_27 - tags: - - conda-macosx - -wheels_macosx_27: - <<: *wheels_job - variables: *macosx_27_build_variables - dependencies: - - build_macosx_27 - tags: - - conda-macosx - - -# Mac OSX + Python 3.4: Builds and tests -build_macosx_34: - <<: *build_job - variables: &macosx_34_build_variables - PYTHON_VERSION: "3.4" - tags: - - conda-macosx - -test_macosx_34: - <<: *test_job - variables: *macosx_34_build_variables - dependencies: - - build_macosx_34 - tags: - - conda-macosx - -wheels_macosx_34: - <<: *wheels_job - variables: *macosx_34_build_variables - dependencies: - - build_macosx_34 - tags: - - conda-macosx - - -# Mac OSX + Python 3.5: Builds and tests -build_macosx_35: - <<: *build_job - variables: &macosx_35_build_variables - PYTHON_VERSION: "3.5" - tags: - - conda-macosx - -test_macosx_35: - <<: *test_job - variables: *macosx_35_build_variables - dependencies: - - build_macosx_35 - tags: - - conda-macosx - -wheels_macosx_35: - <<: *wheels_job - variables: *macosx_35_build_variables - dependencies: - - build_macosx_35 - tags: - - conda-macosx diff --git a/_ci/before_build.sh b/_ci/before_build.sh index 9f090eccb288ab067390a6a969f21763328f08ed..8cca5970c6fa1da6c70292c90970e97433ed1b6e 100755 --- a/_ci/before_build.sh +++ b/_ci/before_build.sh @@ -8,6 +8,8 @@ WHEELS_SERVER=`echo ${DOCSERVER} | sed 's;https\?://;;'` check_env WHEELS_REPOSITORY check_env WHEELS_SERVER +NIGHTLIES=$1 + # Readies the virtualenv to use for installation if [ ! -d ${PREFIX} ]; then log_info "Creating virtualenv installation at ${PREFIX}..." @@ -58,7 +60,13 @@ fi # Finally, bootstrap the installation from the new environment if [ -e bootstrap-buildout.py ]; then - run_cmd ${use_python} bootstrap-buildout.py + + if [ "$NIGHTLIES" -eq '' ]; then + run_cmd ${use_python} bootstrap-buildout.py + else + run_cmd ${use_python} bootstrap-buildout.py -c ${NIGHTLIES} + fi + else log_error "No bootstrap-buildout.py file found, stopping..." exit 1 diff --git a/_ci/build.sh b/_ci/build.sh index ad645882713f0ce57399b39a81fff23b41c70d55..4f68ce5038b85f9325cf33afc4e99fa39803a641 100755 --- a/_ci/build.sh +++ b/_ci/build.sh @@ -4,18 +4,36 @@ source $(dirname ${0})/functions.sh NIGHTLIES=$1 +REQUIREMENTS=$2 + + +if [ "$NIGHTLIES" -eq '' ]; then + run_cmd ./bin/buildout +else + run_cmd ./bin/buildout -c ${NIGHTLIES} +fi + -run_cmd ./bin/buildout if [ -x ./bin/bob_dbmanage.py ]; then - run_cmd ./bin/bob_dbmanage.py all download --force; + run_cmd ./bin/bob_dbmanage.py all download --force; fi if [ -d ./doc ]; then run_cmd ./bin/sphinx-build -W doc sphinx fi -if [ "$NIGHTLIES" -eq 1 ]; then +if [ "$NIGHTLIES" -eq '' ]; then + + if [ -z "${WHEEL_TAG}" ]; then + # C/C++ extensions + run_cmd ./bin/python setup.py bdist_wheel + else + # Python-only packages + run_cmd ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG} + fi + +else # Generating the whell of the nightlies if [ -z "${WHEEL_TAG}" ]; then @@ -25,7 +43,7 @@ if [ "$NIGHTLIES" -eq 1 ]; then fi #WHEELS FROM THE DEPENDENCIES - for f in requirements-bob.txt requirements-satellites.txt + for f in ${REQUIREMENTS} do while read -r line do @@ -40,14 +58,5 @@ if [ "$NIGHTLIES" -eq 1 ]; then run_cmd cd ../../ done < "$f" done - - -else - if [ -z "${WHEEL_TAG}" ]; then - # C/C++ extensions - run_cmd ./bin/python setup.py bdist_wheel - else - # Python-only packages - run_cmd ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG} - fi + fi diff --git a/_ci/test.sh b/_ci/test.sh index 499469dfd45958e031ec6614b89cd3926f00655a..e544b7ef5e81d6aa26e1b2ac5890e80e33f7af90 100755 --- a/_ci/test.sh +++ b/_ci/test.sh @@ -8,13 +8,13 @@ run_cmd cd ${PREFIX} NIGHTLIES=$1 # The tests: -if [ "$NIGHTLIES" -eq 1 ]; then - run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=bob ${BOB_PREFIX_PATH}/bin/nosetests -sv bob - run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report -else +if [ "$NIGHTLIES" -eq '' ]; then run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=${CI_PROJECT_NAME} ${BOB_PREFIX_PATH}/bin/nosetests -sv ${CI_PROJECT_NAME} run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/sphinx-build -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx +else + run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=bob ${BOB_PREFIX_PATH}/bin/nosetests -sv bob + run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report fi run_cmd cd ${CI_PROJECT_DIR} diff --git a/buildout-bob.cfg b/buildout-bob.cfg index 749d52e5072aef796dc6aa77b68d6ccf86ad2cb0..f77e31f1e9af7dec92f5d88132260dc8c512d689 100644 --- a/buildout-bob.cfg +++ b/buildout-bob.cfg @@ -3,6 +3,19 @@ ; Mon 16 Apr 08:29:18 2012 CEST [buildout] +parts = scripts + +extensions = bob.buildout + mr.developer + +auto-checkout = * + +; options for bob.buildout extension +newest = false +debug = false +verbose = true + + develop = src/bob.buildout src/bob.extension src/bob.blitz @@ -106,4 +119,6 @@ bob.db.atnt = git https://gitlab.idiap.ch/bob/bob.db.atnt bob.db.arface = git https://gitlab.idiap.ch/bob/bob.db.arface +[scripts] +recipe = bob.buildout:scripts diff --git a/buildout-satellites.cfg b/buildout-satellites.cfg index 8b8816076d62af5d26aea7bf40baafe23602c48e..ad56313d4190e42e77398f5e2b15854259aa1272 100644 --- a/buildout-satellites.cfg +++ b/buildout-satellites.cfg @@ -3,8 +3,20 @@ ; Mon 16 Apr 08:29:18 2012 CEST [buildout] -extends = buildout-bob.cfg -develop += src/bob.db.bio_filelist + +parts = scripts + +extensions = bob.buildout + mr.developer +auto-checkout = * + +; options for bob.buildout extension +newest = false +debug = false +verbose = true + + +develop = src/bob.db.bio_filelist src/bob.db.banca src/bob.db.biosecure src/bob.db.caspeal @@ -38,7 +50,7 @@ develop += src/bob.db.bio_filelist src/bob.db.cuhk_cufs src/gridtk -eggs += bob.db.bio_filelist +eggs = bob.db.bio_filelist bob.db.banca bob.db.biosecure bob.db.caspeal @@ -108,3 +120,6 @@ bob.db.putvein = git https://gitlab.idiap.ch/bob/bob.db.putvein bob.db.cuhk_cufs = git https://gitlab.idiap.ch/bob/bob.db.cuhk_cufs gridtk = git https://gitlab.idiap.ch/bob/gridtk +[scripts] +recipe = bob.buildout:scripts +