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.

deploy_prod:
  stage: deploy
  script:
  - if [ -n "${UPLOAD}" ]; then bundle exec rake gen_rsync; fi
  environment:
    name: production
    url: https://www.thelonegeek.net
  when: manual
  only:
  - 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.