Merge pull request #141 from resin-io/124-add-appid-env-var

Add RESIN_APP_ID variable
This commit is contained in:
Pablo Carranza Vélez 2016-05-10 12:50:22 -03:00
commit 8145f5632d
3 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,4 @@
* Add RESIN_APP_ID variable [Pablo]
* Increase delta request timeout to 15 minutes [Pablo]
# v1.8.0

View File

@ -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) ->

View File

@ -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