New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing CI/CD #221

Merged
merged 57 commits into from Dec 19, 2018

Conversation

Projects
None yet
2 participants
@e8johan
Copy link
Member

e8johan commented Dec 17, 2018

Current status is:

  • Builds HTML
  • Builds example files
  • Builds pdf
  • Builds epub
  • Builds QtHelp
  • Builds translations
  • Builds releases (e.g. 5.12, dev)

You can find the generated pages here: https://e8johan.github.io/qmlbook/index.html

The setup has been modified according to discussions with @jryannel and now do the following:

  • The docs/ directory is never modified by the build
  • Assets are collected and tared automagically from docs/ch??-*/src directories
  • Asset list files are placed in _build/intermediate/ and are referenced from doc/index.rst and doc/assets/index.rst
  • Dropped support for QtHelp and translations for now - will be reenabled as we go along
  • Added support for building and deploying multiple release branches (named rel_*) in parallel
  • Build setup is documented in TRAVIS.md

The current head version is called master. Future branches will be created based on Qt versions. These will have to be explicitly linked from master as we go along (I guess we put these in the sidebar).

@e8johan e8johan requested a review from jryannel Dec 17, 2018

e8johan added some commits Dec 17, 2018

- Rearranged chapters to avoid chapter list in paver-file.
- Copy assets into _build/html/assets instead of into docs/assets during build.

@e8johan e8johan force-pushed the e8johan:travis branch 3 times, most recently from 2cf731c to 83d8175 Dec 19, 2018

@e8johan e8johan force-pushed the e8johan:travis branch from 83d8175 to 7021147 Dec 19, 2018

@jryannel
Copy link
Contributor

jryannel left a comment

Nice. There is a small code complication in the pavement file, but we can solve this later

pavement.py Outdated


@task
def build_qt():
sh('export QTHELP=True; make qthelp')
sh('qcollectiongenerator _build/qthelp/Qt5CadaquesBook.qhcp')
path('_build/qthelp/Qt5CadaquesBook.qch').copy('assets')
path('_build/qthelp/Qt5CadaquesBook.qch').copy('docs/assets')

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

Why do you copy things to docs folder? This is not an output folder

pavement.py Outdated
with pushd('docs'):
with pushd('assets'):
excludelist = [ './index.rst', './examples-list.txt' ]
for f in filter(lambda x: x not in excludelist, path('.').files('*')):

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

Why do you copy RST files to the output?

pavement.py Outdated
name = '%s-assets.tgz' % ch
with pushd('docs'):

chapters = [ 'meetqt',

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

too complicated. To much manual code. Need to find better solution

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

We should just rename the chapter to ch01-introduction, not sure if this makes life more complicated at other places

pavement.py Outdated
'extensions' ]

examples = []
for c, n in enumerate(chapters, 1):

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

c,n are to cryptic names. Please use more meaningful names

pavement.py Outdated

# files to include from the indexes as all chapters does not have examples
f = open('examples-list.txt', 'w')

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

This should be called "assets-lists.rst" as this is about the assets of the book, not only examples.

Also I think you should create a list in python and then just simply use writelines on the path. (see https://pathpy.readthedocs.io/en/stable/api.html#path.Path.write_lines). Maybe we should also use the new f-string syntax this would cleanup the script big time.

@task
def assets_init():
path('assets').makedirs()
# create _build path assets for generated contents
path('_build').makedirs()

This comment has been minimized.

@jryannel

jryannel Dec 19, 2018

Contributor

you should be able to make
path('_build/html').makedirs_p()
path('_build/intermediate').makedirs_p()

@e8johan e8johan changed the title Implementing CI/CD (WIP) Implementing CI/CD Dec 19, 2018

@e8johan e8johan merged commit 4afceff into qmlbook:master Dec 19, 2018

1 check passed

license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment