Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alexa、APKを配布して

 Alexa、APKを配布して

Ryosuke Horie

February 22, 2018
Tweet

More Decks by Ryosuke Horie

Other Decks in Programming

Transcript

  1. © 2018 VASILY,Inc.
    "MFYBɺ"1,Λ഑෍ͯ͠
    2018/2/22 potatotips #48
    @Horie1024

    View full-size slide

  2. © 2018 VASILY,Inc.
    ࣗݾ঺հ
    w !)PSJF
    w 7"4*-: *OD
    w "OESPJEΤϯδχΞ
    w ϏʔϧɺࣗಈԽ޷͖

    View full-size slide

  3. © 2018 VASILY,Inc.
    ೥݄;0;0508/΍8&"3ΛӡӦ͢Δ
    ελʔττΡσΠάϧʔϓʹࢀը ࢠձࣾԽ

    View full-size slide

  4. © 2018 VASILY,Inc.
    ࠓ೔࿩͢͜ͱ
    w "1,Λ഑෍͢Δ"MFYB4LJMMʹ͍ͭͯ
    w "MFYB4LJMMͷઃఆ
    w "84-BNCEBͰͷ4LJMMΤϯυϙΠϯτͷ։ൃ
    w #JUSJTFͷઃఆ

    View full-size slide

  5. © 2018 VASILY,Inc.
    Ϟνϕʔγϣϯ
    w "1,ͷ഑෍ํ๏
    w खಈͰ"1,Λ4MBDL౳ʹΞοϓϩʔυͯ͠഑෍
    w $*ͰಛఆͷϒϥϯνʹϚʔδͰ഑෍
    w (SBEMFͷλεΫΛ࣮ߦͯ͠഑෍

    View full-size slide

  6. © 2018 VASILY,Inc.
    Ϟνϕʔγϣϯ
    w Ի੠Ͱ"1,Λ഑෍ग़དྷͨΒศརͰ͸ʁ

    View full-size slide

  7. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ

    View full-size slide

  8. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ
    ᶃ ᶄ ᶅ ᶆ

    View full-size slide

  9. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ
    ᶃ ᶄ ᶅ ᶆ
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ

    View full-size slide

  10. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ
    ᶃ ᶄ ᶅ ᶆ
    ᶄ-BNCEBͰ#JUSJTFͷϏϧυΛτϦΨʔ

    View full-size slide

  11. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ
    ᶃ ᶄ ᶅ ᶆ
    ᶅϏϧυ׬ྃޙ"1,ΛΞοϓϩʔυ

    View full-size slide

  12. © 2018 VASILY,Inc.
    "1,഑෍·ͰͷྲྀΕ
    ᶃ ᶄ ᶅ ᶆ
    ᶆ%FQMPZ(BUFͰ"1,Λ഑෍

    View full-size slide

  13. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    w ʮϏοτϥΠζεΩϧʯͱͯ͠"MFYB4LJMMΛ࡞੒
    w ʮ"MFYB ϏοτϥΠζͰ"1,Λ഑෍ͯ͠ʯͷܗͰ࢖͏

    View full-size slide

  14. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    w ʮϏοτϥΠζεΩϧʯͱͯ͠"MFYB4LJMMΛ࡞੒
    w ʮ"MFYB ϏοτϥΠζͰ"1,Λ഑෍ͯ͠ʯͷܗͰ࢖͏
    ݺͼग़໊͕͠ඞͣඞཁ

    View full-size slide

  15. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    ର࿩ϞσϧͰ-BNCEB΁ͷϦΫΤετʹඥ෇͚
    ग़య"MFYBεΩϧ։ൃτϨʔχϯάγϦʔζୈճର࿩Ϟσϧͱ"MFYB4%,

    View full-size slide

  16. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    ϦΫΤετΠϯςϯτ໊ εϩοτ໊ ࠓճະ࢖༻

    ग़య"MFYBεΩϧ։ൃτϨʔχϯάγϦʔζୈճର࿩Ϟσϧͱ"MFYB4%,

    View full-size slide

  17. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    w "1,Λ഑෍͢Δର࿩Ϟσϧ
    w ʮ"1,Λ഑෍ͯ͠ʯʮ"1,Λ഑෍ʯʮ"1,Λ഑ͬͯʯͰ
    %JTUSJCVUF"QLΠϯςϯτʹඥ෇͚

    View full-size slide

  18. © 2018 VASILY,Inc.
    ᶃ"MFYBͰͷԻ੠ೖྗͷड෇ͱॲཧ
    ᶃʮ"MFYB ϏοτϥΠζͰ"1,Λ഑෍ͯ͠ʯ
    ᶄର࿩ϞσϧͰ%JTUSJCVUF"QLΠϯςϯτͱඥ෇͚
    ᶅ%JTUSJCVUF"QLΠϯςϯτΛ-BNCEBΤϯυϙΠϯτʹϦΫΤετ
    ग़య"MFYBεΩϧ։ൃτϨʔχϯάγϦʔζୈճର࿩Ϟσϧͱ"MFYB4%,
    ᶃ ᶄ ᶅ

    View full-size slide

  19. © 2018 VASILY,Inc.
    ᶄ-BNCEBͰ#JUSJTFͷϏϧυΛτϦΨʔ
    w #VJME5SJHHFS"1*Λར༻
    w IUUQEFWDFOUFSCJUSJTFJPBQJCVJMEUSJHHFS

    View full-size slide

  20. © 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()
    }

    View full-size slide

  21. © 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()
    }

    View full-size slide

  22. © 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()
    }

    View full-size slide

  23. © 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()
    }
    "MFYB͔ΒϢʔβʔ΁ͷԠ౴

    View full-size slide

  24. © 2018 VASILY,Inc.
    ᶄ-BNCEBͰ#JUSJTFͷϏϧυΛτϦΨʔ

    View full-size slide

  25. © 2018 VASILY,Inc.
    ᶄ-BNCEBͰ#JUSJTFͷϏϧυΛτϦΨʔ

    View full-size slide

  26. © 2018 VASILY,Inc.
    ᶅϏϧυ׬ྃޙ"1,ΛΞοϓϩʔυ
    EFQMPZXPSLqPXʹ4DSJQUTUFQΛ௥Ճ

    View full-size slide

  27. © 2018 VASILY,Inc.
    ᶆ%FQMPZ(BUFͰ"1,Λ഑෍
    Ξοϓϩʔυ͞Εͨ

    View full-size slide

  28. © 2018 VASILY,Inc.
    σϞ

    View full-size slide

  29. © 2018 VASILY,Inc.
    ·ͱΊ
    w "1,Λ഑෍͢Δ"MFYB4LJMMΛ࡞Δࣄ͕Ͱ͖ͨ
    w "MFYB͸ʮ"1,Λ഑෍ͯ͠ʯͷΑ͏ͳχονͳݴ༿
    ΋ೝࣝͯ͘͠ΕΔ
    w "1,഑෍Ҏ֎΋৭ʑͱࢼ͍ͨ͠

    View full-size slide

  30. © 2018 VASILY,Inc.
    ࢀߟࢿྉ
    w "MFYBεΩϧ։ൃτϨʔχϯά
    w IUUQTEFWFMPQFSBNB[PODPNKBBMFYBTLJMMTLJUUSBJOJOHCVJMEJOHBTLJMM
    w -BNCEBαϯϓϧίʔυ
    w IUUQTHJUIVCDPNIPSJFBMFYB@BOESPJE@EJTUSJCVUF@BQL

    View full-size slide

  31. © 2018 VASILY,Inc.
    ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide