buildr - share profiles.yaml file across projects
-
26-05-2021 - |
Question
The profiles file is a YAML file called profiles.yaml that you place in the same directory as the Buildfile
I was wondering is it possible to share the same profiles file for more than one project, i.e. specifying a different location to where to find the profiles.yaml file as opposed to defaulting to the same directory as the build file?
Solution 2
The solution I ended up with was to load my own profiles.yaml file:
require 'yaml'
def profile
profiles = YAML.load_file('../../profiles.yaml')
profiles[ENV['BUILDR_ENV']] ||= {}
end
puts "env:" << profile['propname']
OTHER TIPS
I'm afraid I don't have a satisfactory answer.
You could use git-submodules, braid, svn externals (or a plain old symbolic link) to do the trick.
Looking at the code, we don't permit using a different path for the profiles file at this point.
If you would like this behavior to change, I would suggest you enter an enhancement request for Buildr and consider providing a patch.