forked from foundriesio/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jobserv.yml
46 lines (38 loc) · 1.63 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
timeout: 10
triggers:
- name: Code Review
type: github_pr
runs:
- name: docs
container: python:3.6
host-tag: amd64
script: make-docs
- name: link-check
container: python:3.6-alpine
host-tag: multiarch-osf
script: link-check
scripts:
make-docs: |
#!/bin/sh -ex
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 browseable at: ${urlbase}artifacts/html/index.html
echo == $(date "+%F %T") Single HTML browseable 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 browesable 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
pip install -r ./requirements.txt
make BUILDDIR=/archive SPHINXBUILD=sphinx-build linkcheck