douyi6168 2016-01-11 21:27
浏览 203
已采纳

使用Jenkins进行应用CI

I try to setup CI for Go app and Jenkins. Jenkins Go Plugin has been installed, it gets correct version of Go(currently it's 1.5.2).

Currently I have next:

  1. Test repository with simple app https://github.com/Agnikay/Test-Go-Jenkins

  2. Jenkins with installed Go Plugin(on VPS, Ubuntu 14.04, x86)

  3. For build in Jenkins added as build step next:

    cd src/main go build main.go

As result in artifacts existing 2 files - main.go(sources) and main (executable) for linux x86. If i use as build command go build main.go -o server error received: "named files must be .go files". So, my questions are

  1. If my app will contain much more code file, packages etc. should i still build it as go build main.go?
  2. How correctly give name for go build output file to add it to the artifacts?
  3. Should i use some kind of make file/script etc to collect dependencies on build machine? What is best practice here?
  • 写回答

1条回答 默认 最新

  • dongzg2006 2019-07-29 20:26
    关注

    named files must be .go files

    You need to put the .go file last on the command-line.

    go build -o server main.go
    

    See:

    Related:

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

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划