Anchor inside Anchor

Summary

I want to reuse/refer an 'anchor inside anchor' in my .gitlab-ci.yml -- but, it SKIPS execution of the referenced anchor.

Steps to reproduce

  1. .gitlab-ci.yml:
stages:
  - print_stuff

.anchor2: &anchor2 |
  echo "Step-2"

.anchor1: &anchor1 |
  echo "Step-1"
  :>> *anchor2
  echo "Step-3"

print_stuff:
  stage: print_stuff
  script:
    - *anchor1

2a. **Expected Output: **

  Step-1
  Step-2
  Step-3

2b. Actual Output:

  Step-1
  Step-3

What is the current bug behavior?

When anchors are referenced inside another anchor (like above), pipeline execution SKIPS it completely with no CI LINT errors reported.

What is the expected correct behavior?

I don't know what is expected, but what I want to achieve is.. to include Anchors within Anchors for reuse.

Relevant logs and/or screenshots

image

Results of GitLab environment info

Tested on Gitlab.com CE as well as GitLab EE 12.4.2

Edited Nov 12, 2019 by Ram Grandhi
Assignee Loading
Time tracking Loading