Questions tagged [gitlab-ci.yml]
222 questions
2
votes
1 answer
Is it possible to prevent merging a green pipeline in gitlab?
I would like to not allow users to merge a merge request that has a passing pipeline, because that particular pipeline is a different version than the pipeline that makes all tests, security checks, etc.
The passing pipeline is a "fast pipeline"…

Diego J.
- 81
- 2
- 4
2
votes
0 answers
Does GitLab CI rules reference follow `and` or `or` condition?
I have some rules for example:
.run_for_apple:
- if: '$APPLE == "apple"'
.run_for_orange:
- if: '$ORANGE == "orange"'
I wonder if in my job as below:
job_one:
....
rules:
- !reference [.run_for_apple]
- !reference [.run_for_orange]
Does…

Jane
- 151
- 3
- 12
2
votes
1 answer
Excluding gitlab-ci.yml from merge-request
I have 2 branches: stage and master - and each of them has its own .gitlab-ci.yml with different scripts. How is it possible to exclude these files from merge-request, so that they remain unique for each of the branches?
i tried with gitattributes…

andrey
- 23
- 4
2
votes
2 answers
What is difference between extends and anchor tag (<<: *anchor) in yaml (Gitlab CICD)?
When we use extends and when we use anchor tag ?
Please refer below CI CD pipeline
stages:
- stage1
.random-variables:
variables:
ABC: ${XYZ}
.hidden-job: &hidden-job
stage: stage1
image: docker:latest
services:
…

Labhesh Mehta
- 23
- 4
2
votes
1 answer
How to prevent gitlab pipeline from running twice when pushing a tag
I have a gitlab pipeline which looks like this:
stages:
- build
- deploy
build:
stage: build
script: //do stuff
deploy:
stage: deploy
script: //do stuff
only:
- /^v\d+\.\d+\.\d+
when: on_success
I want it to run build job for…

Krzysztof Wrona
- 311
- 5
- 12
2
votes
2 answers
Pipeline does not run when using CI_COMMIT_MESSAGE
I want to run a pipeline that builds a docker image from an app and deploys it to Gitlab Registry and Docker Hub.
I'd like this pipeline to run only when the main branch gets a commit and when that commit has a message that is a "version". Examples…

RabidTunes
- 775
- 1
- 8
- 21
2
votes
0 answers
How to read the Git lab console output to fail the job when the test fails
I want to read the gitlab console output to fail the job when the test fails. I am running SoapUI tests using maven. Please see the screenshot below. I am new to gitlab. I have been working on this issue for 2 weeks. Also it is becoming hard for me…

Bob Jones
- 171
- 1
- 4
- 22
2
votes
1 answer
How to avoid multiple pulls of the same image?
The following .gitlab-ci.ylm file contains two stages and a request for an image:
image: alpine
stages:
- test
- build
random-job-1:
stage: build
script: echo "I am Job-1"
random-job-2:
stage: test
script: echo "I am Job-2"
The…

Herpes Free Engineer
- 2,425
- 2
- 27
- 34
2
votes
1 answer
The meaning of the quotation marks in "image"-keyword entries in GitLab CI/CD
The .gitlab-ci.yml file can accept the keyword: image, "to specify a Docker image that the job runs in."
I have encountered that the input entries of this keyword are sometimes enclosed with quotation marks (" ").
For example:
image:…

Herpes Free Engineer
- 2,425
- 2
- 27
- 34
2
votes
1 answer
when condtion is not matched job should be exit in gitLab CICD Pipleline
I am facing an issue in GitLab that is when I use reg tag it executes my regression test suite.
But when I give any other tag value it runs pipeline without any error. Please tell me how to add the condition in which only reg tag should work or else…

gaurav kumar
- 51
- 4
2
votes
1 answer
How to get a file from another repository in GITLAB and use as arguement to a python script in current pipleine
I have two projects ProjA and ProjB.
I want to use a yaml file(this is not a gitlab yaml file) from ProjA and pass it to a python script in ProjB's gitlab-ci.yaml file.
Can someone let me know how could we do it ?
Something like:
My…

Marcelo BD
- 229
- 3
- 8
2
votes
1 answer
Gitlab Runner taking Too long to run the pipeline
I had created a specific runner for my gitlab project,
its taking too long to run the pipeline.
Its is getting stuck in Cypress test mainly.
After "All Specs passed" it will not move forward.
- build
- test
build:
stage: build
image:…

Utkarsh Singh
- 21
- 2
2
votes
1 answer
Gitlab ci with unit testing that connects to MySQL
I have built a Golang project, I want to deploy the app when successfully tested with GitLab ci, but when do some tests, it fails because cannot connect to MySQL.
I want to use the Golang image and MySQL image in one stage.
This is my current…

lamboktulus1379
- 350
- 1
- 4
- 10
2
votes
1 answer
Found errors in your .gitlab-ci.yml: unknown keys in `extends`
My code for the pipeline is:
include:
- template: Terraform/Base.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml
stages:
- init
- validate
- build
- deploy
init:
…

Dionys Seidel
- 39
- 2
- 5
2
votes
0 answers
GitlabCI delayed job depending on one of two jobs
This is my .gitlab-ci.yaml :
stages:
- Stage1
- Stage2
# Stage1
Job1:
stage: Stage1
script:
- doSomething
Job2:
stage: Stage1
script:
- doSomething
# Stage2
Job3:
stage: Stage2
script:
- doSomething
when: delayed
…

Xys
- 8,486
- 2
- 38
- 56