duanmajing9332 2016-12-15 13:26
浏览 112
已采纳

Travis-ci在使用go test时需要root特权,如何设置?

I have Go test file and it needs root privilege to run it (go test). How to set it in Travis ci?

Here is yml:

language: go
sudo: required
go:
   - tip
notifications:
  email:
     on_success: change
     on_failure: always

After git push, travis-ci build failing with default configure.

  • 写回答

2条回答 默认 最新

  • doujuan2688 2016-12-16 12:17
    关注

    In travis you can use sudo so if you want to run your tests with root permission, change the script section:

    script: sudo - E env "PATH=$PATH" go test ./...
    

    Or if you are using a Makefile:

    script: sudo - E env "PATH=$PATH" make
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?