Skip to content

Commit

Permalink
fix: pass Cloud API key through when provided via --key
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy committed Apr 1, 2024
1 parent 41f5def commit 0e0a3b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ async function tryRunCluster(scriptPath, options, artilleryReporter) {
context.dotenv = dotenv.parse(contents);
}

// Explicitly make ARTILLERY_CLOUD_API_KEY available to workers (if set)
// Explicitly make Artillery Cloud API key available to workers (if it's set)
// Relying on the fact that contents of context.dotenv gets passed onto workers
// for it
if (process.env.ARTILLERY_CLOUD_API_KEY) {
const cloudKey = options.key || process.env.ARTILLERY_CLOUD_API_KEY;
if (cloudKey) {
if (!context.dotenv) {
context.dotenv = {};
}
context.dotenv.ARTILLERY_CLOUD_API_KEY =
process.env.ARTILLERY_CLOUD_API_KEY;
context.dotenv.ARTILLERY_CLOUD_API_KEY = cloudKey;
}

if (options.bundle) {
Expand Down

0 comments on commit 0e0a3b5

Please sign in to comment.