This application is hosted on Heroku, but it can also be executed in production mode locally.
It is designed to do the following:
- Use a cron schedule to execute the
cron.shscript at the beginning of every hour- The
cron.shscript creates agit-tmpdirectory that is destroyed upon completion
- The
- The
cron.shscript defers most of the processing tohubcap.py hubcap.pycreates a JSON spec file for each package+version combo within thegit-tmp/hub/data/packages/directory- It opens pull requests against dbt-labs/hub.getdbt.com for any new versions of dbt packages
The commands below assume a production application named dbt-hubcap. Replace with dbt-hubcap-staging for the staging version of the application.
- Use the Heroku Scheduler to set the following cron schedule:
- Job:
./cron.sh - Schedule: Every hour at :00
- Dyno size: Hobby / Standard-1X
- Job:
- Configure the
CONFIGandENVenvironment variables: Settings > Config Vars > Reveal Config VarsCONFIG: copy format fromconfig.example.jsonand adjust values as neededENV:prod
- (Re-)deploy the application using the instructions below. See these instructions for context.
It is possible to configure automatic deploys from GitHub to deploy automatically whenever a specific branch is pushed to: Deploy > Deployment method > GitHub > Connect to GitHub.
All of the following steps can be performed locally to initiate a remote deploy on Heroku.
Download and install the Heroku CLI.
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
heroku loginTo deploy or re-deploy the latest changes:
git clone git@github.com:dbt-labs/hubcap.git
cd hubcap
git pull origin
git checkout main
heroku git:remote -a dbt-hubcap
git push heroku main:mainheroku is the remote that Heroku will use for deploys. origin is the source code hosted on GitHub.
Pulling from origin will get the latest code in GitHub. Pushing to heroku will deploy that latest code to the Heroku app.
You can use the following command to list the tracked repositories:
git remote -vThe result should be something like the following:
heroku https://git.heroku.com/dbt-hubcap.git (fetch)
heroku https://git.heroku.com/dbt-hubcap.git (push)
origin git@github.com:dbt-labs/hubcap.git (fetch)
origin git@github.com:dbt-labs/hubcap.git (push)