Skip to content

Commit 19bce85

Browse files
committed
Updating release tools
1 parent b2205e3 commit 19bce85

File tree

3 files changed

+83
-9
lines changed

3 files changed

+83
-9
lines changed

BUILD.rst

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
11
Instructions to create releases
22
===============================
33

4+
5+
Preconditions
6+
-------------
7+
8+
Operating system and Python requirements
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
Generating releases has only been tested on Linux, but it ought to work the
12+
same way also on OSX and other unixes. Creating releases is only supported
13+
with Python 3.6 or newer.
14+
15+
The ``pip`` and ``invoke`` commands below are also expected to run on Python
16+
3.6+. Alternatively, it's possible to use the ``python3.6 -m pip`` approach
17+
to run these commands.
18+
19+
Python dependencies
20+
~~~~~~~~~~~~~~~~~~~
21+
22+
Many steps are automated using the generic `Invoke <http://pyinvoke.org>`_
23+
tool with a help by our `rellu <https://github.com/robotframework/rellu>`_
24+
utilities, but also other tools and modules are needed. A pre-condition is
25+
installing all these, and that's easiest done using `pip
26+
<http://pip-installer.org>`_ and the provided `<requirements.txt>`_ file::
27+
28+
pip install -r requirements.txt
29+
30+
Using Invoke
31+
~~~~~~~~~~~~
32+
33+
Invoke tasks are defined in the `<tasks.py>`_ file and they are executed from
34+
the command line like::
35+
36+
inv[oke] task [options]
37+
38+
Creating release
39+
----------------
40+
441
1. Test that everything works::
542

43+
python demoapp/server.py
644
robot login_tests
745

8-
2. Regenerate log and report if needed using the command documented in wiki.
9-
Same command as above.
10-
11-
3. Move regenerated log and report to
12-
https://bitbucket.org/robotframework/robotframework.bitbucket.org/src/master/WebDemo/
13-
to make them visible online.
46+
2. Move regenerated log and report to docs::
1447

15-
4. Generate a new download package::
48+
inv move-docs
1649

17-
./package.py
50+
5. If README.rst has changed, generate project documentation based on it::
1851

19-
5. Upload the download package to https://bitbucket.org/robotframework/webdemo/downloads
52+
inv project-docs

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Requirements needed when generating releases. See BUILD.rst for details.
2+
invoke >= 0.20
3+
rellu >= 0.6
4+
docutils >= 0.14
5+
robotframework >= 3.1.1

tasks.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from pathlib import Path
2+
import shutil
3+
4+
from docutils.core import publish_cmdline
5+
from invoke import task
6+
from rellu.tasks import clean
7+
8+
9+
assert Path.cwd() == Path(__file__).parent
10+
11+
@task
12+
def project_docs(ctx):
13+
"""Generate project documentation.
14+
15+
These docs are visible at http://robotframework.org/WebDemo/.
16+
"""
17+
args = ['--stylesheet=style.css,extra.css',
18+
'--link-stylesheet',
19+
'README.rst',
20+
'docs/index.html']
21+
publish_cmdline(writer_name='html5', argv=args)
22+
print(Path(args[-1]).absolute())
23+
24+
@task
25+
def move_docs(ctx):
26+
"""Move report.html and log.html to docs
27+
28+
These docs are visible http://robotframework.org/WebDemo/.
29+
"""
30+
log = Path('./log.html')
31+
report = Path('./report.html')
32+
dest = Path('.') / 'docs'
33+
print(log.absolute())
34+
shutil.copy(log.absolute(), str(dest))
35+
print(report.absolute())
36+
shutil.copy(report.absolute(), str(dest))

0 commit comments

Comments
 (0)