mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-18 17:00:25 +00:00
Rename the images more appropriately.
This commit is contained in:
parent
599f8ae503
commit
f78786b065
@ -11,15 +11,15 @@ docker = Promise.promisifyAll(new Docker(socketPath: DOCKER_SOCKET))
|
|||||||
Promise.promisifyAll(docker.getImage().__proto__)
|
Promise.promisifyAll(docker.getImage().__proto__)
|
||||||
Promise.promisifyAll(docker.getContainer().__proto__)
|
Promise.promisifyAll(docker.getContainer().__proto__)
|
||||||
|
|
||||||
supervisorTag = 'resin/rpi-supervisor'
|
localImage = 'resin/rpi-supervisor'
|
||||||
updateImage = config.REGISTRY_ENDPOINT + '/' + supervisorTag
|
remoteImage = config.REGISTRY_ENDPOINT + '/' + localImage
|
||||||
|
|
||||||
supervisorUpdating = Promise.resolve()
|
supervisorUpdating = Promise.resolve()
|
||||||
exports.update = ->
|
exports.update = ->
|
||||||
# Make sure only one attempt to update the full supervisor is running at a time, ignoring any errors from previous update attempts
|
# Make sure only one attempt to update the full supervisor is running at a time, ignoring any errors from previous update attempts
|
||||||
supervisorUpdating = supervisorUpdating.catch(->).then ->
|
supervisorUpdating = supervisorUpdating.catch(->).then ->
|
||||||
console.log('Fetching updated supervisor:', updateImage)
|
console.log('Fetching updated supervisor:', remoteImage)
|
||||||
docker.createImageAsync(fromImage: updateImage)
|
docker.createImageAsync(fromImage: remoteImage)
|
||||||
.then (stream) ->
|
.then (stream) ->
|
||||||
return new Promise (resolve, reject) ->
|
return new Promise (resolve, reject) ->
|
||||||
if stream.headers['content-type'] is 'application/json'
|
if stream.headers['content-type'] is 'application/json'
|
||||||
@ -30,15 +30,15 @@ exports.update = ->
|
|||||||
|
|
||||||
stream.on('end', resolve)
|
stream.on('end', resolve)
|
||||||
.then ->
|
.then ->
|
||||||
console.log('Tagging updated supervisor:', updateImage)
|
console.log('Tagging updated supervisor:', remoteImage)
|
||||||
docker.getImage(updateImage).tagAsync(
|
docker.getImage(remoteImage).tagAsync(
|
||||||
repo: supervisorTag
|
repo: localImage
|
||||||
force: true
|
force: true
|
||||||
)
|
)
|
||||||
.then ->
|
.then ->
|
||||||
console.log('Creating updated supervisor container:', supervisorTag)
|
console.log('Creating updated supervisor container:', localImage)
|
||||||
docker.createContainerAsync(
|
docker.createContainerAsync(
|
||||||
Image: supervisorTag
|
Image: localImage
|
||||||
Cmd: ['/start']
|
Cmd: ['/start']
|
||||||
Volumes:
|
Volumes:
|
||||||
'/boot/config.json': '/mnt/mmcblk0p1/config.json'
|
'/boot/config.json': '/mnt/mmcblk0p1/config.json'
|
||||||
@ -50,7 +50,7 @@ exports.update = ->
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
.then (container) ->
|
.then (container) ->
|
||||||
console.log('Starting updated supervisor container:', supervisorTag)
|
console.log('Starting updated supervisor container:', localImage)
|
||||||
container.startAsync(
|
container.startAsync(
|
||||||
Privileged: true
|
Privileged: true
|
||||||
Binds: [
|
Binds: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user