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
30
votes
3 answers

Gitlab CI gradle dependency cache

I'm building android on Gitlab CI and downloading dependencies each time is annoying. I tried caching: $HOME/.gradle/ $HOME/.gradle/caches/ $GRADLE_HOME/caches/ $HOME/.m2/ .gradle/ build/ app/build/ The 26594th iteration of my .gitlab-ci.yml is…
DariusL
  • 4,007
  • 5
  • 32
  • 44
30
votes
2 answers

How do we use the 'variables' keyword in gitlab-ci.yml?

I am trying to make use of the variables: keyword documented in the Gitlab CI Documentation here: FROM: https://docs.gitlab.com/ce/ci/yaml/README.html variables This feature requires gitlab-runner with version equal or greater than 0.5.0. GitLab…
Routhinator
  • 3,559
  • 4
  • 24
  • 35
30
votes
6 answers

How to run multiple gitlab-ci-runners?

Well, very basic question but I just didn't find (good) documentation; here we go: Can I setup/run several runners on the same server? What means runner? Is this the (omnibus) installation or the processes I start with e.g.…
h2459jl
  • 405
  • 1
  • 5
  • 8
29
votes
2 answers

How the gitlab-ci cache is working on docker runner? what is /cache directory? what is cache_dir?

How the gitlab-ci cache is working on docker runner? What is /cache directory? What is cache_dir? Where and how files matching the "paths" in "cache" gitlab-ci.yml are stored?
srghma
  • 4,770
  • 2
  • 38
  • 54
29
votes
2 answers

gitlab ci scripts during which $? is allowed to be non-zero

In our project we have a shell script which is to be sourced to set up environment variables for the subsequent build process or to run the built applications. It contains a block which checks the already set variables and does some adjustment. #…
pseyfert
  • 3,263
  • 3
  • 21
  • 47
28
votes
3 answers

gitlab-runner: prepare environment failed to start process pwsh in windows

On a new WIN10 machine after installing gitlab-runner with shell executor(i.e powershell) and starting a CI build throws following error: Preparing environment ERROR: Job failed (system failure): prepare environment: failed to start process: exec:…
harish
  • 1,836
  • 3
  • 21
  • 26
28
votes
7 answers

gitlab runner throws "Cleaning up file based variables 00:01 ERROR: Job failed: exit code 1" at the end

Even though all my steps pass successfully , Gitlab CI shows this - "Cleaning up file based variables 00:01 ERROR: Job failed: exit code 1" and fails the job at the very end . Also interestingly , this only happens for my master branch . It runs…
ssbb191
  • 1,486
  • 3
  • 12
  • 23
28
votes
1 answer

Gitlab CI - Specifying stages in before_script

i want to run a script that is needed for my test_integration and build stage. Is there a way to specify this in the before script so i don't have to write it out twice. before_script: stage: ['test_integration', 'build'] this does not seem to…
Kay
  • 17,906
  • 63
  • 162
  • 270
28
votes
6 answers

Gitlab DOCKER_AUTH_CONFIG not working

The following are in my .gitlab-ci.yml stages: - build variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 services: - docker:dind build-image: image: docker:stable stage: build script: - docker build --no-cache…
Tin Ng
  • 937
  • 2
  • 11
  • 25
28
votes
6 answers

Gitlab CI Build failed gitlab-runner-prebuilt.tar.xz: no such file or directory

I just installed Gitlab Runner on my dev machine (Ubuntu 17.10) for testing. When I run the runner I got: $: sudo gitlab-runner exec docker test Running with gitlab-ci-multi-runner dev (1.4.2) Using Docker executor with image php:5.6…
vpedrosa
  • 811
  • 1
  • 6
  • 17
28
votes
6 answers

How do I enable cloning over SSH for a Gitlab runner?

I am having some trouble cloning large repositories over HTTP on my Windows Gitlab runner. I've tried several methods to do shallow clones or disable clone compression. Still no luck. Cloning the same repository over SSH works great as a temporary…
28
votes
3 answers

Retrieve the commit hash

I'm currently working on a deployment script to run as part of my GitLab CI setup. What I want is to copy a file from one location to another and rename it. Now I want to be able to find what commit that file was generated with, so I'd like to add…
Daniël van den Berg
  • 2,197
  • 1
  • 20
  • 45
28
votes
4 answers

gitlab 8.2.1, How to use cache in .gitlab-ci.yml

I'm trying to use 'cache' in .gitlab-ci.yml (http://doc.gitlab.com/ce/ci/yaml/README.html#cache). My gitlab version is 8.2.1 and my Runner is: $ docker exec -it gitlab-runner gitlab-runner -v gitlab-runner version 0.7.2 (998cf5d) So according to…
delanne
  • 420
  • 1
  • 4
  • 12
27
votes
5 answers

Gitlab CI/CD Pass artifacts/variables between pipelines

tl;dr How do I pass data, e.g. the $BUILD_VERSION variable, between jobs in different pipelines in Gitlab CI? So (in my case) this: Pipeline 1 on push ect. Pipeline 2 after merge `building` job ... `deploying` job …
miile7
  • 2,547
  • 3
  • 23
  • 38
27
votes
2 answers

How to escape a colon in .gitlab-ci.yml?

I have a line like this: sed -i 's/"host: TND_HOST"/"host: process.env.TND_HOST"/g' services/management/tnd.js and the option above causes linting error: This GitLab CI configuration is invalid: (): mapping values are not allowed in this…
AbreQueVoy
  • 1,748
  • 8
  • 31
  • 52