Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Run specific jobs in gitlab scheduled pipeline

I have composed a gitlab-ci.yml file consisting of multiple gitlab jobs and stages. Some jobs run on specific git branches when code is merged to that branch and some jobs are scheduled.

I want to create a scheduled CI/CD pipeline in Gitlab which only contains specific scheduled jobs and not all the scheduled jobs. Is that possible?

For Example this is my gitlab-ci.yml file.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

stages:
  build
  test
  deploy
  scheduled-test-1
  scheduled-test-2
  scheduled-test-3

build:
  script:
  - echo $Service_Version
  only:
  - develop
  except:
  - schedules

test:
  script:
  - echo $Service_Version
  only:
  - develop
  except:
  - schedules

deploy:
  script:
  - echo $Service_Version
  only:
  - develop
  except:
  - schedules

scheduled-test-1:
  script:
  - echo $Service_Version
  only:
  - schedules

scheduled-test-2:
  script:
  - echo $Service_Version
  only:
  - schedules

scheduled-test-3:
  script:
  - echo $Service_Version
  only:
  - schedules

Now, when I create a schedule then all the three schedule tests are seen on the pipeline. I want to create three schedules which has scheduled-test-1, scheduled-test-2 and scheduled-test-3 separately. How is that possible?

>Solution :

Use only:variables: and set those variables in your schedules.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading