简体   繁体   English

Gitlab CI 跑步者

[英]Gitlab CI runner

I have used this tutorial for setting up a gitlab ci runner.我已经使用本教程来设置 gitlab ci runner。 The runner seems to be working.跑步者似乎在工作。 Now I want to build a C++ project with it.现在我想用它构建一个 C++ 项目。

How can I do this?我怎样才能做到这一点?

Assuming you have a shell runner, you can create a job and list the command line commands you want to have executed.假设您有一个 shell 运行程序,您可以创建一个作业并列出您想要执行的命令行命令。 Create a file .gitlab-ci.yml in the root directory of your git repository:在你的 git 仓库的根目录中创建一个.gitlab-ci.yml文件:

my_project:
  script:
    - cd apps/my_project
    - mkdir build
    - cd build
    - cmake ..
    - make

When you push, and ci runners are enabled on gitlab, it will automatically execute all these shell commands for each push.当您推送时,并且在 gitlab 上启用了 ci runners,它会为每次推送自动执行所有这些 shell 命令。

More information about the things you can put into .gitlab-ci.yml can be found here .可以在此处找到有关可以放入.gitlab-ci.yml内容的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM