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
278
votes
5 answers

How can I pass GitLab artifacts to another stage?

I'd like to use GitLab CI with the .gitlab-ci.yml file to run different stages with separate scripts. The first stage produces a tool that must be used in a later stage to perform tests. I've declared the generated tool as an artifact. Now how can I…
ygoe
  • 18,655
  • 23
  • 113
  • 210
222
votes
11 answers

Use GitLab CI to run tests locally?

If a GitLab project is configured on GitLab CI, is there a way to run the build locally? I don't want to turn my laptop into a build "runner", I just want to take advantage of Docker and .gitlab-ci.yml to run tests locally (i.e. it's all…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
216
votes
24 answers

Android Command line tools sdkmanager always shows: Warning: Could not create settings

I use the new command line tools for Android because the old sdk-tools repository of Android isn't available anymore. So I changed my gitlab-ci to load the commandlintools. But when I try to run it I get the following error: Warning: Could not…
167
votes
14 answers

Terraform: Error acquiring the state lock: ConditionalCheckFailedException

I got the following error during a terraform plan which occured in my pipeline: Error: Error locking state: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed Lock Info: ID: …
veben
  • 19,637
  • 14
  • 60
  • 80
141
votes
6 answers

How to use if-else condition on gitlabci

How to use if else condition inside the gitlab-CI. I have below code: deploy-dev: image: testimage environment: dev tags: - kubectl script: - kubectl apply -f demo1 --record=true - kubectl apply -f demo2 --record=true Now I want…
Vikas Rathore
  • 8,242
  • 8
  • 35
  • 54
140
votes
5 answers

GitLab CI vs. Jenkins

What is the difference between Jenkins and other CI like GitLab CI, drone.io coming with the Git distribution. On some research I could only come up that GitLab community edition doesn't allow Jenkins to be added, but GitLab enterprise edition does.…
Ravikiran butti
  • 1,668
  • 2
  • 11
  • 18
139
votes
5 answers

Multiline YAML string for GitLab CI (.gitlab-ci.yml)

I'm trying to write a gitlab-ci.yml file which uses a multi-line string for the command. However, it seems like it is not being parsed. I've tried both the - | and - > with identical results. stages: - mystage Build: stage: mystage script: …
samanime
  • 25,408
  • 15
  • 90
  • 139
123
votes
19 answers

Where do I find the project ID for the GitLab API?

I use GitLab on their servers. I would like to download my latest built artifacts (build via GitLab CI) via the API like this: curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.com/api/v3/projects/1/builds/8/artifacts" Where do I…
Hubert Ströbitzer
  • 1,745
  • 2
  • 15
  • 19
113
votes
2 answers

Multiple Docker images in .gitlab-ci.yml

Here is my problem setup with GitLab and its integrated CI service. I have a current GitLab 8.1. and a gitlabci-multi-runner (0.6.2) with Docker support. After extending the ubuntu:precise image to include git and build-essentials (now named…
M.K. aka Grisu
  • 2,338
  • 5
  • 17
  • 32
109
votes
11 answers

How to run a gitlab-ci.yml job only on a tagged branch?

How do I run a .gitlab-ci.yml job only on a tagged Master branch? job: script: - echo "Do something" only: - master - tags The above code will run if either condition exists: a Master branch or a tagged commit. My goal is to have this…
Carson Cole
  • 4,183
  • 6
  • 25
  • 35
105
votes
10 answers

Run docker-compose build in .gitlab-ci.yml

I have a .gitlab-ci.yml file which contains following: image: docker:latest services: - docker:dind before_script: - docker info - docker-compose --version buildJob: stage: build tags: - docker script: - docker-compose…
jonua
  • 1,915
  • 3
  • 17
  • 27
102
votes
4 answers

How to access multiple repositories in CI build?

We have a project that is composed of multiple (non-public) repositories. To build the whole project, the build system needs to have the files of all repositories (master branches). Is there a way I can configure GitLab CI to provide the…
Udo G
  • 12,572
  • 13
  • 56
  • 89
100
votes
2 answers

Role of docker-in-docker (dind) service in gitlab ci

According to the official gitlab documentation, one way to enable docker build within ci pipelines, is to make use of the dind service (in terms of gitlab-ci services). However, as it is always the case with ci jobs running on docker executors, the…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
95
votes
1 answer

How to specify wildcard artifacts subdirectories in .gitlab-ci.yml?

I'm using GitLab CI to build a C# solution and try to pass some build artifacts from one build stage to another. The problem is, that the artifacts are not located in a single directory but in different subdirectories, which however all have the…
swalex
  • 3,885
  • 3
  • 28
  • 33
95
votes
8 answers

How to enable maven artifact caching for GitLab CI runner?

We use GitLab CI with shared runners to do our continuous integration. For each build, the runner downloads tons of maven artifacts. Is there a way to configure GitLab CI to cache those artifacts so we can speed up the building process by preventing…
helt
  • 4,925
  • 3
  • 35
  • 54
1
2 3
99 100