mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
added resin-supervisor version as a field of config object. added some notes on posting version using resinAPI
This commit is contained in:
parent
5e620cbf03
commit
1c3e173bd3
@ -100,11 +100,21 @@ exports.update = ->
|
||||
Promise.all([
|
||||
knex('config').select('value').where(key: 'apiKey')
|
||||
knex('config').select('value').where(key: 'uuid')
|
||||
knex('config').select('value').where(key: 'version')
|
||||
knex('app').select()
|
||||
])
|
||||
.then ([[apiKey], [uuid], apps]) ->
|
||||
.then ([[apiKey], [uuid], [version], apps]) ->
|
||||
apiKey = apiKey.value
|
||||
uuid = uuid.value
|
||||
version = uuid.value
|
||||
###
|
||||
# should I post 'resin-supervisor' version every 15-minutes?
|
||||
# with something like
|
||||
resinAPI.post(
|
||||
device:
|
||||
supervisor-version: version
|
||||
)
|
||||
###
|
||||
resinAPI.get(
|
||||
resource: 'application'
|
||||
options:
|
||||
|
@ -37,6 +37,7 @@ module.exports = (uuid, version) ->
|
||||
console.log('Posting to the API..')
|
||||
config.csr = keys.csr
|
||||
config.uuid = uuid
|
||||
config.version = version
|
||||
return request(
|
||||
method: 'POST'
|
||||
url: url.resolve(process.env.API_ENDPOINT, 'associate')
|
||||
|
Loading…
Reference in New Issue
Block a user