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

Support for different configs per environment #10

Closed
jasonchester opened this issue Oct 16, 2018 · 4 comments
Closed

Support for different configs per environment #10

jasonchester opened this issue Oct 16, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@jasonchester
Copy link

Would like to pass different template variables per environment in to the scripts.

My use case is for a custom SEND_MAIL package.

v_email_server VARCHAR2(30) := '${config["version.number"]}';

@mickeypearce mickeypearce added the enhancement New feature or request label Oct 17, 2018
@mickeypearce
Copy link
Owner

mickeypearce commented Oct 17, 2018

Hey @jasonchester!

I could make oradewrc.json be the base configuration and then optional overload configurations for environments (oradewrc.test.json, oradewrc.uat.json).

We also need TEST: Package and UAT: Package command for running environemnt specific packaging command.

For example, we have:
oradewrc.json:

{
...
...
  "customField": "this is it."
}

and
oradewrc.test.json:

{
  "customField": "..no this."
}

Then when you use it in your code: '${config["customField"]}' and package it with TEST: Package command, it would replace it with "..no this." instead of "this is it.".

Another option would be to store everything in oradewrc.json and have env-prefixed variables.

For example:
oradewrc.json:

{
...
...
  "customField": "this is it.",
  "TEST:customField": "..no this."
}

Is this something similar to what you had in mind?

@jasonchester
Copy link
Author

Yes, this would be perfect. I like the file per environment approach as opposed to the prefixed variables because it is easier to work with.

  • Easier a source control versioning
  • Easier to compare environment settings with diff tooling
  • Similiar to how other systems have implemented env configs ie. dotnet core

As far as the new environment based packaging commands, i am wondering if it would be better if oradew implemented a Task Provider which could parse the dbconfig.json and generate task definitions for each one defined.

Thanks again.

@mickeypearce
Copy link
Owner

mickeypearce commented Oct 17, 2018

I was thinking about Task provider approach just recently...

One disadvantage would be that you can not dynamically bind extension commands to Command palette or UI, as far as I know, but you have to add them manually to extension's package.json file.

So dynamically loaded tasks with oradew task provider could not be executed as commands as it is done now but only as tasks.

mickeypearce added a commit that referenced this issue Oct 30, 2018
@mickeypearce
Copy link
Owner

Environment-specific file configs are now available. @jasonchester, you can try them out.

About implementing task provider for oradew commands, I suggest opening maybe a new issue for the request...

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

No branches or pull requests

2 participants