Skip to content

Using lists in values file causes an error #21

@gadiener

Description

@gadiener

Current Behavior

I get an error using a list in the .ymlv file. The error is as follows:

13:41:36.862 [info] Reading config file "/bitbucket-config/bitbucket.config".
escript: exception error: no function clause matching bec_yml:to_mustache([<<"admin_group">>]) (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bec_yml.erl, line 33)
  in function  bitbucket_repo_config:'-read_vars/1-fun-1-'/3 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bitbucket_repo_config.erl, line 53)
  in call from maps:fold_1/3 (maps.erl, line 257)
  in call from lists:map/2 (lists.erl, line 1239)
  in call from bitbucket_repo_config:verify/2 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bitbucket_repo_config.erl, line 25)
  in call from bec:do_main/1 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bec.erl, line 40)

Steps to Reproduce

  1. Create the config.ymlt and config.ymlv:

config.ymlt

project: {{ project }}
repo: {{ repo }}

users:
  admin: []
  write: []
  read: []
groups:
  admin: {{ admin_groups }}
  write: []
  read: []

config.ymlv:

- project: test
  repo: test
  admin_groups:
    - admin_group
  1. Run bec.

Context

Tested on the docker with the current master state.

docker run --rm -v ${PWD}:/bitbucket-config -t ${BEC_DOCKER_IMAGE} -vv -c /bitbucket-config/bitbucket.config -r /bitbucket-config/config.ymlt

Tested with mustache directly I get the expected output:

project: test
repo: test

users:
  admin: []
  write: []
  read: []
groups:
  admin: [&quot;admin_group&quot;]
  write: []
  read: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions