简体   繁体   中英

Disable Travis CI build in .travis.yml

I'd like to disable, or turn off, Travis CI builds for stretches of time. In my case it's because I'm using a private repo and don't want to use up free builds. Also, there are times down the road I'll want to disable Travis builds while experimenting with new features.

There are 2 methods to do this but neither is ideal:

  • Append [ci skip] or [skip ci] to a commit message - this would become tedious
  • Disable builds in the TravisCI.com interface - requires logging in to TravisCI to turn it on/off, or even see if it's on/off

What I'm looking for is a way to disable builds for a few days at a time, in my project, without completely deleting the .travis.yml file?

Is it possible to disable Travis CI builds via a config setting in .travis.yml ?

Something like this:

enabled: false             // Travis CI builds turned off
language: node_js
node_js:
  - "6.11.2"
deploy:
  provider: heroku
  api_key:
    secure: [KEY]
  app: [APP-NAME]

If you do not create any job (or creates too many) in .travis.yml , the build request will be rejected.

For example:

language: ruby
rvm: '2.4'
matrix:
  exclude:
    rvm: '2.4'

This may be impractical depending on how complex your intended configuration is.

You'd probably want to use a CLI client https://github.com/travis-ci/travis.rb . See https://github.com/travis-ci/travis.rb#enable and https://github.com/travis-ci/travis.rb#disable .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM