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

allow passing multiple environment configuration files #504

Merged
merged 2 commits into from
Nov 28, 2017

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Nov 28, 2017

  • the -e or --environment CLI flag can be repeated
    and it can be either an environment name or a path to a file
  • properly handle empty environment values

extracted from #496

@mikz mikz force-pushed the environment-configuration branch from 9483164 to f558ebe Compare November 28, 2017 12:02
@mikz mikz force-pushed the environment-configuration branch from f558ebe to 40dfaaa Compare November 28, 2017 12:29
@mikz mikz requested a review from davidor November 28, 2017 12:36
@mikz mikz force-pushed the environment-configuration branch 2 times, most recently from 11d3ae7 to 47a7976 Compare November 28, 2017 14:11
---
-- @field default_environment Default environment name.
-- @table self
_M.default_environment = 'production' -- default environment name
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: redundant comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like bad rebase, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!


local template = Template:new(context, dir, true)
local function apicast_root()
return resty_env.get('APICAST_DIR') or pl.path.abspath('.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be .value

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah didn't see that it's fixed in the second commit :)

mikz added 2 commits November 28, 2017 15:51
The `-e` or `--environment` flag can be either and environment name or
a path to a file. Plain names are resolved to the config directory in
APIcast source.
* .value returns nil when the value is empty string
* so it can be chain with `or` for a default value
@mikz mikz force-pushed the environment-configuration branch from 47a7976 to 20504a8 Compare November 28, 2017 14:52
@mikz mikz merged commit 17522a5 into master Nov 28, 2017
@mikz mikz deleted the environment-configuration branch November 28, 2017 15:07
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

Successfully merging this pull request may close these issues.

2 participants