Sometimes you need a really dynamic configuration when setting up your pipeline. With imported configs, those configs can themselves include other configs, making this feature very composable (cyclic imports will be skipped). Let’s get started.
Getting started with Build Imports
When using Build Imports, remember that the main source of configuration for your build is the
.travis.yml file stored in the root directory of your project. So for example, here’s my root
script: echo "It's Friday, which means blog day by Montana Mendy!"
Now, let’s make a folder called in your project called
.travis, and in there, we’ll have a file called
all-the-rubies.yml, here’s the content of this configuration:
You’ll see the second imported configuration entitled
only-some-branches.yml in the
.travis folder in our project. Now here’s the content of that configuration file I made:
So you can see above, there’s one master
.yml config, and you can think of the other two configurations as
child configurations. You can imagine with our Build Matrix feature and using Build Imports how flexible your builds can really be.
You’ve just used Build Imports in Travis like a pro! As per usual here’s an example repo I’ve made so you can follow it step by step and start using Build Imports.
As always, if you have any questions about Build Imports, please email me at [email protected] and I will assist you.