logdna / logdna-agent

LogDNA Agent streams from log files to your LogDNA account. Works with Linux, Windows, and macOS Servers
https://logdna.com
MIT License
138 stars 55 forks source link

Add a monthly-build-manual job to enable testing #162

Closed mindjiver closed 4 years ago

mindjiver commented 4 years ago

Since there is no way to trigger a cron scheduled build manually lets use the instructions from https://blog.wurbanski.me/posts/2019-10-04-circleci-manual-scheduled-workflows/ to setup a workflow that re-uses the definition from the monthly job but only triggers if a certain parameter is set in the payload sent to the CircleCI API. This way we can use curl to POST in the neccessary parameters and that way test the cron based workflow without having to wait for the cron expression to trigger.

How to verify that this works:

$ curl -X POST --header "Content-Type: application/json" -d '{
    "branch":"add-a-manual-job-to-trigger-monthly-builds",
    "parameters": {
      "run_monthly_build": true
    }
  }' https://circleci.com/api/v2/project/github/logdna/logdna-agent/pipeline?circle-token=${CIRCLE_API_USER_TOKEN}
emily2005 commented 4 years ago

Going forward tho this is how we should absolutely test workflows in circleci instead of creating tags. I am going to leave this PR open a bit in case anyone wants to review it in #golden-path