12 votes
Accepted

How to tag source code using gitlabCI

I tried to change docker image and added couple steps for git tag. Below is the answer worked for me, image: maven stages: - build - deploy - tag maven_build: stage: build script: - mvn clean ...
  • 909
12 votes
Accepted

Is it possible to have multiple gitlab-ci files in a single repo?

No, you can't have multiple gitlab-ci files per repository. You can see more information in the following links : https://gitlab.com/gitlab-org/gitlab-foss/issues/18157 https://gitlab.com/gitlab-org/...
9 votes
Accepted

Gitlab CI error during connect: Get http://docker:2375/v1.40/containers/json?all=1: dial tcp: lookup docker on xx.xx.xx.x:xx: no such host

I might have skipped the optional installation of docker in my Ubuntu instance, so if the gitlab runner is going to use Docker, remember to install it: curl -sSL https://get.docker.com/ | sh I got ...
  • 339
8 votes
Accepted

Can I run multiple pipelines in a single GitLab repo using GitLab CI/CD?

Yes, you can use the rules syntax. You can use this in combination with regex for commit message, ci_pipeline_source or any other available CI variables. job1: script: - do something on ...
  • 321
6 votes

Installing azcopy in Gitlab Runner (Alpine Linux)

This is a glibc dependency issue on Alpine. This azcopy binary is compatible with Linux distributions that use glibc, GNU's C standard library. Alpine Linux uses a different libc implementation, musl-...
  • 185
4 votes

Is it possible to have multiple gitlab-ci files in a single repo?

You are not able to create multiple .gitlab-ci.yml but you can manage to have what you want. You currently have multiple software in the same repository with the same CI/CD Pipeline or jobs for your ...
4 votes

Build Docker images with DinD and BuildKit

Caching of layers with buildkit in an external registry requires an extra step or two depending on how you want to cache your layers. The easy option is to include a build arg that enables the inline ...
  • 2,840
3 votes
Accepted

Best way to create a Ci/CD pipeline to reduce bugs and facilitate refactor

It might not be obvious now, but usually as projects advance full regression costs (resources/time) grow much faster than static analysis ones. You'll also find that static analysis alone isn't a ...
3 votes
Accepted

Git-based CI/CD Pipeline for Monorepo

The fact that all the code is in a single repository doesn't mean that all the code is changing every time a commit is pushed. I would first make the "pathways" in the code explicit. E.g. perhaps you ...
  • 3,118
3 votes
Accepted

How to pass Gitlab env var with sensitive characters to bash script?

Surprisingly indeed GitLab works weirdly with the env vars. It evaluates them internally, though it shouldn't in my view. Value set as (in project Settings > CI/CD > Variables): 'aaa$bbb*%' becomes '...
  • 146
3 votes

One time/set up jobs on gitlab ci?

I dealt with the same issue. Some people recommended using the Gitlab group "secrets" and using before_script. Since I knew I was also going to deploy and would need other tools on my runner like "...
  • 794
3 votes
Accepted

Gitlab CI Runner command line doesn't care about --parameters

You're missing the --non-interactive tag to your registration command. Full command should be: gitlab-runner register --non-interactive --locked false --run-untagged true --tag-list java --name foo -...
  • 933
3 votes
Accepted

Error from server (Forbidden): error when retrieving current configuration of: Resource: "apps/v1, Resource=deployments",

Going from this, your ClusterRole isn't configured to allow access to deployments, and the ClusterRole you've listed isn't properly bound to your service account. You could configure it with something ...
  • 146
3 votes
Accepted

Problem on gitlab-runner: cannot lock ref [...] Another git process seems to be running in this repository

The easiest solution for me was to execute docker container prune on the runner machine. The command removes all stopped docker containers and the .lock files therein. Running a pipeline from ...
  • 161
3 votes

Gitlab CI push to docker-registry fails

Are you sure that your registry is publicly available? Checklist: Check if the domain is reachable and responding the right IP address -- nslookup myregistry Check if your port is open or not blocked ...
  • 349
3 votes
Accepted

This job is stuck because you don't have any active runners online

Runners are machines (typically containers) where your jobs run. Gitlab offers shared runners, and you can also bring in your own runners (machines that you register against Gitlab to run your jobs). ...
3 votes

This job is stuck because you don't have any active runners online

After Further research, I found an open issue on gitlab pretty similar to mine. They describe runners freshly created and unable to pick up jobs. As for my use case, The runner was created but with ...
3 votes

How to get GitLab CI to rebuild on JIRA issue status change?

I didn't get what's wrong with webhooks You just create a webhook on Gitlab CI side and provide this URL to your Jira account. https://gitlab.com/api/v4/projects/PROJECT_ID/ref/REF_NAME/trigger/...
3 votes

Gitlab runner fails with connection timeout

This is likely because your requests were dropped before they landed on the GitLab host. Check your firewalls and other security rules after assured that the 1234 port is open
  • 349
2 votes
Accepted

GitLab - trigger pipeline to build on specific runner

There currently isn't a solution for building on a specific runner in GitLab, but there is an issue open for Sticky Runners, which hopefully will be out in the next 3-6 months according to the ...
  • 933
2 votes

How to tag source code using gitlabCI

git push origin 1.0.15 should work and a new tag should be added to the tags in gitlab https://docs.gitlab.com/ee/university/training/topics/tags.html git checkout master # Lightweight tag git tag ...
  • 12.7k
2 votes

Where to obtain the token to register a GitLab runner?

For a specific GitLab runner tied to a project, the token can be found in Step 3; in Project -> Settings -> CI/CD -> Runners in the Setup a specific Runner manually section. You will also be ...
  • 933
2 votes
Accepted

Adding a persistent volume to a Kubernetes deployment from Gitlab Auto Dev-ops

The answer is that all Auto Dev-Ops deployments at present use Helm to package and deploy your application. In order to make changes to the deployment, such as adding a persistent volume claim, you ...
2 votes

How to tag source code using gitlabCI

Combining the answer of https://devops.stackexchange.com/a/3854/10932 and the comment of Overbryd along with a slight modification worked for me. Here, instead of using using git remote set-url ...
2 votes
Accepted

No space left on device when running job on photon-os

Well this seems to be a docker issue. It’s keeping a whole lot of dangling volumes. check if you have some : docker volume ls -qf dangling=true Get rid of them with : docker volume rm $(docker ...
2 votes
Accepted

Understand GitLab CI/CD better

No, jobs (which rust-latest and rust-nightly are examples of) will run in parallel if they are in the same stage (of which you only have one, build).
  • 144
2 votes
Accepted

GitLab CI/CD job without pulling LFS files?

Yes, full cloning of LFS files can be restricted! By default, GitLab will clone your repo into the CI/CD build directory. To limit the clone from downloading the LFS files, tell it not to do it. ...
2 votes
Accepted

What package manager does the gitlab docker CI image use?

https://hub.docker.com/_/docker/ Seems it's just a reference to the above... Which uses APK as the package manager
2 votes
Accepted

Can a server used for GitLab runners be used as a deployment server?

GitLab and GitLab CI are not two servers: they are softwares installed on a server. Now, while both can be installed on the same server, they can be split for scaling reason. Now your question: it ...
  • 325
2 votes

Gitlab CI error during connect: Get http://docker:2375/v1.40/containers/json?all=1: dial tcp: lookup docker on xx.xx.xx.x:xx: no such host

I want to share the solution! just add image = docker:stable and privileged = true and that's all! enjoy!

Only top scored, non community-wiki answers of a minimum length are eligible