Slide 20
Slide 20 text
© 2018 VASILY,Inc.
ᶄ-BNCEBͰ#JUSJTFͷϏϧυΛτϦΨʔ
export const bitriseSkill = (event: Alexa.RequestBody, context: Alexa.Context) => {
const alexa = Alexa.handler(event, context)
alexa.registerHandlers({
'DistributeApk': function () {
request({
method:'post',
url: `https://www.bitrise.io/app/${appSlug}/build/start.json`,
headers: {"Content-Type": "application/json; charset=utf-8"},
json: true,
body: {
'hook_info': {
'type': 'bitrise',
'api_token': apiToken
},
'build_params': {
'branch': 'master',
'workflow_id': 'deploy',
'commit_message': 'triggered from alexa'
}
}
}, (error, response, body) => {
let workflowId = body.triggered_workflow
this.emit(':tell', `ϫʔΫϑϩʔΞΠσΟʔ${workflowId}ͰɺϏοτϥΠζͰͷϏϧυΛ։࢝͠·ͨ͠ɻϏϧυ͕ྃޙɺΤʔϐʔέʔΛ͠·͢ɻ`)
})
}
})
alexa.execute()
}