我无法在 travis 中找到我的存储库(已克隆)的路径。当我执行 ls 时,没有输出。我已经尝试过 ls ~/username/repo
和 ls ~/repo
但得到没有这样的文件或目录
一些背景:我正在将我的 Android 应用程序与 travis-ci 集成。我想在 travis 中构建之前创建一个新的 .java 文件。由于此文件是私有(private)的并添加到 .gitignore
并且仅在构建计算机上。我打算使用加密环境变量功能向该文件添加内容。
任何自定义命令都不显示输出。甚至没有回声
。有一个环境变量 $TRAVIS_BUILD_DIR 但不知道如何使用它
最佳答案
我猜这是一个语法问题,请确保您使用 it像here ,它正常工作:
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 中的以下行链接到此 build和 travis.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/