WordPress.org

Make WordPress Core

Ticket #34694: xwp.wordpress-develop.34694.pr135.f89c25a4...7ea00442.diff

File xwp.wordpress-develop.34694.pr135.f89c25a4...7ea00442.diff, 2.7 KB (added by xwp-bot, 5 years ago)

PR 135, ±Δ f89c25a4...7ea00442, Tests: ✅ PASS

  • Allow Travis CI to run user-defined external scripts via environment vars (by Weston Ruter)
  • .travis.yml

    diff --git .travis.yml .travis.yml
    index 7eeff03..b718944 100644
    before_install: 
    3131- git clone https://github.com/WordPress/twentysixteen.git src/wp-content/themes/twentysixteen
    3232- |
    3333  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
    34       mysql -e "CREATE DATABASE wordpress_tests;" -uroot
    35       cp wp-tests-config-sample.php wp-tests-config.php
    36       sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
    37       sed -i "s/yourusernamehere/travis/" wp-tests-config.php
    38       sed -i "s/yourpasswordhere//" wp-tests-config.php
    39       svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
     34    mysql -e "CREATE DATABASE wordpress_tests;" -uroot
     35    cp wp-tests-config-sample.php wp-tests-config.php
     36    sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
     37    sed -i "s/yourusernamehere/travis/" wp-tests-config.php
     38    sed -i "s/yourpasswordhere//" wp-tests-config.php
     39    svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
    4040  fi
    4141- |
    4242  if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
    4343    curl https://raw.githubusercontent.com/tollmanz/wordpress-pecl-memcached-object-cache/584392b56dc4adbe52bd2c7b86f875e23a3e5f75/object-cache.php > src/wp-content/object-cache.php
    4444    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    4545  fi
     46- |
     47  if [[ "$WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC" ]]; then
     48    echo "Running custom BEFORE_INSTALL from $WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC"
     49    wget -O /tmp/custom-before-install.sh "$WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC";
     50    source /tmp/custom-before-install.sh;
     51  fi
    4652before_script:
    4753- npm install -g npm
    4854- npm install -g grunt-cli
    4955- npm install
    50 script: grunt $WP_TRAVISCI
     56- |
     57  if [[ "$WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC" ]]; then
     58    echo "Running custom BEFORE_SCRIPT from $WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC"
     59    wget -O /tmp/custom-before-script.sh "$WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC";
     60    source /tmp/custom-before-script.sh;
     61  fi
     62script:
     63- grunt $WP_TRAVISCI
     64- |
     65  if [[ "$WP_TRAVISCI_CUSTOM_SCRIPT_SRC" ]]; then
     66    echo "Running custom after_script from $WP_TRAVISCI_CUSTOM_SCRIPT_SRC"
     67    wget -O /tmp/custom-script.sh "$WP_TRAVISCI_CUSTOM_SCRIPT_SRC";
     68    source /tmp/custom-script.sh;
     69  fi
     70after_script:
     71- |
     72  if [[ "$WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC" ]]; then
     73    echo "Running custom after_script from $WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC"
     74    wget -O /tmp/custom-after-script.sh "$WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC";
     75    source /tmp/custom-after-script.sh;
     76  fi
    5177notifications:
    5278  slack:
    5379    rooms: