mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-18 17:00:25 +00:00
Add all expected env vars to the new supervisor container.
This commit is contained in:
parent
f78786b065
commit
959da25c9f
@ -4,5 +4,14 @@ module.exports = config =
|
||||
pubnub:
|
||||
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY
|
||||
publish_key: process.env.PUBNUB_PUBLISH_KEY
|
||||
expectedEnvVars: [
|
||||
'API_ENDPOINT'
|
||||
'REGISTRY_ENDPOINT'
|
||||
'PUBNUB_SUBSCRIBE_KEY'
|
||||
'PUBNUB_PUBLISH_KEY'
|
||||
]
|
||||
|
||||
# A check that all variables are set and notify the user if not
|
||||
for envVar in config.expectedEnvVars when !process.env[envVar]?
|
||||
console.error('Cannot find env var:', envVar)
|
||||
|
||||
# TODO add a check that all variables are set and notify the user if not
|
||||
|
@ -12,7 +12,7 @@ Promise.promisifyAll(docker.getImage().__proto__)
|
||||
Promise.promisifyAll(docker.getContainer().__proto__)
|
||||
|
||||
localImage = 'resin/rpi-supervisor'
|
||||
remoteImage = config.REGISTRY_ENDPOINT + '/' + localImage
|
||||
remoteImage = config.registryEndpoint + '/' + localImage
|
||||
|
||||
supervisorUpdating = Promise.resolve()
|
||||
exports.update = ->
|
||||
@ -44,10 +44,9 @@ exports.update = ->
|
||||
'/boot/config.json': '/mnt/mmcblk0p1/config.json'
|
||||
'/data': '/var/lib/docker/data'
|
||||
'/run/docker.sock': '/var/run/docker.sock'
|
||||
Env: [
|
||||
'API_ENDPOINT=' + config.API_ENDPOINT
|
||||
'REGISTRY_ENDPOINT=' + config.REGISTRY_ENDPOINT
|
||||
]
|
||||
Env:
|
||||
for envVar in config.expectedEnvVars
|
||||
envVar + '=' + process.env[envVar]
|
||||
)
|
||||
.then (container) ->
|
||||
console.log('Starting updated supervisor container:', localImage)
|
||||
|
Loading…
x
Reference in New Issue
Block a user