Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have Travis-ci trigger another repository's build?

I am trying to wrap my head around Travis-ci scripts but I am trying to figure out if what I want is even possible:

Repo #1: - my app to be built via travis-ci

Repo #2: - contains selenium/nightwatch tests that should run once repo #1 is finished building

So this is the workflow I am aiming for:

  • a PR in Repo #1 gets merged
  • Travis-ci builds Repo #1 and completes successfully & deploys
  • Travis-ci tells Repo #2 to start building
  • Repo #2 installs the repo which triggers browserstack to begin running the selenium tests

Is this at all possible? I've been researching this for a few days and couldn't find a way to trigger a separate repo to build.

Any help is appreciated.

Thanks!

like image 947
Peter B Avatar asked Nov 14 '17 19:11

Peter B


People also ask

How do you trigger a build in Travis CI?

Trigger Travis CI builds using the API V3 by sending a POST request to /repo/{slug|id}/requests : Get an API token from your Travis CI settings page. You'll need the token to authenticate most of these API requests.

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.

Which of the following type of commands are supported by Travis CLI?

There are three types of commands: Non-API Commands, General API Commands and Repository Commands. All commands take the form of travis COMMAND [ARGUMENTS] [OPTIONS] .


1 Answers

Possible Duplicate of: Triggering builds of dependent projects in Travis CI

Nevertheless, pasting the answer here: Yes, it is possible to trigger another Travis job after a first one succeeds. You can use the trigger-travis.sh script that is part of the plume-lib library.

The script's documentation tells how to use it -- set an environment variable and add three lines to your .travis.yml file.

You can setup repo#1 and repo#2 using different jobs and use the above approach to trigger downstream job after successfully deployment has completed using job 1

like image 110
BountyHunter Avatar answered Sep 23 '22 01:09

BountyHunter