added resin-supervisor version as a field of config object. added some notes on posting version using resinAPI

This commit is contained in:
Vasilis Souleles 2014-04-29 14:04:49 +03:00 committed by Pablo Carranza Vélez
parent 5e620cbf03
commit 1c3e173bd3
2 changed files with 12 additions and 1 deletions

View File

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

View File

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