android - travis 中存储库的路径

标签 android travis-ci

我无法在 travis 中找到我的存储库(已克隆)的路径。当我执行 ls 时,没有输出。我已经尝试过 ls ~/username/repols ~/repo 但得到没有这样的文件或目录

一些背景:我正在将我的 Android 应用程序与 travis-ci 集成。我想在 travis 中构建之前创建一个新的 .java 文件。由于此文件是私有(private)的并添加到 .gitignore 并且仅在构建计算机上。我打算使用加密环境变量功能向该文件添加内容。

任何自定义命令都不显示输出。甚至没有回声。有一个环境变量 $TRAVIS_BUILD_DIR 但不知道如何使用它

最佳答案

我猜这是一个语法问题,请确保您使用 ithere ,它正常工作:

TRAVIS_BUILD_DIR: The absolute path to the directory where the repository being built has been copied on the worker.

- ${​​TRAVIS_BUILD_DIR}/gradle/caches/

- ls ${TRAVIS_BUILD_DIR}/gradle/caches/

另请检查 here 中的以下行链接到此 buildtravis.yml (其工作原理如图 here ):

env:
  global:
    - ANDROID_HOME=${TRAVIS_BUILD_DIR}/android-sdk
    - PATH=${ANDROID_HOME}/:${ANDROID_HOME}/tools/:${ANDROID_HOME}/platform-tools/:${PATH}

before_install:
  - cp -R /usr/local/android-sdk-23.0.2 ./android-sdk

... You could create a ${TRAVIS_BUILD_DIR}/.travis-ci folder and save there all the stuff so we can custom it.

  # Comment out the lines below to show system image properties
  - 'echo ${ANDROID_HOME}/system-images/${AVD_TARGET_DIR}/${AVD_TAG}/${AVD_ABI}'
  - 'ls ${ANDROID_HOME}/system-images/${AVD_TARGET_DIR}/${AVD_TAG}/${AVD_ABI} -al || true'
  - 'cat ${ANDROID_HOME}/system-images/${AVD_TARGET_DIR}/${AVD_TAG}/${AVD_ABI}/build.prop || true'

  - echo 'DEFAULT SCRIPTS'
  # Comment out the lines below to check default android scripts and PATH
  - echo "$PATH"
  - ls /usr/local/bin -Al
  - cat /usr/local/bin/android-accept-licenses
  - cat /usr/local/bin/android-update-sdk
  - cat /usr/local/bin/android-wait-for-emulator

关于android - travis 中存储库的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42612221/

相关文章:

ios - xcodebuild 在 Travis CI 中运行时卡在代码设计步骤

node.js - 使用本地 deps 运行 npm 脚本

android - 如何在运行时android期间获取堆栈跟踪

java - 自动图像从纵向旋转为横向

android - 有没有办法在 Xamarin Native android 中禁用 Android 上的选项卡式页面之间的滑动?

c++ - Travis CI 上 Boost 中对 `std::__cxx11::basic_string 的 undefined reference

gradle - 从Travis CI推送到主分支

travis-ci - 子目录中的 Travis CI

android - 从 toast 消息中删除淡入淡出动画

android:默认语言设置为亚洲