Hello,
In the doc (https://docs.drone.io/), the infomation of cron job is not clear.
I want to create a cron job, but it do not work. The yaml configs is:
Can you give me a clear example.
Hello,
In the doc (https://docs.drone.io/), the infomation of cron job is not clear.
I want to create a cron job, but it do not work. The yaml configs is:
Can you give me a clear example.
Hi @chen-s-f you might find this helpful.
Basically, what you need is something like this.
you basically need to use this command: curl -X POST -H "Authorization: Bearer $DRONE_TOKEN" "$DRONE_SERVER/api/repos/foo/bar/cron/every-5-mins"
In simple words:
Hope this helps!
Thanks
Hi Shruthikini,
I tried to add cron job in the UI,such as
Hi Shruthikini,
@chen-s-f say if you have a sample drone file like this:
kind: pipeline
type: kubernetes
name: default
- name: echo-hello
image: alpine
commands:
- echo "hello"
when:
event:
- push
- name: echo-goodbye
image: alpine
commands:
- echo "goodbye"
when:
event:
- push
You should add it in this way. Trigger mean that this whole pipeline will run only when cron runs it.
event:
- cron
cron:
- hourly
to when:
for each section.