Questions tagged [gitlab-ci]

GitLab CI is a continuous integration server from GitLab.

GitLab CI integrates with your GitLab instance to build the projects and run tests on top. GitLab CI supports the Linux operating system.

GitLab CI pipelines are defined by a .gitlab-ci.yml file placed inside the project directory. For details on writing a .gitlab-ci.yml file visit https://docs.gitlab.com/ee/ci/yaml/.

More information is in https://about.gitlab.com/features/gitlab-ci-cd/.

8228 questions
47
votes
2 answers

How to deploy with Gitlab-Ci to EC2 using AWS CodeDeploy/CodePipeline/S3

I've been working on a SlackBot project based in Scala using Gradle and have been looking into ways to leverage Gitlab-CI for the purpose of deploying to AWS EC2. I am able to fully build and test my application with Gitlab-CI. How can I perform a…
autronix
  • 2,885
  • 2
  • 22
  • 28
45
votes
4 answers

How to merge branch to master?

I do have a local branch with some changes, and I want to merge it to remote master. When I run: git merge master I get: Already up-to-date but I still can see that the master doesn't contain the new changes. I checked the following issue Git…
k.vincent
  • 3,743
  • 8
  • 37
  • 74
44
votes
1 answer

What is difference between script: and before_script: inside a job in gitlab-ci.yml

In .gitlab-ci.yml it is possible to add a default before_script that runs before all script in defined jobs. My question is why define before_script in a job instead of just using the script in the job? Is using before_script inside a job is only to…
Ouss
  • 2,912
  • 2
  • 25
  • 45
43
votes
9 answers

Disable pipeline for every commit in Gitlab and only run it on open merge request

The CI pipeline runs on every commit in my Gitlab repository at work. Is there way to disable that and only run the CI pipeline on an open merge request to the master branch?
jj123456
  • 519
  • 1
  • 5
  • 11
43
votes
5 answers

Cannot push from gitlab-ci.yml

With my colleagues, we work on a C++ library that becomes more and more important each day. We already built continuous integration utilities through the gitlab-ci.yml file that let us: Build & Test in Debug mode Build & Test in Release…
baptiste
  • 1,107
  • 2
  • 15
  • 30
43
votes
3 answers

GitLab only builds for specific tag names

Is there a way to instruct the pipeline to only do a step for certain tags that matches a regular expression? I would like it to do a deploy when I push a tag on the format 1.2.3 (for example). Is there a way to do this?
Magnus Lundberg
  • 596
  • 1
  • 4
  • 17
42
votes
2 answers

Gitlab pipeline - reports config contains unknown keys: cobertura

I'm not able run the gitlab pipeline due to this error Invalid CI config YAML file jobs:run tests:artifacts:reports config contains unknown keys: cobertura
Shashikumar KL
  • 1,007
  • 1
  • 10
  • 25
42
votes
3 answers

How can I let the gitlab-ci-runner DinD image cache intermediate images?

I have a Dockerfile that starts with installing the texlive-full package, which is huge and takes a long time. If I docker build it locally, the intermedate image created after installation is cached, and subsequent builds are fast. However, if I…
Roel Harbers
  • 1,014
  • 1
  • 9
  • 18
41
votes
9 answers

Code coverage report using gitlab-ci.yml file

I need to see code coverage report for a java maven project in Gitlab. According to this, this and some other sources: I added jacoco to the list of plugins in pom.xml. Added pages job to my .gitlab-ci.yml file. Added Total.*?([0-9]{1,3})% to code…
AshKan
  • 779
  • 2
  • 8
  • 22
41
votes
6 answers

Gitlab-CI runner: ignore self-signed certificate

gitlab-ci-multi-runner register gave me couldn't execute POST against https://xxxx/ci/api/v1/runners/register.json: Post https://xxxx/ci/api/v1/runners/register.json: x509: cannot validate certificate for xxxx because it doesn't contain any IP…
Etienne Gautier
  • 2,901
  • 4
  • 26
  • 35
41
votes
2 answers

Artifacts for failed builds in Gitlab

I would like to know how to generate artifacts for failed builds in gitlab continuous integration, to view the html report generated by the build. I tried like this: artifacts: when: on_failure paths: - SmokeTestResults/ -…
Jerzy Gruszka
  • 1,629
  • 4
  • 15
  • 20
41
votes
7 answers

GitLab CI builds remains pending

We recently started to use GitLab-CI on the gitlab.com free service. At first everything went fine, but now, seems like we can't build our project anymore. The builds are shown as pending and doesn't do anything. Here's what we have in our builds…
Pascal Boutin
  • 1,220
  • 2
  • 9
  • 22
40
votes
5 answers

Cannot connect to the Docker daemon at tcp://localhost:2375/. Is the docker daemon running. On GitLab

I'm trying to build the CI pipeline in GitLab. I'd like to ask about making the docker work in GitLab CI. From this issue: https://gitlab.com/gitlab-org/gitlab-runner/issues/4501#note_195033385 I'm follow the instruction for both ways. With TLS and…
zzob
  • 993
  • 3
  • 9
  • 19
40
votes
4 answers

.gitlab-ci.yml after_script section: how can I tell whether the task succeeded or failed?

I'm using Gitlab CI, and so have been working on a fairly complex .gitlab-ci.yml file. The file has an after_script section which runs when the main task is complete, or the main task has failed somehow. Problem: I need to do different cleanup based…
Daniel Griscom
  • 1,834
  • 2
  • 26
  • 50
40
votes
5 answers

How can you execute Gitlab stages conditionally?

There are 3 stages - build, test and deploy in .gitlab-ci.yml. A nightly regression test stage needs to be run nightly. Here's the relevant .gitlab-ci.yml code: stages: - build - test - deploy build_project: stage: build script: - cd…
deepdive
  • 9,720
  • 3
  • 30
  • 38