From f59410deb6441d6860f0eafc9eb040e3ff3c78a3 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 24 Aug 2018 21:24:38 +0200 Subject: [PATCH] Enh: Dont run install before deploy stage --- .travis.yml | 9 ++++----- .travis/setup-humhub.sh | 10 ++++++++-- .travis/trigger-modules.sh | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d87d34a415..7c594138e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,20 +20,19 @@ jobs: include: - stage: deploy name: "Trigger build for external modules" + install: skip script: .travis/trigger-modules.sh install: - .travis/install-dependencies.sh - .travis/setup-humhub.sh -before_script: +script: - '$HOME/chromedriver --url-base=/wd/hub &' - 'php --server 127.0.0.1:8080 --docroot ${TRAVIS_BUILD_DIR} &>/dev/null &' -- 'sleep 5' -- 'curl --fail --head http://127.0.0.1:8080/index-test.php' -script: +- 'sleep 5 && curl --fail --head http://127.0.0.1:8080/index-test.php' - 'cd protected/humhub/tests' - 'php ../../vendor/bin/codecept build' - 'php ../../vendor/bin/codecept run --env travis' -- cd ../../../ +- 'cd ../../../' after_failure: - .travis/upload-failure.sh env: diff --git a/.travis/setup-humhub.sh b/.travis/setup-humhub.sh index c383655bbb..90eb7bb96a 100755 --- a/.travis/setup-humhub.sh +++ b/.travis/setup-humhub.sh @@ -3,14 +3,20 @@ # -e = exit when one command returns != 0, -v print each command before executing set -ev +# Install composer packages composer install --prefer-dist --no-interaction +# Install node packages npm install + +# Build production assets grunt build-assets -cd ${TRAVIS_BUILD_DIR}/protected/humhub/tests - +# Create mysql database mysql -e 'CREATE DATABASE humhub_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' + +# Run migrations, setup humhub and rebuild search index +cd ${TRAVIS_BUILD_DIR}/protected/humhub/tests php codeception/bin/yii migrate/up --includeModuleMigrations=1 --interactive=0 php codeception/bin/yii installer/auto php codeception/bin/yii search/rebuild \ No newline at end of file diff --git a/.travis/trigger-modules.sh b/.travis/trigger-modules.sh index 74c3f9e317..4d2df68d54 100755 --- a/.travis/trigger-modules.sh +++ b/.travis/trigger-modules.sh @@ -3,13 +3,13 @@ # -e = exit when one command returns != 0, -v print each command before executing set -ev -# early exit when pull request || early exit when not master +# early exit when pull request || when not master if [ "${TRAVIS_PULL_REQUEST}" != "false" ] || [ "${TRAVIS_BRANCH}" != "master" ]; then exit 0; fi # trigger build for calendar -curl -X POST \ +curl -s -X POST \ https://api.travis-ci.org/repo/humhub%2Fhumhub-modules-calendar/requests \ -H 'Accept: application/json' \ -H 'Authorization: token '${AUTH_TOKEN} \