diff --git a/CHANGELOG.md b/CHANGELOG.md index c4fab08a..1b2a5cca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Add RESIN_APP_ID variable [Pablo] * Increase delta request timeout to 15 minutes [Pablo] # v1.8.0 diff --git a/src/application.coffee b/src/application.coffee index 9d5be093..b06b687f 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -468,7 +468,7 @@ getEnvAndFormatRemoteApps = (deviceId, remoteApps, uuid, apiKey) -> getEnvironment(app.id, deviceId, apiKey) .then (environment) -> app.environment_variable = environment - utils.extendEnvVars(app.environment_variable, uuid) + utils.extendEnvVars(app.environment_variable, uuid, app.id) .then (fullEnv) -> env = _.omit(fullEnv, _.keys(specialActionEnvVars)) env = _.omit env, (v, k) -> diff --git a/src/utils.coffee b/src/utils.coffee index d8703fac..4e759477 100644 --- a/src/utils.coffee +++ b/src/utils.coffee @@ -130,9 +130,10 @@ exports.getConfig = getConfig = (key) -> .then ([ conf ]) -> return conf?.value -exports.extendEnvVars = (env, uuid) -> +exports.extendEnvVars = (env, uuid, appId) -> host = '127.0.0.1' newEnv = + RESIN_APP_ID: appId.toString() RESIN_DEVICE_UUID: uuid RESIN_SUPERVISOR_ADDRESS: "http://#{host}:#{config.listenPort}" RESIN_SUPERVISOR_HOST: host