The Trusty Build Environment

Trusty is EOL by Canonical, try updating to a newer image and see our Trusty to Xenial Migration Guide.

What This Guide Covers #

This guide provides a general overview of which packages, tools and settings are available in the Trusty environment.

Using Trusty #

To use Ubuntu Trusty, add the following to your .travis.yml.

dist: trusty

If you’d like to know more about the pros, cons, and current state of using Trusty, read on.

Travis CI runs each build in an isolated Google Compute Engine virtual machine that offers a vanilla build environment for every build.

Builds have access to a variety of services for data storage and messaging, and can install anything that’s required for them to run.

Linux infrastructure #

Travis CI runs each build in an isolated Google Compute Engine virtual machine that offer a vanilla build environment for every build.

This has the advantage that no state persists between builds, offering a clean slate and making sure that your tests run in an environment built from scratch.

Your build is routed to this infrastructure automatically, you don’t need make any modifications to your .travis.yml.

Container-based infrastructure #

Container-based infrastructure has been fully deprecated. Please remove any sudo: false keys in your .travis.yml file to use the fully-virtualized Linux infrastructure.

Image differences from Precise #

In our Precise based environments, we’ve traditionally built a library of images based on common language runtimes like ruby, go, php, python, etc.

For our Trusty based environments, we’re making a smaller set of images that includes:

  • A minimal image which contains a small subset of interpreters, as well as docker and packer.
  • A considerably larger image which contains roughly the same runtimes and services present in Precise environments.

Environment common to all Trusty images #

Version control #

All virtual machine images have the following pre-installed:

  • Git 2.x
  • Mercurial
  • Subversion (official Ubuntu packages)

Compilers & Build toolchain #

The build-essential metapackage is installed, as well as modern versions of:

  • GCC
  • Clang
  • make
  • autotools
  • cmake
  • scons

Networking tools #

  • curl
  • wget
  • OpenSSL
  • rsync

Docker #

Docker is installed as a service. We use the official Docker apt repository, so you can easily install another version with apt if needed.

docker-compose is also installed.

See our Using Docker in Builds section for more details.

Ruby images #

rvm is installed and we pre-install at least two of the latest point releases. These are the currently pre-installed Ruby versions:

  • 2.2.7
  • 2.3.4
  • 2.4.1

Other versions are dynamically installed at runtime from a local cache.

Python images #

We pre-install at least two of the latest releases of CPython in the 2.x and 3.x series such as 2.7.13 and 3.6.1, and at least one version of PyPy. Any versions that are not pre-installed will be dynamically installed at runtime from a local cache.

pyenv is also installed.

Default Python Version #

If you leave the python key out of your .travis.yml, Travis CI will use Python 2.7.

Pre-installed pip packages #

Travis CI installs the following packages by default in each virtualenv:

  • nose
  • pytest
  • wheel
  • mock
  • six

On all Python versions except pypy and pypy3, numpy is available as well.

JavaScript and Node.js images #

nvm is installed and we pre-install at least two of the latest point releases such as 6.9.4 and 7.4.0.

You can specify other versions which will be dynamically installed using nvm.

Go images #

gimme is installed and we pre-install at least two of the latest point releases such as 1.7.3 and 1.8.3. Any versions that are not pre-installed will be dynamically installed by gimme.

JVM (Clojure, Groovy, Java, Scala) images #

  • We install the latest OpenJDK versions from the official Ubuntu Trusty packages:
    • Open JDK 7 (openjdk7)
    • Open JDK 8 (openjdk8)
    • OpenJDK 6 is not installed. To use OpenJDK 6, install openjdk-6-jdk package. For example, using apt addon:
      addons:
        apt:
          packages:
            - openjdk-6-jdk
      jdk: openjdk6
      
  • We install the latest Oracle JDK versions from Oracle:
    • Oracle JDK 8 (oraclejdk8). Default.
    • Oracle JDK 9 (oraclejdk9)
    • Oracle JDK 7 is not provided because it reached End of Life in April 2015.
    • Oracle JDK 10 is not provided because it reached End of Life in October 2018.
    • Oracle JDK 11 (oraclejdk11)
  • jdk_switcher is installed if you need another JDK version.

The $JAVA_HOME will be set correctly when you choose the jdk value for the JVM image.

Gradle version #

Gradle 4.0.

Maven version #

Stock Apache Maven 3.5.x, configured to use Central and Sonatype mirrors.

Ant version #

Ant 1.9.3.

Leiningen version #

Leiningen 2.7.1.

SBT version #

Travis CI potentially provides any version of Simple Build Tool (sbt or SBT) thanks to the very powerful sbt-extras alternative. sbt can dynamically detect and install the sbt version required by your Scala projects.

Perl images #

Perl versions are installed via Perlbrew. The default version of Perl is 5.14.

Perl runtimes with threading support #

Some Perls have been compiled with threading support. They have been compiled with the additional compile flags -Duseshrplib and -Duseithreads:

5.26-shrplib
5.24-shrplib
5.22-shrplib
5.20-shrplib
5.18-shrplib

Pre-installed modules #

cpanm (App::cpanminus)
Dist::Zilla
Dist::Zilla::Plugin::Bootstrap::lib
ExtUtils::MakeMaker
LWP
Module::Install
Moose
Test::Exception
Test::Kwalitee
Test::Most
Test::Pod
Test::Pod::Coverage

PHP images #

phpenv is installed and we pre-install at least two of the latest point releases such as 7.0.7 and 5.6.24, as well as 5.5.9, the version shipped by default with Ubuntu 14.04 LTS. Any versions that are not pre-installed will be dynamically installed from a local cache, or built via phpenv if unavailable.

Note: We do not support PHP versions 5.2.x and 5.3.x on Trusty. Specifying it will result in build failure. If you need to test with these versions, use Precise.

language: php
jobs:
  include:
    - php: 5.2
      dist: precise
    - php: 5.3
      dist: precise

HHVM #

hhvm is also available. and the nightly builds are installed on-demand (as hhvm-nightly).

language: php
dist: trusty
php:
  - hhvm-3.3
  - hhvm-3.6
  - hhvm-3.9
  - hhvm-3.12
  - hhvm-3.15
  - hhvm-3.18
  - hhvm-nightly

Extensions #

PHP 7.0 #

The following extensions are preinstalled for PHP 7.0 and nightly builds:

Please note that these extensions are not enabled by default with the exception of xdebug.

PHP 5.6 and below #

For PHP versions up to 5.6, the following extensions are available:

Please note that these extensions are not enabled by default with the exception of xdebug.

Other software #

Install other Ubuntu packages using apt-get, or add third party PPAs or custom scripts. For further details, please see the document on installing dependencies.

Databases and services #

We pre-install the following services which may be activated with the built-in services support.

  • Apache Cassandra
  • CouchDB
  • ElasticSearch
  • MongoDB
  • MySQL
  • Neo4j
  • PostgreSQL
  • RabbitMQ
  • Redis
  • Riak
  • SQLite

Firefox #

Firefox is installed by default.

If you need a specific version of Firefox, use the Firefox addon to install it during the before_install stage of the build.

For example, to install version 50.0, add the following to your .travis.yml file:

addons:
  firefox: "50.0"

Headless Browser Testing Tools #

Environment variables #

There is a list of default environment variables available in each build environment.

apt configuration #

apt is configured to not require confirmation (assume -y switch by default) using both DEBIAN_FRONTEND env variable and apt configuration file. This means apt-get install -qq can be used without the -y flag.

Group membership #

The user executing the build ($USER) belongs to one primary group derived from that user.

If you need to modify group membership follow these steps:

  1. Set up the environment. This can be done any time during the build lifecycle prior to the build script execution.

    • Set up and export environment variables.
    • Add $USER to desired secondary groups: sudo usermod -a -G SECONDARY_GROUP_1,SECONDARY_GROUP_2 $USER You may modify the user’s primary group with -g.
  2. Your script would look something like:

script: sudo -E su $USER -c 'COMMAND1; COMMAND2; COMMAND3'

This will pass the environment variables down to a bash process which runs as $USER, while retaining the environment variables defined and belonging to secondary groups given above in usermod.

Build system information #

In the build log, relevant software versions (including the available language versions) are shown in the “Build system information” section.

Other Ubuntu Linux Build Environments #

You can have a look at the Ubuntu Linux overview page for the different Ubuntu Linux build environments you can use.