Skip to content

Adding environment to env vars added in _setEnvironmentVars(). - #95

Merged
DeviaVir merged 2 commits into
motdotla:masterfrom
aemmons:environ_in_env
May 12, 2016
Merged

Adding environment to env vars added in _setEnvironmentVars().#95
DeviaVir merged 2 commits into
motdotla:masterfrom
aemmons:environ_in_env

Conversation

@aemmons

@aemmons aemmons commented Apr 27, 2016

Copy link
Copy Markdown
Contributor

This update includes the 'environment' env variable with the deploy.env vars at the top of the handler when using --configFile flag with package or deploy command.

This allows for logic within the lambda function similar to:

if(process.env.environment === 'production'){
    // Production logic.
}else{
    // Non-production logic
}

or

var settings = {
    production: { /* Production settings */ },
    staging: { /* Staging settings */},
    dev: { /* Dev settings */ }
}
var config = settings[process.env.environment || 'dev' ];

@DeviaVir

Copy link
Copy Markdown
Collaborator

@amaemmons thanks! +1

@DeviaVir
DeviaVir merged commit 12c7eb1 into motdotla:master May 12, 2016
@DeviaVir

Copy link
Copy Markdown
Collaborator

This has been added to 0.8.2 which has been released on NPM as the latest version, thanks again for your contribution! 🎊

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.

3 participants