简体   繁体   English

通过gitlab ci / docker运行构建

[英]Running build via gitlab ci / docker

I have successfully installed Gitlab CI and also linked it with my gitlab . 我已经成功安装了Gitlab CI ,并将其与gitlab链接了。 I have also configured shared runners using docker with a ruby-2.2 image with mysql service. 我还使用dockermysql服务将ruby-2.2镜像配置为使用docker共享运行程序。

Following was what I executed to configure a runner by referring https://about.gitlab.com/2015/04/17/unofficial-gitlab-ci-runner/ : 以下是我通过参考https://about.gitlab.com/2015/04/17/unofficial-gitlab-ci-runner/来配置跑步者的执行内容:

$ gitlab-ci-multi-runner register \
  --non-interactive \
  --url "https://my.gitlab.ip/" \
  --registration-token "REGISTRATION_TOKEN" \
  --description "ruby-mysql" \
  --executor "docker" \
  --docker-image ruby:2.2 --docker-mysql latest

I have a sample Ruby / Rails application and for some reason the runner doesn't run the build. 我有一个示例Ruby / Rails应用程序,由于某种原因,运行程序未运行构建。 Here is my .gitlab-ci.yml : 这是我的.gitlab-ci.yml

image: ruby:2.2

services:
  - mysql:latest

before_script:
  - ruby -v
  - gem install bundler
  - cp config/database.yml.example config/database.yml
  - cp config/secrets.yml.example config/secrets.yml
  - bundle install

spec:
  script:
    - bundle exec rspec
  tags:
    - ruby-mysql

Try removing the first line image: ruby:2.2 of your .gitlab-ci.yml 尝试删除第一行image: ruby:2.2 .gitlab-ci.yml image: ruby:2.2

I had a similar issue where the CI reported a success, yet didn't do any work. 我遇到了类似的问题,即CI报告成功,但未做任何工作。
I used the lint provided on http://my.domain/lint 我使用了http://my.domain/lint提供的棉绒
It flagged "image" and "stage/stages" as not correct. 它标记“图像”和“舞台”为不正确。
That's why I think removing the first line will help you. 这就是为什么我认为删除第一行会为您提供帮助。

I think the problem is that the community version doesn't recognize the keywords yet. 我认为问题在于社区版本尚未识别关键字。

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

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