From 11a88820e76d520bab080a934ad9178e05a871e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Thu, 27 Apr 2017 19:43:32 +0100 Subject: [PATCH] support ENV names in credentials json --- cloudapi-graphql/src/credentials.js | 28 ++++++++++++++++++++++++---- cloudapi-graphql/yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/cloudapi-graphql/src/credentials.js b/cloudapi-graphql/src/credentials.js index 2d2c3729..9c645329 100644 --- a/cloudapi-graphql/src/credentials.js +++ b/cloudapi-graphql/src/credentials.js @@ -20,8 +20,28 @@ const json = (() => { })(); module.exports = { - url: process.env.SDC_URL || json.url || '', - account: process.env.SDC_ACCOUNT || json.account || '', - user: process.env.SDC_USER || json.user || '', - keyId: process.env.SDC_KEY_ID || json.keyId || '' + url: ( + process.env.SDC_URL || + json.SDC_URL || + json.url || + '' + ), + account: ( + process.env.SDC_ACCOUNT || + json.SDC_ACCOUNT || + json.account || + '' + ), + user: ( + process.env.SDC_USER || + json.SDC_USER || + json.user || + '' + ), + keyId: ( + process.env.SDC_KEY_ID || + json.SDC_KEY_ID || + json.keyId || + '' + ) }; diff --git a/cloudapi-graphql/yarn.lock b/cloudapi-graphql/yarn.lock index 774d2af2..c564b22f 100644 --- a/cloudapi-graphql/yarn.lock +++ b/cloudapi-graphql/yarn.lock @@ -1306,7 +1306,19 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint: +eslint-config-prettier@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" + dependencies: + get-stdin "^5.0.1" + +eslint-plugin-prettier@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.0.1.tgz#2ae1216cf053dd728360ca8560bf1aabc8af3fa9" + dependencies: + requireindex "~1.1.0" + +eslint@^3.19.0: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" dependencies: @@ -1346,18 +1358,6 @@ eslint: text-table "~0.2.0" user-home "^2.0.0" -eslint-config-prettier: - version "1.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" - dependencies: - get-stdin "^5.0.1" - -eslint-plugin-prettier: - version "2.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.0.1.tgz#2ae1216cf053dd728360ca8560bf1aabc8af3fa9" - dependencies: - requireindex "~1.1.0" - espower-location-detector@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/espower-location-detector/-/espower-location-detector-1.0.0.tgz#a17b7ecc59d30e179e2bef73fb4137704cb331b5" @@ -3152,7 +3152,7 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier: +prettier@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e" dependencies: