3

As a part of my my customized travis build I would like to use Travis command-line client inside after_success script. I need that to trigger some operations on other travis jobs (other repositories) after each successfull build in this particular repo. So two questions:

  • Is it possible at all?
  • If so is there any smart or quick way to do that?

As far as I know Travis Cli has several ruby dependencies that may not be available by default. But perhaps it is by default installed on travis VMs.

running.t
  • 5,329
  • 3
  • 32
  • 50

1 Answers1

4

Yes, this is completely possible. However, this would only work for language: ruby jobs.

For your specific case, you can do:

after_success:
  # install travis cli
  - gem install --no-document travis
  # setup travis shell autocomplete
  - echo "y" | travis --version
  # do travis cli stuff
  - travis do stuff

If you have a project using another language, then this becomes much more complicated.

Matthew Schuchard
  • 25,172
  • 3
  • 47
  • 67
  • Does "much more complicated" mean you can't call gem in project that is not using ruby? I will have to test it. – running.t Jul 02 '17 at 13:51
  • Actually I tested using gem and installing travis in 'after_success' stage on **python** build and (at least on enterprise travis ci) it seems to works perfectly. – running.t Jul 03 '17 at 11:35