1.

Solve : Schedule a cron job in gitlab by using parameters?

Answer» Schedule a cron job in Gitlab by using parameters as trigger NIGHTLY builds

For EXAMPLE:
I have option in Gitlab called schedule and by using that I can schedule a job, but it just triggers a pipeline for that project with default values.

I am configuring it in such a way that my project should trigger on nightly build by using the values provided as a parameter.
Example: for a particular branch the project should trigger and that branch details should come from a YAML file.

So please help me with that.you should be able to configure and schedule different builds with yaml variables and conditional rules:

https://docs.gitlab.com/ee/ci/pipelines/schedules.html#using-variables

More about the yaml syntax:

https://docs.gitlab.com/ee/ci/yaml/index.htmlI have scheduled a pipeline using cron job. But my requirement is like in the gitlab.yml file we cannot include this below code.
I need to call it from somewhere outside but I am not getting how to call a nightly build for a project without using the main Gitlab project gitlab.yml file

Code: [Select]CURL --request POST \
--form token=TOKEN \
--form ref=main \
--form "[RUN_NIGHTLY_BUILD]=true" \
"https://gitlab.example.com/api/v4/projects/9/trigger/pipeline"
It sounds like you are learning Gitlab as a beginner, is that correct? Is this for school?

If you provide some context of what your project is for, I can TRY to refer you to INFORMATION that might help.I am an employee, but started working on Gitlab from past one year, but this one sounds interesting and this type of builds may use in our projects so I was trying out on my own.

Details of project is, Project has its own pipeline set-up already. But to run it as a scheduled nightly build I am trying out the above curl statement. So please help me on that.Gotcha. I strongly recommend you post your question directly on the Gitlab forums:

https://forum.gitlab.com/

That's where you'll get the best advice.


Discussion

No Comment Found