This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| general: | |
| branches: | |
| only: | |
| - master | |
| machine: | |
| java: | |
| version: openjdk7 | |
| environment: | |
| ANDROID_HOME: /usr/local/android-sdk-linux | |
| dependencies: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'aws-sdk' | |
| devicefarm = Aws::DeviceFarm::Client.new( | |
| region: 'us-west-2', | |
| credentials: Aws::Credentials.new("YOUR_ACCESS_KEY_ID", "YOUR_SECRET_ACCESS_KEY"), | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resp = devicefarm.list_device_pools({ | |
| arn: "プロジェクトのARN" | |
| }) | |
| # DevicePoolのARN(後ほど使用) | |
| # Defaultを使用するのでdevice_pools[0]を使用 | |
| device_pool_arn = resp.device_pools[0].arn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resp = devicefarm.create_upload({ | |
| project_arn: "プロジェクトのARN", | |
| name: "app.apk", | |
| type: "ANDROID_APP", | |
| content_type: "application/octet-stream" | |
| }) | |
| # Pre-Signed URLの取得 | |
| pre_signed_url = resp.upload.url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| general: | |
| branches: | |
| only: | |
| - master | |
| machine: | |
| java: | |
| version: openjdk7 | |
| ruby: | |
| version: 2.2.0 | |
| environment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ./gradlew assembleDebug | |
| zip -r features.zip features | |
| ruby scripts/devicefarm.rb |
OlderNewer