summaryrefslogtreecommitdiff
path: root/ci-prod-websites.ick
blob: 5dbddde2147c7b94cc05eb8c06c434f4d667bf67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
projects:

- project: website-template
  parameters: &website_params
    rsync_src: html
    systree_name: systrees-debian-buster-website
    notify: [liw@liw.fi]
    apt_sources:
      - url: http://ci-prod-controller.vm.liw.fi/debian
        dist: unstable-ci
        section: main
    apt_signing_pub_keys:
      ci-prod: |
        -----BEGIN PGP PUBLIC KEY BLOCK-----

        mQINBFrLO7kBEADdz6mHstYmKU5Dp6OSjxWtWaqTDOX1sJdmmaIK/9EKVIH0Maxp
        5kvVO5G6mULLAjv/kLG0MxasHPrq8I2A/y8AqKAGVL8QelwLjQMIFZ30/VbGQPHS
        +T5TZXEnoQtNce1GUhFwJ38ZyjjwHBFV9tSec7rZ2Q3YeM3nNnGPf6DacXGfEOPO
        HIN4sXAN2hzNXNjKRzTIvxQseb6nr7afUh/SlZ3yhQOCrIzmYlD7tP9WJe7ofL0p
        JY4pDQYw8rT6nC2BE/ioemh84kERCT1vCe+OVFlSRuMlqfEv+ZpKQ+itOmPDQ/lM
        jpUm1K2hrW/lWpxT/ZxHKo/w1K36J5WshgMZxfUu5BMCL9LMqMcrXNhNjDMfxDMM
        3yBPOvQ4ls6fecOZ/bsFo1p8VzMk/w/eG8vPs5yuNa5XxN95yFMXoOHGb5Xbu8D4
        6yiW+Af70LbiSNpGdmNdneiGB2fY38NxBukPw5u3S5qG8HedSmMr1RvSr5kHoAAe
        UbOY+BYaaKsTAT7+1skUW1o3FJSqoRKCHAzTsMWC6zzhR8hRn7jVrrguH1hGbqq5
        TZSCFQZExuTJ7uXrTLG0WoBXIjB5wWNcSeXn8myUWYB51nJNF4tJBouZOz9JwWGl
        kiAQkrHnBttLQWdW9FyjbIoTZMtpvVx+m6ObGTGdGL1cNlLAvWprMXGc+QARAQAB
        tDJJY2sgQVBUIHJlcG9zaXRvcnkgc2lnbmluZyBrZXkgKDIwMTgpIDxsaXdAbGl3
        LmZpPokCTgQTAQgAOBYhBKL1uyDoXyxUH3O717Wr+TZVS6PGBQJayzu5AhsDBQsJ
        CAcCBhUICQoLAgQWAgMBAh4BAheAAAoJELWr+TZVS6PGB5QQANTcikhRUHwt9N4h
        dGc/Hp6CbqdshMoWlwpFskttoVDxQG5OAobuZl5XyzGcmja1lT85RGkZFfbca0IZ
        LnXOLLSAu51QBkXNaj4OhjK/0uQ+ITrvL6RQSXNgHiUTR/W2XD1GIUq6nBqe2GSN
        31S1baYKKVj5QIMsi7Dq8ls3BBXuPCE+xTSaNmGWjes2t9pPidcRvxsksCLY1qgw
        P1GFXBeMkBQ29kBP87SUL15SIk7OiQLlEURCy5iRls5rt/YEsdEpRWIb0Tm5Nrjv
        2M3VM+iBhfNXTwj0rJ34mlycF1qQmA7YcTEobT7z587GPY0VWzBpQUnEQj7rQWPM
        cDYY0b+I6kQ8VKOaL4wVAtE98d7HzFIrIrwhTKufnrWrVDPYsmLZ+LPC1jiF7JBD
        SR6Vftb+SdDR9xoE1yRuXbC6IfoW+5/qQNrdQ2mm9BFw5jOonBqchs18HTTf3441
        6SWwP9fY3Vi+IZphPPi0Gf85oMStgnv/Wnw6LacEL32ek39Desero/D8iGLZernK
        Q2mC9mua5A/bYGVhsNWyURNFkKdbFa+/wW3NfdKYyZnsSfo+jJ2luNewrhAY7Kod
        GWXTer9RxzTGA3EXFGvNr+BBOOxSj0SfWTl0Olo7J5dnxof+jLAUS1VHpceHGHps
        GSJSdir7NkZidgwoCPA7BTqsb5LN
        =dXB0
        -----END PGP PUBLIC KEY BLOCK-----
  pipelines: &website_pipelines 
    - ick/setup_container
    - ick/add_apt_signing_keys
    - ick/add_apt_sources
    - ick/restore_workspace
    - ick/get_sources
    - ikiwiki_subplot_incremental
    - ick/save_workspace

- project: ideas.liw.fi
  parameters:
    <<: *website_params
    workspace_name: ideas.liw.fi
    rsync_src: publish
    rsync_target: ickliwfi@ideas.liw.fi:/srv/http/ideas.liw.fi
    sources:
      - name: source
        ref: master
        location: src
        repo: ssh://git@git.liw.fi/ideas
  pipelines:
    - ick/setup_container
    - ick/add_apt_signing_keys
    - ick/add_apt_sources
    - ick/restore_workspace
    - ick/get_sources
    - build_and_publish_subplots

- project: journal.liw.fi
  parameters:
    <<: *website_params
    workspace_name: journal.liw.fi
    rsync_target: ickliwfi@journal.liw.fi:/srv/http/journal.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: ssh://git@git.liw.fi/private/liw/Journal
  pipelines: *website_pipelines

- project: noir.liw.fi
  parameters:
    <<: *website_params
    workspace_name: noir.liw.fi
    rsync_target: ickliwfi@noir.liw.fi:/srv/http/noir.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: git://git.liw.fi/noir.liw.fi
  pipelines: *website_pipelines

- project: vmdb2.liw.fi
  parameters:
    <<: *website_params
    workspace_name: vmdb2.liw.fi
    rsync_target: ickliwfi@vmdb2.liw.fi:/srv/http/vmdb2.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: git://git.liw.fi/vmdb2.liw.fi
  pipelines: *website_pipelines

- project: vmdb2-manual
  parameters:
    sources:
      - name: source
        ref: master
        location: src
        repo: git://git.liw.fi/vmdb2
    rsync_src: html
    rsync_target: ickliwfi@vmdb2-manual.liw.fi:/srv/http/vmdb2-manual.liw.fi
    systree_name: systrees-debian-buster-website
    notify: [liw@liw.fi]
  pipelines:
    - ick/setup_container
    - ick/get_sources
    - publish_vmdb2_manual
    
- project: manifesto
  parameters:
    <<: *website_params
    workspace_name: manifesto.liw.fi
    rsync_target: ickliwfi@manifesto.liw.fi:/srv/http/manifesto.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: ssh://git@git.liw.fi/private/liw/manifesto
  pipelines: *website_pipelines
    
- project: ick.liw.fi
  parameters:
    <<: *website_params
    workspace_name: ick.liw.fi
    rsync_target: ickliwfi@ick.liw.fi:/srv/http/ick.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: git://git.liw.fi/ick.liw.fi
  pipelines: *website_pipelines


- project: subplot.liw.fi
  parameters:
    <<: *website_params
    workspace_name: subplot.liw.fi
    rsync_target: ickliwfi@subplot.liw.fi:/srv/http/subplot.liw.fi
    sources:
      - name: pandoc-plugin
        ref: master
        location: ikiwiki-pandoc
        repo: https://github.com/sciunto-org/ikiwiki-pandoc.git
      - name: source
        ref: master
        location: src
        repo: git://git.liw.fi/subplot.liw.fi
    notify:
      - liw@liw.fi
      - dsilvers@digital-scurf.org
  pipelines: *website_pipelines

pipelines:

  - pipeline: ikiwiki_subplot_publish
    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

      - python: |
          import os, re

          env = dict(os.environ)
          env['LC_ALL'] = 'fi_FI.UTF8'

          build = '--rebuild'
          dirname = 'src'
          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:
            f.write('srcdir: /workspace/src\n')
            f.write('destdir: /workspace/html\n')
          RUN('ikiwiki', '--setup', 'src/ikiwiki.setup',
              '--verbose', '--libdir', '/workspace/ikiwiki',
              '--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 make pandoc texlive-latex-base \
            texlive-latex-recommended texlive-fonts-recommended \
            pandoc-citeproc librsvg2-bin graphviz

          # "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=--rebuild
          else
              git clone .mirrors/source build
              opt=--gettime
          fi
          (cd build && git show)

          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 --verbose --setup build.setup --libdir /workspace/ikiwiki $opt

      - action: rsync
        where: host

  - pipeline: publish_vmdb2_manual
    parameters:
      - rsync_src
      - rsync_target
    actions:
      - shell: |
          apt update
          apt dist-upgrade -y
          apt install -y pandoc texlive texlive-xetex fonts-freefont-ttf
          mkdir html
          cd src
          ./format.sh
          cp vmdb2.html ../html/index.html
          cp vmdb2.pdf ../html/vmdb2.pdf
        where: container

      - action: rsync
        where: host

  - pipeline: build_and_publish_subplots
    parameters:
      - sources
      - rsync_src
      - rsync_target
    actions:
      - where: container
        shell: |
          apt-get update
          apt-get install -y subplot make pandoc texlive-latex-base \
            texlive-latex-recommended texlive-fonts-recommended \
            pandoc-citeproc librsvg2-bin graphviz
          mkdir publish
          cd src
          make
          cp *.html *.pdf /workspace/publish

      - action: rsync
        where: host