Skip to content

Commit 80eb6f2

Browse files
committed
improved script to update readme and index
1 parent ae7f938 commit 80eb6f2

6 files changed

Lines changed: 50 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ MRQ was first developed at [Pricing Assistant](http://pricingassistant.com) and
1515
# Main Features
1616

1717
* **Simple code:** We originally switched from Celery to RQ because Celery's code was incredibly complex and obscure ([Slides](http://www.slideshare.net/sylvinus/why-and-how-pricing-assistant-migrated-from-celery-to-rq-parispy-2)). MRQ should be as easy to understand as RQ and even easier to extend.
18-
* **Great [dashboard](dashboard.md):** Have visibility and control on everything: queued jobs, current jobs, worker status, ...
18+
* **Great [dashboard](http://mrq.readthedocs.org/en/latest/dashboard/):** Have visibility and control on everything: queued jobs, current jobs, worker status, ...
1919
* **Per-job logs:** Get the log output of each task separately in the dashboard
2020
* **Gevent worker:** IO-bound tasks can be done in parallel in the same UNIX process for maximum throughput
2121
* **Supervisord integration:** CPU-bound tasks can be split across several UNIX processes with a single command-line flag
2222
* **Job management:** You can retry, requeue, cancel jobs from the code or the dashboard.
2323
* **Performance:** Bulk job queueing, easy job profiling
24-
* **Easy [configuration](configuration.md):** Every aspect of MRQ is configurable through command-line flags or a configuration file
24+
* **Easy [configuration](http://mrq.readthedocs.org/en/latest/configuration):** Every aspect of MRQ is configurable through command-line flags or a configuration file
2525
* **Job routing:** Like Celery, jobs can have default queues, timeout and ttl values.
26-
* **Thorough [testing](tests.md):** Edge-cases like worker interrupts, Redis failures, ... are tested inside a Docker container.
26+
* **Thorough [testing](http://mrq.readthedocs.org/en/latest/tests):** Edge-cases like worker interrupts, Redis failures, ... are tested inside a Docker container.
2727
* **Builtin scheduler:** Schedule tasks by interval or by time of the day
2828
* **Greenlet tracing:** See how much time was spent in each greenlet to debug CPU-intensive jobs.
2929
* **Integrated memory leak debugger:** Track down jobs leaking memory and find the leaks with objgraph.

docs/dashboard.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Dashboard
2-
=========
1+
# Dashboard
32

43
A strong focus was put on the tools and particularly the dashboard. After all it is what you will work with most of the time!
54

docs/dependencies.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ We use LUA scripting in Redis to boost performance and provide extra safety.
1313

1414
You will need [Docker](http://docker.io) to run our unit tests. Our [Dockerfile](https://github.com/pricingassistant/mrq/blob/master/Dockerfile) is actually a good way to see a complete list of dependencies, including dev tools like graphviz for memleak images.
1515

16-
You may want to convert your logs db to a capped collection : ie. run db.runCommand({"convertToCapped": "mrq_jobs", "size": 10737418240})
16+
You may want to convert your logs db to a capped collection : ie. run db.
17+
18+
```
19+
runCommand({"convertToCapped": "mrq_jobs", "size": 10737418240})
20+
```
1721

1822
## Javascript
1923

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ MRQ was first developed at [Pricing Assistant](http://pricingassistant.com) and
1515
# Main Features
1616

1717
* **Simple code:** We originally switched from Celery to RQ because Celery's code was incredibly complex and obscure ([Slides](http://www.slideshare.net/sylvinus/why-and-how-pricing-assistant-migrated-from-celery-to-rq-parispy-2)). MRQ should be as easy to understand as RQ and even easier to extend.
18-
* **Great [dashboard](dashboard.md):** Have visibility and control on everything: queued jobs, current jobs, worker status, ...
18+
* **Great [dashboard](http://mrq.readthedocs.org/en/latest/dashboard/):** Have visibility and control on everything: queued jobs, current jobs, worker status, ...
1919
* **Per-job logs:** Get the log output of each task separately in the dashboard
2020
* **Gevent worker:** IO-bound tasks can be done in parallel in the same UNIX process for maximum throughput
2121
* **Supervisord integration:** CPU-bound tasks can be split across several UNIX processes with a single command-line flag
2222
* **Job management:** You can retry, requeue, cancel jobs from the code or the dashboard.
2323
* **Performance:** Bulk job queueing, easy job profiling
24-
* **Easy [configuration](configuration.md):** Every aspect of MRQ is configurable through command-line flags or a configuration file
24+
* **Easy [configuration](http://mrq.readthedocs.org/en/latest/configuration):** Every aspect of MRQ is configurable through command-line flags or a configuration file
2525
* **Job routing:** Like Celery, jobs can have default queues, timeout and ttl values.
26-
* **Thorough [testing](tests.md):** Edge-cases like worker interrupts, Redis failures, ... are tested inside a Docker container.
26+
* **Thorough [testing](http://mrq.readthedocs.org/en/latest/tests):** Edge-cases like worker interrupts, Redis failures, ... are tested inside a Docker container.
2727
* **Builtin scheduler:** Schedule tasks by interval or by time of the day
2828
* **Greenlet tracing:** See how much time was spent in each greenlet to debug CPU-intensive jobs.
2929
* **Integrated memory leak debugger:** Track down jobs leaking memory and find the leaks with objgraph.

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ requests==2.4.3
1414
# pytest-httpbin==0.0.3
1515

1616
mkdocs==0.11.1
17+
mistune==0.5
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import os
22
import re
3+
import subprocess
4+
import sys
5+
import mistune
6+
37
CURRENT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
48

59

@@ -8,6 +12,11 @@
812
get-started => Get Started
913
"""
1014

15+
res = subprocess.check_output(["git", "branch"])
16+
if "* master" not in res:
17+
print "you have to be on master to run this !"
18+
sys.exit(1)
19+
1120

1221
def get_path(filename):
1322
return os.path.join(CURRENT_DIRECTORY, "..", "docs", "%s.md" % filename)
@@ -35,3 +44,31 @@ def get_path(filename):
3544

3645
with open(readme_path, 'w') as readme_file:
3746
readme_file.write(readme)
47+
48+
subprocess.call(["git", "add", "-p", "README.md"])
49+
subprocess.call(["git", "commit"])
50+
51+
# II. index.html
52+
raw = ""
53+
for filename in ["index", "dashboard", "get-started"]:
54+
with open(get_path(filename), 'r') as f:
55+
raw += f.read()
56+
raw += "\n\n"
57+
subprocess.call(["git", "checkout", "gh-pages"])
58+
html = mistune.markdown(raw)
59+
60+
index_path = os.path.join("index.html")
61+
62+
with open(index_path, 'r') as index_file:
63+
index = index_file.read()
64+
index = re.sub(
65+
r"(<div class=\"row marketing\">)(.*)(</div><!-- row marketing -->)",
66+
r"\1%s\3" % html,
67+
index,
68+
flags=re.MULTILINE | re.DOTALL
69+
)
70+
with open(index_path, 'w') as index_file:
71+
index_file.write(index)
72+
subprocess.call(["git", "add", "-p", "index.html"])
73+
subprocess.call(["git", "commit"])
74+
# subprocess.call(["git", "checkout", "master"])

0 commit comments

Comments
 (0)