How to trigger deploy job of project with api?

Hi, I would like to know how to trigger a job with the api via a simple http push with curl?

This is what I had before I gave up on the idea for the time being.

  stage: deploy
  - if [ -n "${UPLOAD}" ]; then bundle exec rake gen_rsync; fi
    name: production
  when: manual
  - master

The results were inconclusive. the job ran, appeared to succeed but the task I wanted it to run did not execute.

$ if [ -n "${UPLOAD}" ]; then bundle exec rake gen_rsync; fi
Job succeeded

The rake task is supposed to run but did not.

I’d paste the curl command but it appears to have disappeared. it’s not in a file or bash history. :confused:

Assistance is much appreciated.