blob: 884e7a91784c62fa60c33db9274bfac0c3b6b4dc (
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
|
#!/bin/bash -e
#
# S2I assemble script for the 'kraxel/s2i-jekyll' image.
# The 'assemble' script builds your application source so that it is ready to run.
#
# For more information refer to the documentation:
# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
#
if [[ "$1" == "-h" ]]; then
exec /usr/libexec/s2i/usage
fi
echo "--- debug ---"
id -a
echo "---"
export HOME=/opt/app-root/src
cd $HOME
echo "---> Installing application source ..."
mv /tmp/src ./virtio-spec
echo "---> Building virtio spec ..."
(cd virtio-spec; sh makeall.sh)
echo "---> Move docs output ..."
mkdir output
cp -av virtio-spec/*.{html,css,pdf} virtio-spec/images output
echo "---> CSS fixup ..."
cat <<EOF >> output/*.css
@import url(kraxel.css);
EOF
cat <<EOF >> output/kraxel.css
body {
/* no extra long lines please */
max-width: 100ch;
/* center text */
margin: 0px auto;
/* beautify a bit */
padding: 2ex 2em;
border: 2pt #ccc solid;
}
EOF
echo "---> add HEADER ..."
cat <<EOF >> output/HEADER.html
<h1>virtio specification</h1>
<p>
Built from <a href="$OPENSHIFT_BUILD_SOURCE">$OPENSHIFT_BUILD_SOURCE</a>,
<br>
git commit hash is ${OPENSHIFT_BUILD_COMMIT}.
</p>
<ul>
<li><a href="$(cd output; ls *.html)">online version (html)</a>.
<li><a href="$(cd output; ls *.pdf)">print version (pdf)</a>.
</ul>
<hr>
<h3>Directory index</h3>
EOF
echo "---> add README ..."
cat <<EOF >> output/README.html
<h3>[debug] build environment</h3>
<pre>
$(set)
</pre>
EOF
echo "---> Fix permissions ..."
chmod +x . output
chmod -R +r .
find . | xargs ls -ld
|