Hot answers tagged

56 votes
Accepted

Is there a [ci skip] option in GitLab CI?

Yes, there is: If your commit message contains [ci skip] or [skip ci], using any capitalization, the commit will be created but the pipeline will be skipped. Alternatively, one can pass the ci.skip ...
user avatar
  • 676
13 votes
Accepted

Gitlab doesn't open Word files

You can only view text/source code files, Markdown files and images. Gitlab doesn't have a preview option for other files such as proprietary word processors.
user avatar
  • 426
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 ...
user avatar
  • 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/...
user avatar
10 votes

Changing the build intermediate paths for gitlab-runner

Conceptually, this approach is not the way to go; the build directory is not a deployment directory, it's a temporary directory, to build or to deploy from, whereas on a shell executor this could be ...
user avatar
9 votes

Jenkins shows the job as failed if there is nothing to commit to gitlab

In my automatic jenkins job, launched daily, if there are no changes the git commit command returns 1. That will mark the build as failed. To solve this problem I use these two commands in my shell ...
user avatar
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 ...
user avatar
  • 339
9 votes
Accepted

Is there any way to break long command into multi lines in GitlabCI

Since .gitlab-ci.yml is a Yaml file, then just use it's syntax. For example, you may use >: image: ubuntu before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install ...
user avatar
  • 562
8 votes

Trigger Jenkins job from Gitlab CI with parameters

Here's the way I do it: no plugin required, just triggering Jenkins api from gitlab-ci. Gitlab-CI I will assume you have a gitlab-ci runner installed and configured. First, you need to have a ....
user avatar
7 votes

Using gitlab-ci to cache maven repository

To me the easiest route to this would be to have an instance of an artifactory running. There are several choices out there many of which have an open-source, community or free version that would ...
user avatar
  • 1,851
7 votes
Accepted

Where can I find older versions of GitLab Runner?

As described in the documentation you are following to install on the first paragraph: You can download a binary for every available version as described in Bleeding Edge - download any other ...
user avatar
  • 11.1k
7 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 ...
user avatar
  • 186
6 votes
Accepted

Jenkins shows the job as failed if there is nothing to commit to gitlab

In order to get a success, you need to avoid non-zero exit codes. A simple solution would be to change the last line of your script to git commit -a -m 'Changes pushed by Jenkins' || true, but better ...
user avatar
  • 186
6 votes
Accepted

How to configure gitlab-runner to run in the same docker host as gitlab?

Management Summary Set the pull_policy to "never" in the [runners.docker] section by calling: docker exec -it gitlab-runner \ vi /etc/gitlab-runner/config.toml Detailed Description It seemed the ...
user avatar
  • 418
6 votes
Accepted

Jenkins Pipeline "Build when a change is pushed to GitLab"

Looks like you are using the Gitlab plugin for jenkins? if so this link should be of help https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs
user avatar
6 votes

How should CI/CD deploy to production environment - copy artifacts or git pull from the server?

There are lots of bad examples on the Internet. Doing a git pull to distribute code is fabulous for development, but prone to all sorts of issues in practice. It should not be used for production ...
user avatar
  • 1,728
5 votes
Accepted

What OS should a master node CI virtual machine be?

I think the major deciding factor is the expertise of you and the rest of your company in the chosen OS. If you are a Windows shop, and your company is willing to leverage the cost of the node, it's ...
user avatar
  • 3,003
5 votes
Accepted

Multiple paths with different expiry time in gitlab-ci runners

This has been answered over on SO using a work around seeing as it doesn't seem possible according to the documents. Basically, this can be done in 3 stages. Stage 1: Build and store all artifacts. ...
user avatar
  • 933
5 votes
Accepted

Colored logging messages from Python script within GitLab CI

Set the LOGURU_COLORIZE variable in your Docker container. run: stage: run image: $CI_REGISTRY_IMAGE:latest variables: LOGURU_COLORIZE: "true" script: - ls -...
user avatar
  • 728
4 votes
Accepted

fatal: ambiguous argument 'master': unknown revision or path not in the working tree

The error looks like you're using a non-existent reference (branch/tag). Try specifying the correct branch and tag using the branch/tag options. You can also use the commit hash directly using ref ...
user avatar
  • 324
4 votes
Accepted

CI/CD for microservices in monorepo on Gitlab

Monorepos are nice because it eliminates the technical constraints between multiple projects. This does however open the door to other complications within your repository (naming conventions, cross-...
user avatar
  • 3,003
4 votes
Accepted

Gitlab Runner not running scripts with Windows shell configuration

stages are required stages: - stage1 stage1: stage: stage1 script: - echo hello Could you try the following: before_script: - pushd . && uru 233 && popd && set ...
user avatar
  • 12.6k
4 votes
Accepted

Multiple runners for all projects OR single runner per project

After some research i found out that shared runners are good for the projects that are very much the same, and specific runners are better for the projects that are not like any project. Shared ...
user avatar
4 votes

Gitlab doesn't open Word files

A word document is not a source document that is fit for version control, it's a proprietary binary file. For version control, try to learn a real source document like e.g. Markdown or AsciiDoc. In ...
user avatar
4 votes
Accepted

What's the practice to perform a releasing with Git?

Consider to substitute the version in POM by the git describe upon build without hardcoding the version in your repository, you could do this with e.g. sed from below version_slug. export git_version=...
user avatar
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 ...
user avatar
4 votes

Internal Server Error while running docker-compose to install Gitlab

In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services. listen tcp 0.0.0.0:443: bind: address ...
user avatar
4 votes

Using Jenkins gitlab token to make an API call

Try something similar to the following: environment { GITLAB_API_TOKEN = credentials('gitlab_api_token'). } or withCredentials([[ $class: 'com.dabsquared.gitlabjenkins.connection....
user avatar
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 ...
user avatar
  • 2,800
4 votes
Accepted

How can I make artifacts available to the QA team with a user-friendly UI?

It seems to me that you're looking for an artifact store such as Nexus or Artifactory. Both solutions have Jenkins plugins which will simplify the process of uploading your artifacts to them. You can ...
user avatar

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