Skip to content

Config file driven by environment variable #489

@cmaahs

Description

@cmaahs

This may simply be unique to my use case, though I thought I'd share in case it someone else might find it useful.

I work on multiple Jira systems. And use the go-jira tool extensively. My initial method was to just copy a <system>-config named file to config.yml in order to effectively switch between the Jira systems / boards.

This of course switches every session at once, which is undesirable. So I added code to look at GOJIRA_CONFIG environment variable and use that to prefix the config.yaml -> ${GOJIRA_CONFIG}-config.yml. Of course one could instead use a full path to the config file.

Clearly easy enough to implement, here is the diff on my fork: https://github.com/cmaahs/jira/compare/master...cmaahs:jira:maahs?expand=1

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