Questions tagged [yaml-anchors]

7 questions
2
votes
1 answer

gitlab yaml anchor reference in an if clause

Is it possible, or is there a way, to use a yaml anchor reference in a BASH if clause. If so, how? This is what I'm attempting so far. create-cluster: needs: - terra-bootstrap script: - export…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
1
vote
2 answers

YAML anchors and override

I have a workflow with the following templates: templates: - name: main dag: tasks: - name: task1 template: step1 - name: task2 template: step2 - name: step1 container: image:…
Marc
  • 588
  • 2
  • 15
0
votes
3 answers

How to prevent overwriting the whole environment field while using YAML anchors

I am writing my docker-compose.yml file and to avoid writing redundant lines especially for using different profiles for dev, uat, prod etc, I was using yaml anchors. Here is a sample for one of the adapters I used for uat and for…
0
votes
1 answer

Using pyyaml, how can I override an anchor in a YAML config and have the updated anchor be persisted throughout?

Here's an example of the file config.yml: key_setting: &key_setting True main_params: param_A: param_A_1: 1 param_A_2: 2 param_A_setting: *key_setting param_B: param_B_1: 3 param_B_2: 4 param_B_setting:…
nwly
  • 1,360
  • 4
  • 16
  • 30
0
votes
0 answers

Can a YAML anchor be defined elsewhere than its first usage?

I'm writing a fairly complex YAML document (such as for several Bitbucket Pipelines) and I have a section that is repeated in multiple places. I'd like to use a YAML anchor for modularity, that is, to ensure the section can be easily maintained…
benjimin
  • 4,043
  • 29
  • 48
0
votes
0 answers

How to pass the result of the previous GitLab jobs to following jobs?

I am new to gitlab ci. I have gitlab ci yml in which one command is used in 2 different jobs as below. jobA: script: - yarn test artifacts: when: always reports: coverage_report: coverage_format: cobertura path:…
Shanmukh
  • 181
  • 3
  • 17
0
votes
1 answer

Is it possible to achieve such a refactor in YAML

I'm working on a concourse pipeline and I need to duplicate a lot of code in my YAML so I'm trying to refactor it so it is easily maintainable and I don't end up with thousands of duplicates lines/blocks. I have achieve the following yaml file after…