-
I found a workaround :
- I've setup the job as a normal job trigger manually (not cron)
- if the script is success, it uses the rest api to run the rerun the job itself
I use the following REST API https://code.stratdev.fr/~help/api/io.onedev.server.rest.resource.JobRunResource/runBuild with parameters :
var jobRun = new Dictionary<string, object> { ["@type"] = "JobRunOnCommit", ["projectId"] = 42, ["commitHash"] = "b9aeaefe32b133df775f0c65bd70cd17c0e1e123", ["jobName"] = "myjob", ["refName"] = "refs/heads/master", ["reason"] = "Triggered by dotnet script" };could it be possible to change the REST API so when the commitHash is missing, it takes the last commit (HEAD) ?
Thanks
-
Note : this does not work as run a job inside the same job running do not rerun a new one.
Any idea ?
-
Note : this does not work as run a job inside the same job running do not rerun a new one.
This is by design. Convert as an improvement request
-
Name Previous Value Current Value Type
Question
Improvement
-
This is by design. Convert as an improvement request
I found a workaround : I set a "random" string parameter to my job and then, I run the job with a new Guid() value in the parameter. So it "bypass" the single instance build for the same commit hash.
-
Previous Value Current Value Open
Closed
-
I found a workaround : I set a "random" string parameter to my job and then, I run the job with a new Guid() value in the parameter. So it "bypass" the single instance build for the same commit hash.
Yes this is a good idea
| Type |
Improvement
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
Hi Robin,
I hope you are doing well !
I've setup a cron job in Onedev which basically run a script inside a container. I also enable notification when my job failed, I receive email and sms notification.
But due to the nature of the cron job, once my script failed, I received a non stop notification cause the job is executed each 5min.
I would like that when the job is failed, it's disabled.
What about a new step "disable job" when condition "failed" for cron job ?
Thanks for you help