Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
fix(devserver): implement excludeEnv in dev server (closes #117)
Browse files Browse the repository at this point in the history
  • Loading branch information
lusentis committed Jun 25, 2017
1 parent 56156ca commit 3f07576
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/commands/proxy.js
Expand Up @@ -140,10 +140,13 @@ function apiCallback (res, runner, responseError, responseData) {
res.end(); res.end();
} }


function getEnvVariables (outputs) { function getEnvVariables (outputs, excludeEnv = []) {
const envVariables = outputs.map(output => { const envVariables = outputs.map(output => {
if (excludeEnv.includes(output.OutputKey)) {
return;
}
return `DAWSON_${output.OutputKey}=${output.OutputValue}`; return `DAWSON_${output.OutputKey}=${output.OutputValue}`;
}); }).filter(Boolean);
return envVariables; return envVariables;
} }


Expand All @@ -165,7 +168,7 @@ async function runDockerContainer (
log(` [STS] using cached credentials for Lambda '${runner.name}'`); log(` [STS] using cached credentials for Lambda '${runner.name}'`);
} }
const credentials = credentialsCache.get(runner); const credentials = credentialsCache.get(runner);
const envVariables = getEnvVariables(outputs); const envVariables = getEnvVariables(outputs, runner.api.excludeEnv);
try { try {
log(`\n======= Log Fragment Begin for «${runner.name.bold}» =======`.dim); log(`\n======= Log Fragment Begin for «${runner.name.bold}» =======`.dim);
const invokeResult = dockerLambda({ const invokeResult = dockerLambda({
Expand Down

0 comments on commit 3f07576

Please sign in to comment.