-
Notifications
You must be signed in to change notification settings - Fork 27
/
.jobserv.yml
47 lines (39 loc) · 1.78 KB
/
.jobserv.yml
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
timeout: 10
triggers:
- name: Code Review
type: github_pr
runs:
- name: docs
container: python:3.9-alpine
host-tag: fio-internal-ci
script: make-docs
- name: link-check
container: python:3.9-alpine
host-tag: fio-internal-ci
script: link-check
scripts:
make-docs: |
#!/bin/sh -ex
apk add --update make git graphviz curl ttf-freefont gcc musl-dev python3-dev
pip install -r ./requirements.txt
echo == $(date "+%F %T") Setting up fioctl docs
export fv=$(wget -q -O- https://api.github.com/repos/foundriesio/fioctl/releases/latest | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/')
wget -O /tmp/fioctl https://github.com/foundriesio/fioctl/releases/download/${fv}/fioctl-linux-amd64
chmod +x /tmp/fioctl
/tmp/fioctl gen-rst ./source/reference-manual/factory/fioctl/
make OUTDIR=/archive SPHINXBUILD=sphinx-build singlehtml html
urlbase="https://ci.foundries.io/projects/${H_PROJECT}/builds/${H_BUILD}/${H_RUN}/"
set +x # cleaner output and don't leak the secret token below
echo == $(date "+%F %T") HTML browsable at: ${urlbase}artifacts/html/index.html
echo == $(date "+%F %T") Single HTML browsable at: ${urlbase}artifacts/singlehtml/index.html
tok=$(cat /secrets/githubtok)
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token $tok" \
-d "{\"body\": \"Docs for ${GIT_SHA} are browsable at: ${urlbase}artifacts/html/index.html\"}" \
"https://api.github.com/repos/foundriesio/docs/issues/${GH_PRNUM}/comments"
link-check: |
#!/bin/sh -ex
apk add --update make git graphviz curl ttf-freefont gcc musl-dev python3-dev
pip install -r ./requirements.txt
make BUILDDIR=/archive SPHINXBUILD=sphinx-build linkcheck