Search code examples
continuous-integrationautomated-teststravis-cinightwatch.jsbrowserstack

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!


Solution

  • 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