Ubuntu Xenial 16.04 as the default Travis CI build environment

Xenial as the default Travis CI build environment is coming up next week, starting incrementally on Tuesday April 23rd, 2019.

Since Ubuntu 14.04 reaches End of Life on April 30th, 2019, we’ll be gradually setting the default distribution for builds to Linux, Ubuntu Xenial 16.04.

We plan to make dist: xenial the default for all builds by the beginning of May 2019, and we’ll make sure to let you all know here and in our changelog as soon as the default build environment switch is done.

What does this mean for your projects?

Repositories without an explicit dist: YAML key in their .travis.yml file will be routed to Xenial instead of Trusty.

Repositories without an explicit operating system os: key in their travis.yml file will use Linux Ubuntu Xenial 16.04.

There are three important changes to take into account when updating to Xenial from our Trusty build environment:

1. Services support

Services like MySQL or PostgreSQL are not started by default. To start any service, such as MySQL, add it to the services key in your config:

  services:
    - mysql

2. Third-part APT sources

Sources from third-party APT repositories have been removed. During the Xenial image provision, third-party APT repositories are used to pre-install services like redis-server. These packages are available during build time, but to reduce the risk of sporadic apt-get update failures, the repositories are removed after the packages are installed.

For example, to update the git-lfs version, you’d need to explicitly specify the source in your config:

You can find the full list of sources and packages that have been used and to install and then removed here: https://docs.travis-ci.com/user/reference/xenial#third-party-apt-repositories-removed

addons:
  apt:
    sources:
    	- github-git-lfs-xenial
    packages:
    	- git-lfs

3. Headless browser testing

To use headless browser testing, you now start xvfb via the services key, like this:

services:
  - xvfb

If you had configured xvfb manually in your trusty builds, please replace it with the services key above, which is also easier to maintain!

To recap!

The default build environment will gradually start changing on April, 23rd 2019. You can identify if your repository is now running on Xenial by checking your build log, under Operating System Details like:

Jobs run on Xenial, display Operarting System Details, Description: Ubuntu 16.04.5 LTS

You can find the specific versions of what’s pre-installed in the Xenial Reference docs.

Get a head start! Checkout a new branch, specify dist: xenial to see how it will work out for your repository. And if there’s anything you’d like to see improved, please let us know in the Community Forum: Xenial.

And if your build depends on Ubuntu Trusty 14.04, you can explicitly specify dist: trusty to avoid your build being automatically routed to Xenial during this default build environment update.

Ah! In case you’d like one more reason to update, Ubuntu Xenial 16.04 on Travis CI, comes with Git Wire Protocol, Version 2 !