Skip to content

Instantly share code, notes, and snippets.

@sandfox
Last active February 27, 2018 10:42
Show Gist options
  • Save sandfox/9ba4eef20a72bd04ed959a6e3d9756d7 to your computer and use it in GitHub Desktop.
Save sandfox/9ba4eef20a72bd04ed959a6e3d9756d7 to your computer and use it in GitHub Desktop.
travis conditionals debugging

Small starter script to testing your travis conditionals (tested with travis-conditions 0.0.2)

ruby test.rb
source 'https://rubygems.org'
gem 'travis-conditions'
require 'rubygems'
require 'bundler/setup'
require 'travis/conditions'
str = 'branch IN (foo, bar) AND env(baz) =~ ^baz- OR tag IS present'
data = { branch: 'foo', env: { baz: 'baz-1' }, tag: 'v.1.0.0', type: 'pull_request' }
puts Travis::Conditions.eval(str, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment