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
3
votes
2 answers

Gitlab CI/CD will not run my deploy stage

New to Gitlab CI/CD. My build job works wonderfully, but deploy job is never executed. I removed all rules and still it does not run. Here is the contents of my .gitlab-ci.yml file: build-job: stage: build script: - echo "STAGE - BUILD" …
birwin
  • 2,524
  • 2
  • 21
  • 41
3
votes
1 answer

Getting pipeline ID after triggering that pipeline in Gitlab

I use Gitlab CI/CD for deploying my projects. I use Gitlab REST API for manipulating with pipelines. For starting pipeline I can use this endpoint: POST /projects/:id/trigger/pipeline response for that request something like this: { "ref":…
tikurilla
  • 31
  • 1
  • 4
3
votes
1 answer

How to deploy Azure resources using GitLab Pipelines?

I want to deploy Azure Resources using GitLab pipelines. resources e.g. Resource Group, storage account, etc. using ARM/Powershell stored in GitLab CI and using GitLab pipelines how can I deploy any Azure resources?
Yogesh Kulkarni
  • 339
  • 6
  • 24
3
votes
0 answers

gitlab ci trigger pipeline after updating labels in merge request

If I created the MR with the bug label, it will trigger the label script; If I created the MR without the label, it will not trigger; even if I add the label later on the MR view, the CI will not trigger the script as well. Is it possible to do…
user3906723
  • 117
  • 2
  • 15
3
votes
2 answers

Escape asterisk sign in variable in Gitlab ci yml

I have a variable declared like this variables: SCHEDULE: "35 0 5 * * ?" and it is used here - CMD="python helloworld.py" - if [ ${SCHEDULE+x} ]; then CMD+=" --schedule ${SCHEDULE}"; fi when this ${SCHEDULE} variable is used, the asterisks (*)…
L0cu2s
  • 515
  • 1
  • 4
  • 16
3
votes
0 answers

gitlab-runner job finished with sucess but phpunit is returning error status zero, leading into error

Gitlab-runner is terminating a job successfully even though PHPunit test is throwing a error code 0, although it should fail, it continues leading me into error. I also know the error is comming because of bad merge, which are going into…
staminna
  • 468
  • 1
  • 5
  • 26
3
votes
1 answer

How to pass values to gitlab pipeline variable sourced from a file

For example the file that I have is test.env test.env has the content export SAMPLE="true" I want the variable SAMPLE to be set as a pipeline variable before running the pipeline I am trying the below mentioned solution but it is not really…
Sourabh Ninawe
  • 389
  • 1
  • 6
  • 17
3
votes
1 answer

Automatically merge Master to Develop on Gitlab

Experiencing issues on Gitlab because the develop branch gradually deviates from master. For example, if somebody applies a hotfix on master it won't automatically appear in develop and that might create conflicts. Is there a way for automatically…
Vlad Gheorghe
  • 470
  • 2
  • 17
3
votes
1 answer

Aggregate SonarQube Maven analysis for multiple jobs in GitLab CI pipeline

I was wondering how to aggregate the SonarQube Maven analysis for multiple jobs in GitLab CI pipelines. My GitLab CI pipeline builds backend and frontend components in separate jobs (in the same stage). They require different build environments and,…
Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
3
votes
1 answer

Gitlab CI CD only run Pipeline Step when certain criteria is met

I am trying to configure my CI/CD pipeline so that a certain step is only executed if some conditions are met. My current rule definition looks like this: rules: - if: '($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web" ||…
3
votes
1 answer

how to check for file changes in GitLab CI, but only if merging into default branch?

After having to manually update my repo because I forgot to change the version number... twice, I decided it was time for some CI magic. Here's the deal: if I make a Merge Request into main, I expect the application version number to have changed in…
SteeveDroz
  • 6,006
  • 6
  • 33
  • 65
3
votes
1 answer

Run multiple Gitlab CI jobs in parallel, but manually

I would like two jobs to run in parallel in Gitlab CI but I want to launch them manually. Basically I have multiple jobs needed to deploy my code to staging (build the server, build the frontend). I want to deploy to staging by clicking ONE button…
Noé Malzieu
  • 2,530
  • 3
  • 22
  • 27
3
votes
2 answers

GitLab-CI: can't deploy using lftp any more

I have a problem with my deploy script in GitLab CI which used to work for the last two years. Since a week or so, the auto-verification of the root ECDSA is not working (I'm using lftp to deploy some files) . This is how the output of the pipeline…
Sim Son
  • 310
  • 1
  • 10
3
votes
1 answer

Cleaning up file based variables. ERROR: Job failed: exit code 1

I am using gitlab-ci to automate build and release. In the last job, I want to upload the artifacts to a remote server using lftp. $(pwd)/publish/ address is the artifacts that were generated in the previous job. And all variables declared in the…
mohabbati
  • 1,162
  • 1
  • 13
  • 31
3
votes
1 answer

syntax use variable in curl script json data in gitlab-ci.yml

I am running out of ideas to have this to work in my gitlab-ci.yml. I have a variable called TARGET, and I want to successfully inject its value inside the json payload of my http POST request in form of curl bash command. job: stage: deploy …
yzftnt
  • 83
  • 1
  • 6