From 934d6564cbe05082194252a5410495ffa3ced40a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 22 Oct 2019 10:25:20 +0300 Subject: Change: static website building to be incremental This makes updates of my journal take as little as 10% of the time to build. --- ci-prod-websites.ick | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/ci-prod-websites.ick b/ci-prod-websites.ick index 3be639b..43fe74c 100644 --- a/ci-prod-websites.ick +++ b/ci-prod-websites.ick @@ -46,7 +46,7 @@ projects: - ick/add_apt_sources - ick/restore_workspace - ick/get_sources - - ikiwiki_subplot_publish + - ikiwiki_subplot_incremental - ick/save_workspace - project: journal.liw.fi @@ -169,9 +169,12 @@ pipelines: env = dict(os.environ) env['LC_ALL'] = 'fi_FI.UTF8' + build = '--rebuild' dirname = 'src' - RUN('rm', '-rf', 'html') RUN('find', '-ls') + if os.path.exists('dot-ikiwiki'): + RUN('mv', 'dot-ikiwiki', 'src/.ikiwiki') + build = '--refresh' RUN('sed', '-i', '/^srcdir:/d', 'src/ikiwiki.setup', env=env) RUN('sed', '-i', '/^destdir:/d', 'src/ikiwiki.setup', env=env) with open('src/ikiwiki.setup', 'a') as f: @@ -179,12 +182,51 @@ pipelines: f.write('destdir: /workspace/html\n') RUN('ikiwiki', '--setup', 'src/ikiwiki.setup', '--verbose', '--libdir', '/workspace/ikiwiki', - '--refresh', '--gettime', env=env) + '--gettime', build, env=env) + RUN('mv', 'src/.ikiwiki', 'dot-ikiwiki') where: container - action: rsync where: host + - pipeline: ikiwiki_subplot_incremental + parameters: + - sources + - rsync_src + - rsync_target + actions: + - where: container + shell: | + apt-get update + apt-get install -y subplot + + # "Install" the plugin so ikiwiki can find it + find -ls + mkdir -p ikiwiki/IkiWiki/Plugin + mv ikiwiki-pandoc/pandoc.pm ikiwiki/IkiWiki/Plugin + + rm -rf src # we don't use this, or ikiwiki will always rebuild + + if [ -e build ] + then + (cd build && git pull) + opt=--refresh + else + git clone .mirrors/source build + opt=--gettime + fi + + cp build/ikiwiki.setup build.setup + sed -i '/srcdir:/d' build.setup + sed -i '/destdir:/d' build.setup + echo 'srcdir: /workspace/build' >> build.setup + echo 'destdir: /workspace/html' >> build.setup + + ikiwiki --setup build.setup --libdir /workspace/ikiwiki $opt + + - action: rsync + where: host + - pipeline: publish_vmdb2_manual parameters: - rsync_src -- cgit v1.2.1