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

support for cli.env #389

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"@adobe/aio-lib-core-config": "^2.0.0",
"@adobe/aio-lib-core-logging": "^1.1.0",
"@adobe/aio-lib-env": "^1.0.0",
"@adobe/aio-lib-ims": "^4.1.0",
"@adobe/aio-lib-runtime": "^1.3.0",
"@adobe/aio-lib-web": "^4.1.1",
Expand Down
9 changes: 8 additions & 1 deletion src/lib/config-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ const chalk = require('chalk')
const utils = require('./app-helper')
const aioConfig = require('@adobe/aio-lib-core-config')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:config-loader', { provider: 'debug' })
const {
getCliEnv, /* function */
STAGE_ENV /* string */
} = require('@adobe/aio-lib-env')

const env = getCliEnv()

// defaults
const {
defaultAppHostname,
defaultTvmUrl,
stageTvmUrl,
defaultOwApihost,
defaultHTMLCacheDuration,
defaultJSCacheDuration,
Expand Down Expand Up @@ -164,7 +171,7 @@ module.exports = () => {
config.ow.package = `${config.app.name}-${config.app.version}`
// S3 static files deployment config
config.s3.folder = config.ow.namespace // this becomes the root only /
config.s3.tvmUrl = userConfig.app.tvmurl || defaultTvmUrl
config.s3.tvmUrl = userConfig.app.tvmurl || ( env === STAGE_ENV ? stageTvmUrl : defaultTvmUrl )
// set hostname for backend actions && UI
config.app.defaultHostname = defaultAppHostname
config.app.hostname = userConfig.app.hostname || defaultAppHostname
Expand Down
1 change: 1 addition & 0 deletions src/lib/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ governing permissions and limitations under the License.
module.exports = {
defaultAppHostname: 'adobeio-static.net',
defaultTvmUrl: 'https://firefly-tvm.adobe.io',
stageTvmUrl: 'https://firefly-tvm-stage.adobe.io',
defaultOwApihost: 'https://adobeioruntime.net',
defaultHTMLCacheDuration: '60',
defaultJSCacheDuration: '604800',
Expand Down