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.

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

5017 questions
179
votes
19 answers

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

I use the new Command line tools of 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 create…
158
votes
3 answers

How can I pass 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 artifact. Now how can I…
ygoe
  • 14,805
  • 19
  • 92
  • 173
135
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,608
  • 2
  • 11
  • 16
97
votes
5 answers

How to update existing images with docker-compose?

I have multiple microservices and I am using docker-compose for development deployments. When there are some changes in the microservices code base, I am triggering ci job to re-deploy them. I have below script to do this. But each time I have to…
Efe
  • 3,192
  • 1
  • 14
  • 29
95
votes
8 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
  • 42,736
  • 37
  • 154
  • 239
92
votes
6 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
  • 21,211
  • 7
  • 69
  • 122
79
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
  • 1,887
  • 2
  • 15
  • 28
78
votes
9 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,569
  • 1
  • 13
  • 25
71
votes
15 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,185
  • 1
  • 10
  • 18
70
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
  • 9,548
  • 14
  • 80
  • 167
70
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,215
  • 2
  • 26
  • 32
68
votes
6 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
  • 3,534
  • 4
  • 21
  • 32
65
votes
6 answers

How to use Gitlab CI to build a Java Maven project?

I have been experimenting with no success whatsoever, I am running a Gitlab hosted on Linux, and trying to get my head around the CI functionality. According to the Gitlab documentation you only need to create a .gitlab-ci.yml file, the Gitlab…
MRK187
  • 1,277
  • 2
  • 11
  • 19
63
votes
5 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
  • 4,486
  • 5
  • 17
  • 31
59
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
  • 3,563
  • 3
  • 26
  • 42
1
2 3
99 100