Questions tagged [gitlab-ci.yml]

222 questions
2
votes
2 answers

Gitlab CI Jobs Not Using Latest Template Changes

I've written several pipeline templates that our development teams use in their projects and what I've found is that if I make a change in a template to fix a bug, when we "retry" a job it doesn't pick up the latest changes from the template. The…
Steveno
  • 171
  • 1
  • 7
2
votes
3 answers

Why doesn't nested parameter expansion work correctly in GitLab CI/CD?

Using a bash runner, is there any reason why the following variable expansion shouldn't work? variables: GIT_BRANCH: "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH:-$CI_DEFAULT_BRANCH}}" job1: script: - echo $GIT_BRANCH The job…
brabec
  • 4,632
  • 8
  • 37
  • 63
2
votes
1 answer

error when connecting local mysql to gitlab ci/cdpipeline

I have a spring-boot application with mysql database connection and junit test classes. That's working fine in local machine. But when I pushed the code to Gitlab to build a CI/CD pipeline, the build stage is failing due to mysql connection…
Anne
  • 401
  • 6
  • 23
2
votes
2 answers

How to limit execution of stage in gitlab-ci.yml to some hours?

I have multiple stages in gitlab-ci.yml. I want to limit for example deploy to production stage that can be executed only between 8am and 16pm. Is this "if" statement in stage or it can be solved some other way?
a11eksandar
  • 145
  • 2
  • 10
2
votes
1 answer

Django unittest run specific test syntax

I want to run one specific unit test from my app bank/tests.py in the pipeline but I keep getting errors, I believe I am missing something on the syntax here This is my test: class SettingsTestCase(TestCase):     def test_timezone_default(self):    …
patbet
  • 93
  • 1
  • 9
1
vote
0 answers

Gitlab CI how to re-use conditions in variables

In my gitlab-ci.yml I want to re-use conditions using variables. So instead of this: job1: script: - echo "job executed" rules: - if: $CI_COMMIT_REF_SLUG =~ "example" || $MY_VAR == "value" && $CI_COMMIT_REF_SLUG =~ "test" job2: …
Theo
  • 2,262
  • 3
  • 23
  • 49
1
vote
0 answers

Do Gitlab CI/CD resource_groups work across multiple projects?

Is it possible to block a deployment resource with Gitlab's resource_group feature across multiple projects? We have a lot of services which should be deployed to the same resource, but want to avoid running all deployment at the same time. Each…
Rico.Code
  • 71
  • 5
1
vote
1 answer

This GitLab CI configuration is invalid: jobs:windows job:artifacts config contains unknown keys: rules

Does anyone know how to solve my problem? That is my current GitLab CI, which works without an error: stages: - build windows job: image: … stage: build tags: - "Windows" script: - … artifacts: paths: -…
Florian
  • 1,019
  • 6
  • 22
1
vote
2 answers

Gitlab yml include external yml files

I am trying to add my stages to sub yamls, and i need to share them with other repos so i want them to be in a shared repo I have this working with include and local in the .gitlab-ci.yml but when I moved the .yml to a different repo to be shard…
stevied
  • 11
  • 2
1
vote
1 answer

How to trigger pipeline for multiple project from single repo

I have a gitlab repo which has two folders(folder-a and folder-b) in it, I want them to get triggered based on the commit on their folder. Currently I have a single gitlab.yml file which has below configuration. It triggers folder-a but not…
1
vote
0 answers

Gitlab.ci skip job if changes are only in specific files inside a relevant folder

I have this gitlab-ci.yml: build-docker: stage: build-docker rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' changes: - app/Dockerfile - app/requirements.txt when: always -…
1
vote
0 answers

Can we add a new stage in .gitlab-ci other than the stages from the template file

I have a template file which has few stages like: template.yaml stages: - a2 - a3 Now, I have another file .gitlab-ci.yaml which should include stages from above template file, but also needs few more stages: include: - project: 'path to…
Marcelo BD
  • 229
  • 3
  • 8
1
vote
1 answer

Gitlab auto pull

I have repository in GitLab. and I have Test and Dev branches in this repository. In Gitlab pipeline, I schedule a job to auto run Test branch pipeline every 24 hours. in Test .gitlab-ci.yml I have deploy: stage: deploy script: - git pull…
user8231110
  • 153
  • 9
1
vote
0 answers

How to bypass gitlab-runner asking for password for sudo commands or What is the default password for gitlab-runners

I am new to gitlab runners and trying to automate my project so that whenever a new tag is released, it should build a new deb package. PS: I am using mac and following this official link by gitlab to get my task done My first gitlab-ci.yml file…
Thor
  • 113
  • 10
1
vote
0 answers

How to debug Github secrets in Github action YML files?

I am setting up a Soarqube server using Github actions. I want to debug the Github secret but I'm unable to do so. I am attaching .yml file for reference. name: Show Me the S3cr3tz on: # push: # branches-ignore: [master, main] # # Remove…
1 2
3
14 15