[英]how to use ros | cmake with gitlab-ci
我有一個簡單的項目,但我沒有使用 GitLab-ci 的經驗。 我使用 ROS 和 cmake 在本地機器(ubuntu18-04)上構建我的項目。 現在我想在 GitLab 上構建我的項目,但這對我來說看起來並不容易。
腳步:
1-) 從這里安裝二進制運行器
2-) 從這里為 Linux 注冊的跑步者 - 使用 docker 作為執行者(如 gitlabci;我沒有 docker 經驗) - 選擇 Z58E53D1324EEF6265FDB967B08ED9AADFZ:2.默認圖像
3-) 現在'我可以在 Settings > CI/CD -> Runners 下看到我的跑步者
4-) 創建從 gitlab 提供的 example.yml
build-job:
stage: build
script:
- echo "Hello, $GITLAB_USER_LOGIN!"
test-job1:
stage: test
script:
- echo "This job tests something"
test-job2:
stage: test
script:
- echo "This job tests something, but takes more time than test-job1."
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
- echo "which simulates a test that runs 20 seconds longer than test-job1"
- sleep 20
deploy-prod:
stage: deploy
script:
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
它的工作原理!
但現在我想在 gitlab-ci 上構建我的代碼。 文件結構:
scripts
->build.sh
src
->Cmakelist.txt
->codes.cpp
binaries
->outputs ll be here.
.gitlab-ci.yml
build.sh 做我想做的一切:
...
mkdir build
cd build
cmake .. -GNinja
ninja
所以我只需要運行它。 但我不知道如何安裝先決條件。 我現在到底在使用哪個系統,如何安裝先決條件? (ubuntu 18.04 - docker - 跑步者..我只是搞混了)
我現在正在使用哪個系統
您單擊selected ruby:2.6 default image
,因此您在 ruby:2.6 上。 You may then browse docker hub: https://hub.docker.com/_/ruby and dockerfile https://github.com/docker-library/ruby/blob/8e49e25b591d4cfa6324b6dada4f16629a1e51ce/2.6/buster/Dockerfile - I see it has “破壞者”是 debian 版本之一的名稱,所以我猜它是 debian。
如何安裝先決條件?
這取決於您使用的圖像,不同的 linux 發行版使用不同的 package 管理器。 我通常看一下wiki package manager 。
你可以像這樣:
build:
image: ubuntu
script:
- apt-get install -y cmake gcc whatever-else-like-you-have-on-your-machine
- ./scripts/build.sh
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.