Skip to content

Commit

Permalink
Add option to deploy a mirror to Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Jul 19, 2017
1 parent b84ff30 commit ec0da2c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .d-compiler
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ldc-1.3.0
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
language: d
d:
- dmd
# Heroku deployment compiler
- ldc-1.3.0
sudo: false
3 changes: 3 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default_process_types:
web: ./dub-registry --port $PORT --mirror=https://code.dlang.org --hostname=dub-registry.heroku.com --separate-cron --vv --bind 0.0.0.0
cron: ./dub-registry --mirror=https://code.dlang.org --run-cron --vv
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,21 @@ DUB registry
![vibe.d logo](public/images/logo-small.png) Online registry for [dub](https://github.com/dlang/dub/) packages, see <http://code.dlang.org/>.

[![Build Status](https://travis-ci.org/dlang/dub-registry.svg)](https://travis-ci.org/dlang/dub-registry)

Deploy your own mirror
----------------------

[![Deploy your own Mirror](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/dlang/dub-registry)

After you have added your mirror, you should configure a daily or hourly cron job.
Select the "Scheduler" addon and add the following task:

```
./dub-registry --mirror=https://code.dlang.org --run-cron --vv
```

![Adding a scheduler](https://user-images.githubusercontent.com/4370550/28348195-d8802622-6c3b-11e7-9b9e-55d120340cef.png)

To trigger the cron manually and populate the database initially, you can execute `heroku run crob` (on the Web interface via "More" -> "Run console")

![Running "cron" via "Run console" on heroku.com](https://user-images.githubusercontent.com/4370550/28348211-ff6b6f1c-6c3b-11e7-84fa-bb818232a8c9.png)
23 changes: 23 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "DUB registry (mirror)",
"description": "A mirror of code.dlang.org",
"repository": "https://github.com/dub/dub-registry",
"website": "https://github.com/dub/dub-registry",
"logo": "https://dlang.org/images/dlogo_opengraph.png",
"keywords": ["d", "dlang", "dub", "registry", "mirror"],
"buildpacks": [
{
"url": "http://github.com/MartinNowak/heroku-buildpack-d.git"
}
],
"addons": [
{
"plan": "mongolab:sandbox",
"as": "MONGO"
},
{
"plan": "scheduler:standard",
"as": "SCHEDULER"
}
]
}

0 comments on commit ec0da2c

Please sign in to comment.