WebHare community

Gitlab CI

#1

I’m trying to setup a CI pipeline in Gitlab. I’ve added a .gitlab-ci.yml file in the root of my module and this triggers a pipeline, but it results in an error. Full log:

Running with gitlab-runner 11.8.0 (4745a6f3)
on docker-auto-scale fa6cab46
Using Docker executor with image ruby:2.5 …
Pulling docker image ruby:2.5 …
Using docker image sha256:b74fc909a012694336c331a32cef3c1aacd650a4ba0547af5481eaa05d8249a8 for ruby:2.5 …
Running on runner-fa6cab46-project-11008362-concurrent-0 via runner-fa6cab46-srm-1551468276-46575ee2…
Cloning repository…
Cloning into ‘/builds/webwerf/not’…
Checking out 227a8fe1 as master…
Skipping Git submodules setup
$ curl -s https://build.webhare.org/ci/testmodule.sh | bash -s – -w head
Fri Mar 1 19:26:08 UTC 2019 Pulling image webhare/webhare-core:master
/tmp/tmp.N44ygidWgg/testdocker.sh: line 155: docker: command not found
Failed to pull image
Uploading artifacts…
WARNING: artifacts: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1

I’m guessing I need to do something in my Gitlab repo settings?

0 Likes

#2

As far as I know, gitlab.com’s shared CI runners do not support docker. You need to bring your own.

0 Likes

#3

This YML seems to do the trick:

image: gitlab/dind

services:
  - docker:dind

stages:
  - test

runtest-vs-head:
  stage: test
  script:
    - curl -s https://build.webhare.org/ci/testmodule.sh | bash -s -- -w head
  artifacts:
    paths:
      - artifacts
    when: on_failure
    expire_in: 1 week

Next stop, starting up my unit test. Got any pointers or example code for that?

0 Likes

#4

Never mind, the tests are triggered automatically by the testmodule.sh (technically the testdocker.sh) script.

All done!

1 Like

closed #5
0 Likes