Skip to content
Snippets Groups Projects

sg: Allow overwriting of sub-attributes through deep merging

Created by: mrnugget

Given the following sg.config.yaml content:

commands:
  coolcommand:
    cmd: echo "this is the $COOL_ENV_1 and $COOL_ENV_2"
    install: echo "installing!"
    env:
      COOL_ENV_1: cool-env-1
      COOL_ENV_2: cool-env-2

And this in sg.config.overwrite.yaml:

commands:
  coolcommand:
    install: echo "new install command"
    env:
      COOL_ENV_2: overwritten-cool-env

then sg run coolcommand will print the following:

Installing coolcommand...
Successfully installed coolcommand
Running coolcommand...
[coolcommand] this is the cool-env-1 and overwritten-cool-env

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading