为什么Travis CI会破坏我脚本的进程?

时间:2014-12-09 11:16:36

标签: android yaml travis-ci

我添加了以下配置以在Travis CI Android项目上运行Fahrplan

language: android

android:
  components:

  # All the build system components should be at the latest version
  # - tools
  # - platform-tools
  - build-tools-21.1.1
  - android-19
  - sysimg-19
  - add-on
  - extra

  # The libraries we can't get from Maven Central or similar
  - extra-android-support
  - extra-android-m2repository

jdk:
  - oraclejdk7
  - openjdk7

notifications:
  email: true

before_script:
  - chmod +x gradlew
  - mv app/gradle.properties.example app/gradle.properties

script:
  - ./gradlew clean assembleDebug

由于某种原因,这个过程会一次又一次被杀死,如build history所示。它停在不同的位置。错误消息不具备信息性:

  

命令" ./ gradlew clean assembleDebug"退出137

1 个答案:

答案 0 :(得分:2)

只检查gradle版本,你可以在运行脚本之前强制下载(帮助我避免错误137)但现在我使用wrapper,所以gradle-wrapper.jar会更新。

如果它不起作用,您可以先尝试下载Android依赖项,然后再运行脚本并清理。

我认为默认情况下它们不会组合,但我想重写安装阶段以确定。

在我的情况下,错误137是由于并发(构建/模拟器)和Travis-ci杀死的作业。我解决了这种类型的变化,我不太了解它。

language: android

jdk:
  - oraclejdk7
  - openjdk7

android:
  components:

    # All the build system components should be at the latest version
    - tools
    - platform-tools
    - build-tools-21.1.1
    - android-19

    # The libraries we can't get from Maven Central or similar
    - extra-android-support
    - extra-android-m2repository


notifications:
  email: true

before_install:
  # Disable services enabled by default
  # http://docs.travis-ci.com/user/database-setup/#MySQL
  - sudo /etc/init.d/mysql stop
  - sudo /etc/init.d/postgresql stop
  # The following did not work reliable
  # - sudo service mysql stop
  # - sudo service postgresql stop

install:
  # Ensure Gradle wrapper is executable, download wrapper and show version
  - chmod +x ./gradlew; ls -l gradlew; ./gradlew wrapper -v
  # Download and show android dependencies
  # - ./gradlew androidDependencies

before_script:        
  # Ensure signing configuration is present
  - mv app/gradle.properties.example app/gradle.properties

script:
  - ./gradlew clean assembleDebug