diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2017-11-08 15:49:04 +0100 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2017-11-08 15:49:46 +0100 |
| commit | df25c1301da8d3d25503f5bdfa15fad6b1433eb8 (patch) | |
| tree | c5704d5717b23d2dbcb9172f27fa66fed63d3272 | |
| parent | a7bb375e8aec501b7746f1422e7cc8f21e846d3c (diff) | |
| download | rabbitmq-server-git-df25c1301da8d3d25503f5bdfa15fad6b1433eb8.tar.gz | |
Travis CI: Update config from rabbitmq-common
| -rwxr-xr-x | .travis.sh | 258 | ||||
| -rw-r--r-- | .travis.yml | 81 |
2 files changed, 39 insertions, 300 deletions
diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index f5f786b907..0000000000 --- a/.travis.sh +++ /dev/null @@ -1,258 +0,0 @@ -#!/usr/bin/env bash - -set -o nounset -set -o errexit - -declare -r tmp_file="$(mktemp)" -declare -r script_arg="${1:-unset}" - -function onexit -{ - rm -vf "$tmp_file" -} - -trap onexit EXIT - -function main -{ - # Note: if script_arg is kiex_cleanup, - # this function exits early - kiex_cleanup - - # Note: if script_arg is tests, - # this function exits early - maybe_run_tests "$@" - - ensure_directories - ensure_kerl - ensure_kiex - ensure_make - ensure_otp -} - -function test_group_0 -{ - make ct-backing_queue - make ct-channel_interceptor - make ct-channel_operation_timeout - make ct-cluster_formation_locking -} - -function test_group_1 -{ - make ct-clustering_management - make ct-cluster_rename - make ct-cluster - make ct-config_schema -} - -function test_group_2 -{ - make ct-crashing_queues - make ct-credential_validation - make ct-disconnect_detected_during_alarm - make ct-dynamic_ha -} - -function test_group_3 -{ - make ct-eager_sync - make ct-gm - make ct-health_check - make ct-lazy_queue -} - -function test_group_4 -{ - make ct-list_consumers_sanity_check - make ct-list_queues_online_and_offline - make ct-many_node_ha - make ct-metrics -} - -function test_group_5 -{ - make ct-mirrored_supervisor - make ct-msg_store - # TODO FUTURE HACK - # This suite fails frequently on Travis CI - # make ct-partitions - make ct-peer_discovery_dns -} - -function test_group_6 -{ - make ct-per_user_connection_tracking - make ct-per_vhost_connection_limit_partitions - make ct-per_vhost_connection_limit - make ct-per_vhost_msg_store -} - -function test_group_7 -{ - make ct-per_vhost_queue_limit - make ct-plugin_versioning - make ct-policy - make ct-priority_queue_recovery -} - -function test_group_8 -{ - make ct-priority_queue - make ct-proxy_protocol - make ct-queue_master_location - make ct-rabbit_core_metrics_gc -} - -function test_group_9 -{ - make ct-rabbitmqctl_integration - make ct-rabbitmqctl_shutdown - make ct-simple_ha - make ct-sup_delayed_restart -} - -function test_group_10 -{ - make ct-sync_detection - make ct-term_to_binary_compat_prop - make ct-topic_permission - make ct-unit_inbroker_non_parallel -} - -function test_group_11 -{ - make ct-unit_inbroker_parallel - make ct-unit - make ct-worker_pool -} - -function maybe_run_tests -{ - if [[ $script_arg == 'tests' ]] - then - # Note: Travis env specifies test suite number - local -ri group="${2:-999}" - - local -r test_func="test_group_$group" - "$test_func" - - # Only doing tests, so early exit - exit 0 - fi -} - -function kiex_cleanup -{ - rm -vf "$HOME"/.kiex/bin/*.bak* - rm -vf "$HOME"/.kiex/elixirs/.*.old - rm -vf "$HOME"/.kiex/elixirs/*.old - rm -vf "$HOME"/.kiex/scripts/*.bak* - - if [[ $script_arg == 'kiex_cleanup' ]] - then - # Only doing cleanup, so early exit - exit 0 - fi -} - - -function ensure_directories -{ - set +o errexit - mkdir "$HOME/otp" - mkdir "$HOME/bin" - set -o errexit - export PATH="$HOME/bin:$PATH" -} - -function ensure_kerl -{ - curl -Lo "$HOME/bin/kerl" https://raw.githubusercontent.com/kerl/kerl/master/kerl - chmod 755 "$HOME/bin/kerl" -} - -function ensure_kiex -{ - curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | /usr/bin/env bash -s - local -r kiex_script="$HOME/.kiex/scripts/kiex" - if [[ -s $kiex_script ]] - then - source "$kiex_script" - # Note: this produces a lot of output but without running - # "list known" first, kiex install ... sometimes fails - kiex list known - kiex_cleanup - else - echo "Did not find kiex at $kiex_script" 1>&2 - exit 1 - fi -} - -function ensure_make -{ - # GNU Make build variables - local -r make_install_dir="$HOME/gmake" - local -r make_bin_dir="$make_install_dir/bin" - - export PATH="$make_bin_dir:$PATH" - - if [[ -x $make_bin_dir/make ]] - then - echo "Found GNU Make installation at $make_install_dir" - else - mkdir -p "$make_install_dir" - curl -sLO http://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz - tar xf make-4.2.1.tar.gz - pushd make-4.2.1 - ./configure --prefix="$make_install_dir" - make - make install - popd - fi -} - -function build_ticker -{ - local status - - status=$(< "$tmp_file") - while [[ $status == 'true' ]] - do - echo '------------------------------------------------------------------------------------------------------------------------------------------------' - echo "$(date) building $otp_tag_name ..." - if ls "$otp_build_log_dir"/otp_build*.log > /dev/null - then - tail "$otp_build_log_dir"/otp_build*.log - fi - sleep 10 - status=$(< "$tmp_file") - done - echo '.' -} - -function ensure_otp -{ - # OTP build variables - local -r otp_tag_name="$script_arg" - local -r otp_build_log_dir="$HOME/.kerl/builds/$otp_tag_name" - local -r otp_install_dir="$HOME/otp/$otp_tag_name" - if [[ -s $otp_install_dir/activate ]] - then - echo "Found OTP installation at $otp_install_dir" - else - export KERL_CONFIGURE_OPTIONS='--enable-hipe --enable-smp-support --enable-threads --enable-kernel-poll' - rm -rf "$otp_install_dir" - mkdir -p "$otp_install_dir" - - echo -n 'true' > "$tmp_file" - build_ticker & - kerl build git https://github.com/erlang/otp.git "$otp_tag_name" "$otp_tag_name" - echo -n 'false' > "$tmp_file" - wait - - kerl install "$otp_tag_name" "$otp_install_dir" - fi -} - -main "$@" diff --git a/.travis.yml b/.travis.yml index 303ae808ab..a9537e61f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,31 @@ # vim:sw=2:et: -sudo: false - -language: generic +sudo: false +language: erlang +notifications: + email: + - alerts@rabbitmq.com addons: apt: + sources: + - sourceline: deb https://packages.erlang-solutions.com/ubuntu trusty contrib + key_url: https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc packages: - - unixodbc - - unixodbc-dev - - libwxgtk2.8-dev + - awscli + # Use Elixir from Erlang Solutions. The provided Elixir is + # installed with kiex but is old. We also can't use kiex to + # install a newer one because of GitHub API rate limiting. + - elixir=1.4.5-1 +cache: + apt: true +env: + global: + - secure: E4FIneR14YxnWbNNgFY48+Z8YpnwWcvIR0nD1Mo06WKXaq05UfQNQ7SZCjI3kKCNJGMhac12DFRhln+mQZ+T92MQ7IeU3ugpV5RSm+JqIwwIKzVM3+bjCQnFoL24OD4E+GjhJQWYQmPyM7l4OPluMr2N8BtANItgzX3AvljvlSc= + - secure: L1t0CHGR4RzOXwtkpM6feRKax95rszScBLqzjstEiMPkhjTsYTlAecnNxx6lTrGMnk5hQoi4PtbhmyZOX0siHTngTogoA/Nyn8etYzicU5ZO+qmBQOYpegz51lEu70ewXgkhEHzk9DtEPxfYviH9WiILrdUVRXXgZpoXq13p1QA= otp_release: + - "19.3" - "20.1" - -services: - - docker - -env: - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=0 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=1 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=2 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=3 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=4 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=5 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=6 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=7 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=8 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=9 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=10 - - OTP_TAG_NAME=OTP-20.1 TEST_SUITE=11 before_script: # The checkout made by Travis is a "detached HEAD" and branches @@ -42,26 +39,26 @@ before_script: git remote add upstream https://github.com/$TRAVIS_REPO_SLUG.git git fetch upstream stable:stable || : git fetch upstream master:master || : - # Install kerl; build gmake 4.2.1 and OTP - - $TRAVIS_BUILD_DIR/.travis.sh $OTP_TAG_NAME - - export PATH="$HOME/bin:$HOME/gmake/bin:$PATH" - - source "$HOME/otp/$OTP_TAG_NAME/activate" - - kerl active - - test -s "$HOME/.kiex/scripts/kiex" && source "$HOME/.kiex/scripts/kiex" - - test -x "$HOME/.kiex/elixirs/elixir-1.4.5/bin/elixir" || kiex install 1.4.5 - - kiex use 1.4.5 --default - - mix local.hex --force - - make --version + # Make sure we use Elixir from Erlang Solutions and not kiex. + - | + echo YES | kiex implode + elixir --version + elixir --version | grep -q 'Elixir 1.4.5' script: - - $TRAVIS_BUILD_DIR/.travis.sh tests $TEST_SUITE + - make xref + - make ct-fast -before_cache: - - $TRAVIS_BUILD_DIR/.travis.sh kiex_cleanup +after_failure: + - | + cd "$TRAVIS_BUILD_DIR" + if test -d logs && test "$AWS_ACCESS_KEY_ID" && test "$AWS_SECRET_ACCESS_KEY"; then + archive_name="$(basename "$TRAVIS_REPO_SLUG")-$TRAVIS_JOB_NUMBER" -cache: - directories: - - "$HOME/otp" - - "$HOME/.kiex" - - "$HOME/gmake" - - "$HOME/bin" + tar -c --transform "s/^logs/${archive_name}/" -f - logs | \ + xz > "${archive_name}.tar.xz" + + aws s3 cp "${archive_name}.tar.xz" s3://server-release-pipeline/travis-ci-logs/ \ + --region eu-west-1 \ + --acl public-read + fi |
