forked from PowerDNS/pdns
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (149 loc) · 7.68 KB
/
documentation.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
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
---
name: 'Documentation'
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build-upload-docs:
name: Build and upload docs
runs-on: ubuntu-22.04
env:
SERVICE_IP_ADDR: 127.0.0.1
services:
database:
image: epicwink/proxpi
ports:
- 5000:5000
options: >-
--restart always
outputs:
pip-list-auth: ${{ steps.pip-logs-auth.outputs.list-auth }}
pip-list-rec: ${{ steps.pip-logs-rec.outputs.list-rec }}
pip-list-dnsdist: ${{ steps.pip-logs-dnsdist.outputs.list-dnsdist }}
steps:
- uses: PowerDNS/pdns/set-ubuntu-mirror@meta
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
# Configure pip index-url set to proxpi
- run: pip config set global.index-url http://${{ env.SERVICE_IP_ADDR }}:5000/index/
- run: pip config set global.trusted-host ${{ env.SERVICE_IP_ADDR }}
- id: proxpi-docker
run: echo "id=$(docker ps | grep "epicwink/proxpi" | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- run: build-scripts/gh-actions-setup-inv-no-dist-upgrade # this runs apt update
- run: inv install-doc-deps
- run: inv install-doc-deps-pdf
- id: get-version
run: |
echo "pdns_version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- id: setup-ssh
run: |-
inv ci-docs-add-ssh --ssh-key="$SSH_KEY" --host-key="$HOST_KEY"
echo "have_ssh_key=yes" >> $GITHUB_OUTPUT
env:
SSH_KEY: ${{secrets.WEB1_DOCS_SECRET}}
HOST_KEY: ${{vars.WEB1_HOSTKEY}}
if: ${{github.ref_name == 'master' && env.SSH_KEY != ''}}
# Auth
- run: inv ci-docs-build
- run: mv html auth-html-docs
working-directory: ./docs/_build
- run: tar cf auth-html-docs.tar auth-html-docs
working-directory: ./docs/_build
- uses: actions/upload-artifact@v4
with:
name: authoritative-html-docs-${{steps.get-version.outputs.pdns_version}}
path: ./docs/_build/auth-html-docs.tar
- run: bzip2 auth-html-docs.tar
if: ${{github.ref_name == 'master'}}
working-directory: ./docs/_build
- run: inv ci-docs-build-pdf
- uses: actions/upload-artifact@v4
with:
name: PowerDNS-Authoritative-${{steps.get-version.outputs.pdns_version}}.pdf
path: ./docs/_build/latex/PowerDNS-Authoritative.pdf
- run: inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="PowerDNS-Authoritative.pdf" --username="docs_powerdns_com" --product="auth" --directory="/${AUTH_DOCS_DIR}/"
env:
DOCS_HOST: ${{vars.DOCS_HOST}}
AUTH_DOCS_DIR: ${{vars.AUTH_DOCS_DIR}}
if: ${{github.ref_name == 'master' && steps.setup-ssh.outputs.have_ssh_key != ''}}
- run: docker logs ${{ steps.proxpi-docker.outputs.id }} 2>&1 | grep whl | awk '{print $8}' | cut -d "/" -f 4 | awk -F'-' '{print $1"=="$2}' | sort -u --ignore-case > /tmp/proxpi-auth.log
- id: pip-logs-auth
run: echo "list-auth=$(cat /tmp/proxpi-auth.log | base64 -w0)" >> "$GITHUB_OUTPUT"
- run: sudo sh -c "truncate -s 0 /var/lib/docker/containers/${{ steps.proxpi-docker.outputs.id }}*/${{ steps.proxpi-docker.outputs.id }}*-json.log"
# Rec
- run: inv ci-docs-rec-generate
working-directory: ./pdns/recursordist/settings
- run: inv ci-docs-build
working-directory: ./pdns/recursordist
- run: mv html rec-html-docs
working-directory: ./pdns/recursordist/docs/_build
- run: tar cf rec-html-docs.tar rec-html-docs
working-directory: ./pdns/recursordist/docs/_build
- uses: actions/upload-artifact@v4
with:
name: recursor-html-docs-${{steps.get-version.outputs.pdns_version}}
path: ./pdns/recursordist/docs/_build/rec-html-docs.tar
- run: bzip2 rec-html-docs.tar
if: ${{github.ref_name == 'master'}}
working-directory: ./pdns/recursordist/docs/_build
- run: inv ci-docs-build-pdf
working-directory: ./pdns/recursordist
- uses: actions/upload-artifact@v4
with:
name: PowerDNS-Recursor-${{steps.get-version.outputs.pdns_version}}.pdf
path: ./pdns/recursordist/docs/_build/latex/PowerDNS-Recursor.pdf
- run: inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="PowerDNS-Recursor.pdf" --username="docs_powerdns_com" --product="rec" --directory="/${REC_DOCS_DIR}/"
env:
DOCS_HOST: ${{vars.DOCS_HOST}}
REC_DOCS_DIR: ${{vars.REC_DOCS_DIR}}
if: ${{github.ref_name == 'master' && steps.setup-ssh.outputs.have_ssh_key != ''}}
working-directory: ./pdns/recursordist
- run: docker logs ${{ steps.proxpi-docker.outputs.id }} 2>&1 | grep whl | awk '{print $8}' | cut -d "/" -f 4 | awk -F'-' '{print $1"=="$2}' | sort -u --ignore-case > /tmp/proxpi-rec.log
- id: pip-logs-rec
run: echo "list-rec=$(cat /tmp/proxpi-rec.log | base64 -w0)" >> "$GITHUB_OUTPUT"
- run: sudo sh -c "truncate -s 0 /var/lib/docker/containers/${{ steps.proxpi-docker.outputs.id }}*/${{ steps.proxpi-docker.outputs.id }}*-json.log"
# DNSdist
- run: inv ci-docs-build
working-directory: ./pdns/dnsdistdist
- run: mv html dnsdist-html-docs
working-directory: ./pdns/dnsdistdist/docs/_build
- run: tar cf dnsdist-html-docs.tar dnsdist-html-docs
working-directory: ./pdns/dnsdistdist/docs/_build
- uses: actions/upload-artifact@v4
with:
name: dnsdist-html-docs-${{steps.get-version.outputs.pdns_version}}
path: ./pdns/dnsdistdist/docs/_build/dnsdist-html-docs.tar
- run: bzip2 dnsdist-html-docs.tar
if: ${{github.ref_name == 'master'}}
working-directory: ./pdns/dnsdistdist/docs/_build
- run: inv ci-docs-build-pdf
working-directory: ./pdns/dnsdistdist
- uses: actions/upload-artifact@v4
with:
name: dnsdist-${{steps.get-version.outputs.pdns_version}}.pdf
path: ./pdns/dnsdistdist/docs/_build/latex/dnsdist.pdf
- run: inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="dnsdist.pdf" --username="dnsdist_org" --product="dnsdist"
env:
DOCS_HOST: ${{vars.DOCS_HOST}}
if: ${{github.ref_name == 'master' && steps.setup-ssh.outputs.have_ssh_key != ''}}
working-directory: ./pdns/dnsdistdist
- run: docker logs ${{ steps.proxpi-docker.outputs.id }} 2>&1 | grep whl | awk '{print $8}' | cut -d "/" -f 4 | awk -F'-' '{print $1"=="$2}' | sort -u --ignore-case > /tmp/proxpi-dnsdist.log
- id: pip-logs-dnsdist
run: echo "list-dnsdist=$(cat /tmp/proxpi-dnsdist.log | base64 -w0)" >> "$GITHUB_OUTPUT"
validate-pip-hashes:
name: Validate list of packages and hashes
runs-on: ubuntu-22.04
needs: build-upload-docs
steps:
- uses: actions/checkout@v4
- run: for i in `echo "${{ needs.build-upload-docs.outputs.pip-list-auth }}" | base64 -d | sed 's/_/-/' | egrep -v "pip==|setuptools==|wheel==|setuptools-git=="`; do grep -qq -i $i docs/requirements.txt || ( echo "$i not found" && exit 1 ); done
- run: for i in `echo "${{ needs.build-upload-docs.outputs.pip-list-rec }}" | base64 -d | sed 's/_/-/' | egrep -v "pip==|setuptools==|wheel==|setuptools-git=="`; do grep -qq -i $i docs/requirements.txt || ( echo "$i not found" && exit 1 ); done
working-directory: ./pdns/recursordist
- run: for i in `echo "${{ needs.build-upload-docs.outputs.pip-list-dnsdist }}" | base64 -d | sed 's/_/-/' | egrep -v "pip==|setuptools==|wheel==|setuptools-git=="`; do grep -qq -i $i docs/requirements.txt || ( echo "$i not found" && exit 1 ); done
working-directory: ./pdns/dnsdistdist