Skip to content

Instantly share code, notes, and snippets.

View horie1024's full-sized avatar

Ryosuke Horie horie1024

  • ZOZO, Inc.
  • Japan
View GitHub Profile
module.exports = (robot) ->
robot.catchAll (msg) ->
matches = msg.message.text.match(/@vasilybot\s*(.*)/)
if matches == null or matches.length == 0
return
runArn = matches[1]
aws = require 'aws-sdk'
robot.catchAll (msg) ->
matches = msg.message.text.match(/@vasilybot\s*(.*)/)
if matches == null or matches.length == 0
return
runArn = matches[1]
aws = require 'aws-sdk'
module.exports = (robot) ->
robot.catchAll (msg) ->
matches = msg.message.text.match(/@vasilybot\s*(.*)/)
if matches == null or matches.length == 0
return
uri = URI.parse("SLACK_WEB_HOOK_URL")
data = {"text" => "@vasilybot " + schedule_run_resp.run.arn}
Net::HTTP.post_form(uri, {"payload" => data.to_json})
#!/bin/sh
./gradlew assembleDebug
zip -r features.zip features
ruby scripts/devicefarm.rb
general:
branches:
only:
- master
machine:
java:
version: openjdk7
ruby:
version: 2.2.0
environment:
10.times do
resp_apk = devicefarm.get_upload({
arn: apk_arn
})
resp_test_package = devicefarm.get_upload({
arn: calabash_package_arn
})
if resp_apk.upload.status == "SUCCEEDED" &&
devicefarm.schedule_run({
project_arn: "プロジェクトのARN",
app_arn: apk_arn,
device_pool_arn: device_pool_arn,
test: {
type: 'CALABASH',
test_package_arn: calabash_package_arn
}
})
resp = devicefarm.create_upload({
project_arn: "プロジェクトのARN",
name: "features.zip",
type: "CALABASH_TEST_PACKAGE",
content_type: "application/octet-stream"
})
# Pre-Signed URLの取得
pre_signed_url = resp.upload.url
url = URI.parse(pre_signed_url)
apk = File.open("YOUR_APK_PATH", "rb").read
Net::HTTP.start(url.host) do |http|
http.send_request("PUT", url.request_uri, apk, {"content-type" => "application/octet-stream"})
end