Travis CI Build Config Reference
Welcome to the Travis CI build config reference documentation.
You can find the build config in the .travis.yml
file in your repository. This site documents its format.
The Travis CI build config format is formally specified using a JSON Schema. Travis CI uses this specification to normalize and validate build configs (this is currently in beta, and needs to be activated).
Use the Travis CI Build Config Explorer to explore and experiment with build config YAML snippets.
See also
Keys
language
— Language support to enable (type: enum (string), known values:android
,c
,clojure
,cpp
,crystal
,csharp
,d
,dart
,elixir
,elm
,...
, default:ruby, objective-c
, e.g.:ruby
) detailsos
— Build environment operating systems (type: sequence of enum (string), or enum (string), known values:linux
,osx
,windows
,freebsd
,linux-ppc64le
, default:linux, osx
) detailsdist
— Build environment distribution (type: enum (string), known values:trusty
,precise
,xenial
,bionic
,focal
,jammy
,server-2016
,rhel8
, default:xenial
) detailsarch
— Build environment architectures (type: sequence of enum (string), or enum (string), known values:amd64
,arm64
,arm64-graviton2
,ppc64le
,i386
,s390x
) detailssudo
— Whether to allow sudo access (deprecated, type: boolean, or string, e.g.:required
) detailsimport
— Build configuration imports (type: sequence of map, sequence of string, map, or string) detailsenv
— Environment variables to set up (type: map, sequence of map, sequence of secure, sequence of string, secure, or string) detailscompiler
— Compilers to set up (type: sequence of string, or string) detailsosx_image
— (type: sequence of string, or string) detailsstages
— Build stages definition (type: sequence of map, sequence of string, map, or string) detailsjobs
— Build matrix definitions (type: map, sequence of job matrix includes, or job matrix includes, alias:matrix
) detailsnotifications
— Notification targets to notify on build results (type: map, sequence of map, sequence of sequence of secure, sequence of secure, sequence of boolean, secure, or boolean) detailsversion
— Build config specification version (type: string, e.g.:>= 1.0.0
) detailsvm
— VM size settings (type: vm, default: ``) detailsperforce_test_path
— Perforce depot subpath (type: string) detailsvault
— (type: vault) details
Shared keys
addons
: Build addons to activate detailsbranches
: Include or exclude branches from being built detailscache
: Cache settings to speed up the build detailsdeploy
: Deployment target configurations detailsgit
: Git settings detailsif
: Condition to determine if a build, stage, or job should be run, a config source imported, or a notification sent detailsservices
: Services to set up and start detailsworkspaces
: Shared build workspaces detailskeys
: Custom keys to use detailsbefore_install
: Scripts to run before the install stageinstall
: Scripts to run at the install stagebefore_script
: Scripts to run before the script stagescript
: Scripts to run at the script stagebefore_cache
: Scripts to run before storing a build cacheafter_success
: Scripts to run after a successful script stageafter_failure
: Scripts to run after a failing script stagebefore_deploy
: Scripts to run before the deploy stageafter_deploy
: Scripts to run after the deploy stageafter_script
: Scripts to run as the last stage
Examples
vault:
api_url: string
token:
secure: encrypted string
secrets:
- string
language: ruby
os:
- linux
- osx
dist: trusty
os: linux