Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using lists in values file causes an error #21

Open
gadiener opened this issue Jan 21, 2021 · 2 comments
Open

Using lists in values file causes an error #21

gadiener opened this issue Jan 21, 2021 · 2 comments

Comments

@gadiener
Copy link
Member

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: []
@lilach
Copy link

lilach commented Jan 3, 2022

Any news on this? It would be very helpful for me

@szaffarano
Copy link

I found a workaround to make it works:
main.ymlv

- project: test
  repo: test
  admin_groups: "[group1, group2]"

main.ymlt

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

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

Hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants