Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

support file inclusion in env and service attributes #67

Merged
merged 2 commits into from
Dec 13, 2016

Conversation

prfalken
Copy link
Contributor

@prfalken prfalken commented Nov 21, 2016

fixes #52
fixes #60

inclusion should be in the form of an "include" key containing a list of includes :

include:
  - env:prod-dc1:some.config
  - env::some.config.from.same.environment
  - some.global.config

when omitting the env field like in env::some.config the current environment is used

  • env:prod-dc1:some.config leads to /env/prod-dc1/common-attributes/some/config.yml
  • env::some.config.from.same.environment leads to common-attributes/some/same/environment.yml of the same environment
  • some.global.config leads to /common-attributes/some/global/config.yml

)
files = append(files, includeFile)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else ?

fields := strings.Split(inclusion, ":")
includeFile := strings.Replace(fields[2], ".", "/", -1) + ".yml"
if fields[1] == "" {
logs.WithField("include", inclusion).Fatal("Trying to include environment attributes from itself")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use fatal somewhere else than main function or argument parser

@n0rad n0rad merged commit 78752a5 into blablacar:master Dec 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cross environnents attributes Imports Attributes
2 participants