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

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

Merged
merged 2 commits into from
May 12, 2016

Conversation

aemmons
Copy link
Contributor

@aemmons aemmons commented Apr 27, 2016

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
Collaborator

@amaemmons thanks! +1

@DeviaVir DeviaVir merged commit 12c7eb1 into motdotla:master May 12, 2016
@DeviaVir
Copy link
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