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

Config folder #2

Closed
wants to merge 5 commits into from
Closed

Config folder #2

wants to merge 5 commits into from

Conversation

mollases
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jun 14, 2017

Coverage Status

Coverage increased (+5.9%) to 93.258% when pulling 41e1ed5 on config-folder into ec2fc09 on master.

README.md Outdated
#### Config folder
If you want to separate your environments by file
* create a `config` folder in the root directory of your project
* move the existing `config.yml` file to `config/defaults.config.yml`
Copy link
Contributor

Choose a reason for hiding this comment

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

i would change config/defaults.config.yml to config/defaults.yml

README.md Outdated
If you want to separate your environments by file
* create a `config` folder in the root directory of your project
* move the existing `config.yml` file to `config/defaults.config.yml`
* create custom environments via `config/[env].config.yml`
Copy link
Contributor

Choose a reason for hiding this comment

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

likewise I would change config/[env].config.yml to config/[env].yml

index.js Outdated
return _.merge({},
loadConfig('config/defaults.config.yml'),
loadConfig('config/' + getEnvId() + '.config.yml')
)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be lined up with the r

index.js Outdated
)
}

function loadConfig (file) {
Copy link
Contributor

Choose a reason for hiding this comment

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

i would change this to loadConfigFile

index.js Outdated
let environments = config.environments || {}
let envId = getEnvId()
let ENVID = envId ? envId.toUpperCase() : undefined
let environmentType = (_.includes(environments.static, envId) ? envId : undefined) || environments.default

function loadConfig () {
function determineConfigMode () {
Copy link
Contributor

Choose a reason for hiding this comment

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

i would change this to loadConfig since it is actually loading the full config. see comment below for loadConfigFile

index.js Outdated
)(args) ||
process.env.ENVIRONMENT_ID ||
getEnvIdFromBranch()
var templ = singleFileMode ? useStaticFromConfig() : useFileList()
Copy link
Contributor

Choose a reason for hiding this comment

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

this misses the point of static. static is meant to specify which environments you can deploy specifically using --prod --staging, etc. there are cases where you want to do this without having a specific environment section in your config or a separate file. the config.environments.static should be used whether it is single file or multi file. i would revert the code for getEnvId()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so my intention for the config folder was to act as the static environment list, but all good. I'll write up some more tests to make sure that the env's still behave the same way

@mollases
Copy link
Contributor Author

Closing, working on a better implementation

@mollases mollases closed this Jun 16, 2017
@mollases mollases deleted the config-folder branch June 19, 2017 23:42
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.

None yet

3 participants