Imported anchors not working

Hi, I have problem to make anchors working if config is imported.
If I import classic jobs, everything is working fine, but when I import just anchors instead, then aliases in project file are not working (run dummy job)
Is this functionality supported in Travis?

Example:
Private repo config base.yml:

version: ~> 1.0

_job_test: &_job_test
  name: "Test"
  stage: Test
  script: run_test.sh

Project config file:

version: ~> 1.0
import:
  - me/private-repo:base.yml

jobs: 
  include:
    - <<: *_job_test

Thanks for any hint!

This is not supported. Anchors and aliases are an internal detail in YAML 1.1 – when a YAML is parsed, all aliases are expanded using corresponding anchors and neither are present in the parse result.

Travis combines parse trees rather than raw text (since it needs to parse the file to find out whether it needs to import anything) so it cannot do anything about anchors at that point.

1 Like
Imprint