donglin6313 2015-05-08 23:12
浏览 13
已采纳

为什么我的构建会在我明显看到它存在时抱怨环境变量丢失了?

I have a travis-ci build setup to build a PHP project. When the build runs, it fails during the test run stating:

Environment var: GettyImagesApi_ApiKey was not found in the environment (Exception)

This happened previously and I deleted the environment variable, re-created it, then re-ran the build and it stopped throwing an exception. Now it has started throwing the exception again and deleting and re-creating the environment variable is not helping.

By the way, this environment variable is set in the GUI, not in the .travis.yml file.

After doing a few more builds, I've noticed that sometimes I see this in the build log:

Setting environment variables from repository settings  
$ export GettyImagesApi_ApiSecret=[secure]  
$ export GettyImagesApi_UserName=[secure]  
$ export GettyImagesApi_UserPassword=[secure]  
$ export GettyImagesApi_ApiKey=[secure]  

and of course, the environment variables are available. Sometimes I don't see those lines and then the environment variables don't exist.

What would cause the build to skip exporting the environment variables?

  • 写回答

1条回答 默认 最新

  • dongsetan3216 2015-05-11 21:38
    关注

    I figured this out. Reading is always good:

    From the documentation

    "...we do not expose these values to untrusted builds, triggered by pull requests from another repository."

    The builds that were failing were pull requests. Builds from the main repo get the proper environment variables.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用