Heroku: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 35: | Line 35: | ||
The nginx solo mode (https://github.com/heroku/heroku-buildpack-nginx/blob/master/config/nginx-solo-sample.conf.erb) in the heroku-buildpack-nginx repo seems to be what we want, and the static file hosting is just hosting files located in <code>/app/public</code>. | The nginx solo mode (https://github.com/heroku/heroku-buildpack-nginx/blob/master/config/nginx-solo-sample.conf.erb) in the heroku-buildpack-nginx repo seems to be what we want, and the static file hosting is just hosting files located in <code>/app/public</code>. | ||
==Scheduled Tasks== | |||
[https://devcenter.heroku.com/articles/clock-processes-python Heroku article on scheduled tasks] | |||
Normally if you have your own server, you would schedule tasks using cron. | |||
If you are on a Heroku node, you must resort to higher-level options. Here are a few: | |||
* use the Heroku Scheduler Add-On: https://elements.heroku.com/addons/scheduler(10 minute, hourly, or daily intervals or multiples thereof only) | |||
* Celery (Python library) - powerful robust task queue/message system software that supports scheduled tasks | |||
* APScheduler (Python library) - lightweight in-process task scheduler | |||
===Heroku Scheduler Add-On=== | |||
To install the heroku scheduler add-on: | |||
<pre> | |||
$ heroku addons:create scheduler:standard | |||
</pre> | |||
===Celery=== | |||
{{Main|Heroku/Celery}} | |||
Celery: http://www.celeryproject.org/ | |||
===APScheduler=== | |||
{{Main|Heroku/APScheduler}} | |||
APScheduler (Advanced Python Scheduler): https://apscheduler.readthedocs.io/en/3.0/ | |||
Revision as of 22:41, 1 November 2018
heroku is a platform as a service for running web apps.
heroku: https://www.heroku.com/
platform as a service: https://en.wikipedia.org/wiki/Platform_as_a_service
Install heroku toolbelt using homebrew:
$ brew install heroku-toolbelt
Now update heroku client:
$ heroku update
Pipelines
To make a pipeline:
CI/deployment process has three steps:
- Development
- Staging
- Production
When you create a heroku pipeline, it creates a set of applications, one for each step of the CI/deployment process.
You can link the pipeline to a Github repo, and that enables you to make changes to the repo by making changes from Heroku directly.
I am not following these instructions well (https://devcenter.heroku.com/articles/pipelines) because they deviate from what I see. I'm getting very confused about apps, when apps are created, how they are created, when I need a production app, when an app is real, etc.
The nginx solo mode (https://github.com/heroku/heroku-buildpack-nginx/blob/master/config/nginx-solo-sample.conf.erb) in the heroku-buildpack-nginx repo seems to be what we want, and the static file hosting is just hosting files located in /app/public.
Scheduled Tasks
Heroku article on scheduled tasks
Normally if you have your own server, you would schedule tasks using cron.
If you are on a Heroku node, you must resort to higher-level options. Here are a few:
- use the Heroku Scheduler Add-On: https://elements.heroku.com/addons/scheduler(10 minute, hourly, or daily intervals or multiples thereof only)
- Celery (Python library) - powerful robust task queue/message system software that supports scheduled tasks
- APScheduler (Python library) - lightweight in-process task scheduler
Heroku Scheduler Add-On
To install the heroku scheduler add-on:
$ heroku addons:create scheduler:standard
Celery
Celery: http://www.celeryproject.org/
APScheduler
APScheduler (Advanced Python Scheduler): https://apscheduler.readthedocs.io/en/3.0/