# Import different files into different jobs

**URL:** <https://travis-ci.community/t/import-different-files-into-different-jobs/6292>\
**Category:** Early Releases\
**Tags:** config-import\
**Created:** [December 4, 2019, 8:28am UTC](https://travis-ci.community/t/import-different-files-into-different-jobs/6292 "2019-12-04T08:28:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergialonsoalpha](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sergialonsoalpha](https://travis-ci.community/u/sergialonsoalpha)\
**Post date:** [December 4, 2019, 8:28am UTC](https://travis-ci.community/t/import-different-files-into-different-jobs/6292/1 "2019-12-04T08:28:33Z")

</div>

Hello,

I would like to know if there is a way to import travis configuration files to different job stages.

I mean, imagine I have a repo with the configuration\_a.yml and another file with the configuration\_b.yml

Would it be possible to generate a travis.yml file with this form:

```
jobs:
    include:
        - name: A
          import:
              - source: path/to/configuration_a.yml@main
        - name: B
          import:
              - source: path/to/configuration_b.yml@main
```

I do not see in the documentation if this is valid or not as it not appear where the imports should be placed.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![travi](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/travi/32/4477_2.png) [@travi](https://travis-ci.community/u/travi)\
**Post date:** [December 15, 2019, 7:55pm UTC](https://travis-ci.community/t/import-different-files-into-different-jobs/6292/2 "2019-12-15T19:55:39Z")

</div>

I’m curious about the same thing. I’ve been using imports successfully in a number of projects, but have not found success with projects that define stages. I tried importing into a single stage, expecting that it would just work, but it does not get processed: [https://travis-ci.org/travi-org/matt.travi.org-components/builds/625381469/config](https://travis-ci.org/travi-org/matt.travi.org-components/builds/625381469/config)

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 15, 2019, 10:18pm UTC](https://travis-ci.community/t/import-different-files-into-different-jobs/6292/3 "2019-12-15T22:18:11Z")

</div>

[I’ve tested](https://travis-ci.org/native-api/test_travis/builds/625414265) that [`travis-yml`](https://github.com/travis-ci/travis-yml) (the app that implements build config validation and importing) crashes when you try to import at job level.

So currently, you can only import at global level.

And since jobs are a list, with [existing merge modes](https://docs.travis-ci.com/user/build-config-imports/#merge-modes), it’s impossible to change its entries, only prepend/append new ones or overwrite the existing list a a whole.

---

<div class="post-metadata">

**Author:** ![travi](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/travi/32/4477_2.png) [@travi](https://travis-ci.community/u/travi)\
**Post date:** [December 16, 2019, 4:44am UTC](https://travis-ci.community/t/import-different-files-into-different-jobs/6292/4 "2019-12-16T04:44:12Z")

</div>

> [@native-api](#):
>
> And since jobs are a list, with [existing merge modes](https://docs.travis-ci.com/user/build-config-imports/#merge-modes), it’s impossible to change its entries, only prepend/append new ones or overwrite the existing list a a whole.

yep, this is the real kicker. while it would be inconvenient to have separate shareable configs for builds with stages vs not, but even that isn’t possible.
