]> git.ipfire.org Git - thirdparty/pdns.git/blob - .circleci/config.yml
Merge pull request #8737 from Habbie/circleci-pager
[thirdparty/pdns.git] / .circleci / config.yml
1 version: 2.1
2
3 commands:
4 checkout-shallow:
5 description: "Do a shallow checkout of the repository"
6 steps:
7 - run:
8 name: Install git and openssh
9 command: apt-get update && apt-get -qq -y install openssh-client git
10 - run:
11 name: Store the keyid for the git repo
12 command: mkdir -p $HOME/.ssh && ssh-keyscan $(echo ${CIRCLE_REPOSITORY_URL} | sed 's,.*@\([^:]*\):.*,\1,') > $HOME/.ssh/known_hosts
13 - run:
14 name: Clone the repo
15 command: |
16 mkdir -p /opt/project
17 if [ -n "$CIRCLE_PR_NUMBER" ]
18 then
19 echo === Checking out PR "$CIRCLE_PR_NUMBER" from "$CIRCLE_REPOSITORY_URL"
20 git clone --depth 1 $CIRCLE_REPOSITORY_URL /opt/project
21 cd /opt/project
22 git fetch --depth 1 origin +refs/pull/${CIRCLE_PR_NUMBER}/merge
23 git checkout -qf FETCH_HEAD
24 else
25 echo === Checking out branch "${CIRCLE_BRANCH}" from "$CIRCLE_REPOSITORY_URL"
26 git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL /opt/project
27 fi
28 cd /opt/project
29 git --no-pager show -s
30
31 get-workspace:
32 description: "Attach workspace to /opt and symlink checkout into home"
33 steps:
34 - run:
35 name: ensure ca-certificates is installed
36 command: apt-get update && apt-get -qq -y install ca-certificates
37 - attach_workspace:
38 at: /opt
39 - run:
40 name: symlink checkout into home
41 command: rmdir ~/project && ln -s /opt/project ~/project
42 - run:
43 name: include $BASH_ENV for both interactive and non-interactive shells
44 command: echo '. $BASH_ENV' >> $HOME/.bashrc
45
46 install-coverity-tools:
47 description: Install the coverity tools to /usr/local
48 steps:
49 - run:
50 name: Install Coverity tools
51 command: curl -s https://scan.coverity.com/download/linux64 --data "token=${COVERITY_TOKEN}&project=${COVERITY_PROJECT}" | gunzip | tar xvf /dev/stdin --strip-components=1 --no-same-owner -C /usr/local
52
53 add-docs-upload-ssh:
54 description: Add ssh known_hosts fingerprints
55 steps:
56 - run:
57 command: mkdir -p $HOME/.ssh && echo "${DOCS_HOST} ${DOCS_FINGERPRINT}" > $HOME/.ssh/known_hosts
58 - add_ssh_keys:
59 fingerprints:
60 - "3e:0a:aa:2c:30:69:89:f3:eb:17:c1:3f:3b:78:40:7a"
61
62 auth-regress-setup:
63 description: Prepare the environment for auth regression tests
64 steps:
65 - get-workspace
66 - install-auth-deps
67 - run:
68 name: Install test dependencies
69 command: |
70 apt-get -y -qq install \
71 bc \
72 bind9utils \
73 default-jre-headless \
74 dnsutils \
75 ldnsutils \
76 libnet-dns-perl \
77 unbound-host
78 - run:
79 name: Install jdnssectools
80 command: |
81 if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then
82 apt-get install -qq -y wget
83 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
84 tar xfz jdnssec-tools-0.14.tar.gz -C $HOME
85 rm jdnssec-tools-0.14.tar.gz
86 fi
87 echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV
88 - run:
89 name: Allow missing tools in verify-dnssec-zone
90 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
91
92 auth-regress:
93 description: Run one auth regression context
94 parameters:
95 skip:
96 type: string
97 default: ""
98 rootskip:
99 type: string
100 default: ""
101 doroot:
102 type: boolean
103 default: true
104 context:
105 type: string
106 default: ""
107 prefix:
108 type: string
109 default: "/opt/pdns-auth/"
110 steps:
111 - run:
112 workdir: ~/project/regression-tests
113 name: Run << parameters.context >> tests
114 command: |
115 [ -e ./vars ] && . ./vars
116 export
117 rm -rf tests/*/skip
118 for t in << parameters.skip >>
119 do
120 touch tests/$t/skip
121 done
122 PDNS=<< parameters.prefix >>sbin/pdns_server \
123 PDNS2=<< parameters.prefix >>sbin/pdns_server \
124 SDIG=<< parameters.prefix >>bin/sdig \
125 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
126 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
127 SAXFR=<< parameters.prefix >>bin/saxfr \
128 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
129 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
130 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
131 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
132 ./start-test-stop 5300 << parameters.context >>
133 - when:
134 condition: << parameters.doroot >>
135 steps:
136 - run:
137 workdir: ~/project/regression-tests.rootzone
138 name: Run << parameters.context >> tests for the root zone
139 command: |
140 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
141 rm -rf tests/*/skip
142 for t in << parameters.rootskip >>
143 do
144 touch tests/$t/skip
145 done
146 PDNS=<< parameters.prefix >>sbin/pdns_server \
147 PDNS2=<< parameters.prefix >>sbin/pdns_server \
148 SDIG=<< parameters.prefix >>bin/sdig \
149 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
150 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
151 SAXFR=<< parameters.prefix >>bin/saxfr \
152 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
153 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
154 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
155 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
156 ./start-test-stop 5300 << parameters.context >>
157
158 install-recursor-deps:
159 description: "Install all libraries needed for the recursor"
160 steps:
161 - run: apt-get update
162 - run:
163 command: |
164 apt-get install -qq -y \
165 libluajit-5.1 \
166 libboost-all-dev \
167 libcap2 \
168 libssl1.1 \
169 libsystemd0 \
170 libsodium23 \
171 libfstrm0 \
172 libprotobuf17
173
174 install-auth-deps:
175 description: Install all libraries needed to run the auth
176 steps:
177 - run: |
178 apt-get install -qq -y --no-install-recommends \
179 libboost-all-dev \
180 libcdb1 \
181 libcurl4 \
182 libkrb5-3 \
183 libldap-2.4-2 \
184 liblmdb0 \
185 libluajit-5.1-2 \
186 libpq5 \
187 libssl1.1 \
188 libsodium23 \
189 libsystemd0 \
190 default-libmysqlclient-dev \
191 unixodbc
192
193 install-dnsdist-deps:
194 description: "Install all libraries needed for testing dnsdist"
195 steps:
196 - run: apt-get update
197 - run:
198 command: |
199 apt-get install -qq -y \
200 libluajit-5.1 \
201 libboost-all-dev \
202 libcap2 \
203 libcdb1 \
204 libcurl4-openssl-dev \
205 libfstrm0 \
206 libh2o-evloop0.13 \
207 liblmdb0 \
208 libprotobuf17 \
209 libre2-5 \
210 libssl-dev \
211 libsystemd0 \
212 libsodium23 \
213 protobuf-compiler \
214 virtualenv
215
216 install-ixfrdist-deps:
217 description: "Install all libraries needed for testing ixfrdist"
218 steps:
219 - run: apt-get update
220 - run:
221 command: |
222 apt-get install -qq -y \
223 git \
224 libboost-all-dev \
225 libsystemd0 \
226 libyaml-cpp0.6 \
227 virtualenv
228
229 install-auth-dev-deps:
230 description: Install all packages needed to build the auth
231 steps:
232 - run: apt-get update
233 - run:
234 command: |
235 apt-get install -qq -y --no-install-recommends \
236 autoconf \
237 automake \
238 bison \
239 bzip2 \
240 curl \
241 default-libmysqlclient-dev \
242 flex \
243 g++ \
244 git \
245 libboost-all-dev \
246 libcdb-dev \
247 libcurl4-openssl-dev \
248 libkrb5-dev \
249 libldap2-dev \
250 liblmdb-dev \
251 libluajit-5.1-dev \
252 libpq-dev \
253 libsodium-dev \
254 libsqlite3-dev \
255 libssl-dev \
256 libsystemd-dev \
257 libtool \
258 libyaml-cpp-dev \
259 make \
260 pkg-config \
261 ragel \
262 sqlite3 \
263 systemd \
264 unixodbc-dev \
265 virtualenv \
266 wget
267
268 add-auth-repo:
269 description: "Add the debian repo for the auth"
270 parameters:
271 version:
272 type: string
273 default: "42"
274 distro:
275 type: string
276 default: "debian"
277 release:
278 type: string
279 default: "buster"
280 steps:
281 - run:
282 name: "Install dependencies"
283 command: "apt-get update && apt-get install -qq -y curl gnupg2"
284 - run:
285 name: "Install apt-keys"
286 command: |
287 if [ "<< parameters.version >>" = "master" ]; then
288 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
289 else
290 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
291 fi
292 - run:
293 name: "Add repository"
294 command: |
295 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
296 - run:
297 name: "add pinning"
298 command: |
299 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
300 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
301 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
302 - run:
303 name: update apt cache
304 command: apt-get update
305
306 setup-ccache:
307 description: Install .ccache and set $PATH
308 steps:
309 - run:
310 name: Install ccache
311 command: apt-get update && apt-get -qq -y install ccache
312 - run:
313 name: Setup ccache in $PATH
314 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
315
316 save-ccache-cache:
317 description: Store the .ccache directory
318 parameters:
319 product:
320 type: string
321 default: ""
322 steps:
323 - save_cache:
324 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
325 paths:
326 - ~/.ccache
327
328 restore-cache-ccache:
329 description: Restore the .ccache directory
330 parameters:
331 product:
332 type: string
333 default: ""
334 steps:
335 - setup-ccache
336 - run:
337 name: ensure ca-certificates is installed
338 command: apt-get update && apt-get -qq -y install ca-certificates
339 - restore_cache:
340 keys:
341 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
342 - ccache-cache-{{ arch }}-<< parameters.product >>-
343
344 install-doc-deps:
345 description: Install dependencies needed to build the documentation
346 steps:
347 - run:
348 name: Install dependencies
349 command: |
350 apt-get update && apt-get -qq -y install \
351 autoconf \
352 automake \
353 bison \
354 curl \
355 flex \
356 g++ \
357 git \
358 latexmk \
359 libboost-all-dev \
360 libedit-dev \
361 libluajit-5.1-dev \
362 libssl-dev \
363 make \
364 pkg-config \
365 ragel \
366 rsync \
367 virtualenv
368 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
369 apt-get update && apt-get -qq -y install \
370 texlive-full
371 fi
372
373 build-auth-docs:
374 description: Build documentation
375 steps:
376 - run:
377 name: autoconf
378 command: |
379 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
380 - run:
381 name: configure
382 command: |
383 ./configure \
384 --disable-lua-records \
385 --disable-unit-tests \
386 --without-dynmodules \
387 --without-modules
388 - run:
389 name: build docs
390 command: |
391 make -C docs html-docs
392 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
393 make -C docs all-docs
394 fi
395
396 upload-auth-docs:
397 steps:
398 - run:
399 name: Upload documents
400 command: |
401 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
402 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs/ docs_powerdns_com@${DOCS_HOST}:/authoritative/
403 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/authoritative/
404 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/PowerDNS-Authoritative.pdf docs_powerdns_com@${DOCS_HOST}:/authoritative/
405 fi
406
407 build-recursor-docs:
408 description: Build Recursor documentation
409 steps:
410 - run:
411 name: autoconf
412 command: |
413 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
414 working_directory: ~/project/pdns/recursordist
415 - run:
416 name: configure
417 command: |
418 ./configure \
419 --disable-unit-tests \
420 --disable-protobuf
421 working_directory: ~/project/pdns/recursordist
422 - run:
423 name: build docs
424 command: |
425 make html-docs
426 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
427 make all-docs
428 fi
429 working_directory: ~/project/pdns/recursordist
430
431 upload-recursor-docs:
432 steps:
433 - run:
434 name: Upload documents
435 working_directory: ~/project/pdns/recursordist
436 command: |
437 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
438 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ docs_powerdns_com@${DOCS_HOST}:/recursor/
439 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/recursor/
440 rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf docs_powerdns_com@${DOCS_HOST}:/recursor/
441 fi
442
443 build-dnsdist-docs:
444 description: Build dnsdist documentation
445 steps:
446 - run:
447 name: autoconf
448 command: |
449 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
450 working_directory: ~/project/pdns/dnsdistdist
451 - run:
452 name: configure
453 command: |
454 ./configure \
455 --disable-unit-tests \
456 --disable-protobuf
457 working_directory: ~/project/pdns/dnsdistdist
458 - run:
459 name: build docs
460 command: |
461 make html-docs
462 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
463 make all-docs
464 fi
465 working_directory: ~/project/pdns/dnsdistdist
466
467 upload-dnsdist-docs:
468 steps:
469 - run:
470 name: Upload documents
471 working_directory: ~/project/pdns/dnsdistdist
472 command: |
473 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
474 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@${DOCS_HOST}:
475 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@${DOCS_HOST}:
476 rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@${DOCS_HOST}:
477 fi
478
479 jobs:
480 checkout:
481 resource_class: small
482
483 docker:
484 - image: debian:buster
485
486 steps:
487 - checkout-shallow
488 - persist_to_workspace:
489 root: /opt
490 paths:
491 - project
492
493 check-formatting:
494 docker:
495 - image: debian:buster
496 steps:
497 - run:
498 name: Install dependencies
499 command: |
500 apt-get update && apt-get -qq --no-install-recommends install \
501 clang-format git
502 - get-workspace
503 - run:
504 name: Check formatting
505 command: |
506 ./build-scripts/format-code pdns/recursordist/*.[ch][ch]
507 git diff
508 exit $(git diff | wc -l)
509 working_directory: ~/project
510
511 build-auth:
512 docker:
513 - image: debian:buster
514
515 steps:
516 - get-workspace
517 - install-auth-dev-deps
518 - restore-cache-ccache:
519 product: auth
520 - run:
521 name: autoconf
522 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
523 - run:
524 name: configure
525 command: |
526 CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security" \
527 CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
528 ./configure \
529 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc random tinydns lua2' \
530 --enable-systemd \
531 --enable-tools \
532 --with-lmdb=/usr \
533 --with-libsodium \
534 --prefix=/opt/pdns-auth \
535 --enable-ixfrdist
536 - run:
537 name: build
538 command: make -j3 -k
539 - save-ccache-cache:
540 product: auth
541 - run:
542 name: Install the binaries
543 command: make install
544 - persist_to_workspace:
545 root: /opt
546 paths:
547 - pdns-auth
548
549 test-auth-regress-odbc-sqlite3:
550 resource_class: small
551
552 docker:
553 - image: debian:buster
554 steps:
555 - auth-regress-setup
556 - run:
557 name: Configure ODBC for sqlite
558 command: |
559 cat >> ~/.odbc.ini \<<- __EOF__
560 [pdns-sqlite3-1]
561 Driver = SQLite3
562 Database = ${PWD}/regression-tests/pdns.sqlite3
563 [pdns-sqlite3-2]
564 Driver = SQLite3
565 Database = ${PWD}/regression-tests/pdns.sqlite32
566 __EOF__
567 - run:
568 name: Install ODBC deps
569 command: |
570 apt-get install -qq -y \
571 unixodbc \
572 libsqliteodbc \
573 sqlite3
574 - run:
575 name: Set up sqlite3 odbc testing
576 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
577 workdir: ~/project/regression-tests
578 - auth-regress:
579 context: godbc_sqlite3-nsec3
580 doroot: false # Broken at the moment
581
582 test-auth-regress-odbc-mssql:
583 docker:
584 - image: debian:buster
585 - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
586 environment:
587 - ACCEPT_EULA: Y
588 - SA_PASSWORD: 'SAsa12%%'
589 steps:
590 - auth-regress-setup
591 - run:
592 name: Install ODBC deps
593 command: |
594 apt-get install -qq -y \
595 freetds-bin \
596 tdsodbc \
597 unixodbc
598 - run:
599 name: set up mssql odbc
600 command: |
601 cat >> ~/.odbc.ini \<<- __EOF__
602 [pdns-mssql-docker]
603 Driver=FreeTDS
604 Trace=No
605 Server=127.0.0.1
606 Port=1433
607 Database=pdns
608 TDS_Version=7.1
609 [pdns-mssql-docker-nodb]
610 Driver=FreeTDS
611 Trace=No
612 Server=127.0.0.1
613 Port=1433
614 TDS_Version=7.1
615 __EOF__
616 - run:
617 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
618 - run:
619 name: create database
620 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
621 - run:
622 name: Set up mssql odbc testing
623 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
624 workdir: ~/project/regression-tests
625 - auth-regress:
626 context: godbc_mssql-nodnssec
627 skip: 8bit-txt-unescaped
628 - auth-regress:
629 context: godbc_mssql
630 skip: 8bit-txt-unescaped
631 - auth-regress:
632 context: godbc_mssql-nsec3
633 skip: 8bit-txt-unescaped
634 - auth-regress:
635 context: godbc_mssql-nsec3-optout
636 skip: 8bit-txt-unescaped
637 - auth-regress:
638 context: godbc_mssql-nsec3-narrow
639 skip: 8bit-txt-unescaped
640
641 test-auth-regress-gsqlite3:
642 resource_class: small
643
644 docker:
645 - image: debian:buster
646 steps:
647 - auth-regress-setup
648 - run:
649 command: apt-get install -qq -y sqlite3
650 - auth-regress:
651 context: gsqlite3-nodnssec-both
652 - auth-regress:
653 context: gsqlite3-both
654 - auth-regress:
655 context: gsqlite3-nsec3-both
656 - auth-regress:
657 context: gsqlite3-nsec3-optout-both
658 - auth-regress:
659 context: gsqlite3-nsec3-narrow
660
661 test-auth-regress-bind:
662 resource_class: small
663
664 docker:
665 - image: debian:buster
666 - image: circleci/mysql:5 # for the hybrid test
667 steps:
668 - auth-regress-setup
669 - run:
670 command: apt-get install -qq -y sqlite3
671 - auth-regress:
672 context: bind-both
673 - auth-regress:
674 context: bind-dnssec-both
675 - auth-regress:
676 context: bind-dnssec-nsec3-both
677 - auth-regress:
678 context: bind-dnssec-nsec3-optout-both
679 - auth-regress:
680 context: bind-dnssec-nsec3-narrow
681 - run:
682 command: apt-get install -qq -y default-mysql-client
683 - run:
684 command: |
685 cat >> ~/.my.cnf \<<- __EOF__
686 [client]
687 protocol=TCP
688 __EOF__
689 - run:
690 name: Set up mysql client lib to force TCP
691 command: echo 'export GMYSQLHOST=127.0.0.1' > ./vars
692 workdir: ~/project/regression-tests
693 - auth-regress:
694 context: bind-hybrid-nsec3
695
696 test-auth-regress-gmysql:
697 resource_class: small
698
699 docker:
700 - image: debian:buster
701 - image: circleci/mysql:5
702 steps:
703 - auth-regress-setup
704 - run:
705 command: apt-get install -qq -y default-mysql-client
706 - run:
707 command: |
708 cat >> ~/.my.cnf \<<- __EOF__
709 [client]
710 protocol=TCP
711 default-character-set=latin1
712 __EOF__
713 - run:
714 name: Set up mysql client lib to force TCP
715 command: echo 'export GMYSQLHOST=127.0.0.1 export GMYSQL2HOST=127.0.0.1 ' > ./vars
716 workdir: ~/project/regression-tests
717 - auth-regress:
718 context: gmysql-nodnssec-both
719 - auth-regress:
720 context: gmysql-both
721 - auth-regress:
722 context: gmysql-nsec3-both
723 - auth-regress:
724 context: gmysql-nsec3-optout-both
725 - auth-regress:
726 context: gmysql-nsec3-narrow
727
728 test-auth-regress-gpgsql:
729 resource_class: small
730
731 docker:
732 - image: debian:buster
733 - image: circleci/postgres:9
734 environment:
735 POSTGRES_USER: root
736 steps:
737 - auth-regress-setup
738 - run:
739 command: apt-get install -qq -y postgresql-client
740 - run:
741 name: Use TCP for Postgresql connections
742 command: |
743 cat >> ./vars \<<- __EOF__
744 export PGHOST=127.0.0.1
745 export PGPORT=5432
746 __EOF__
747 workdir: ~/project/regression-tests
748 - auth-regress:
749 context: gpgsql-nodnssec-both
750 - auth-regress:
751 context: gpgsql-both
752 - auth-regress:
753 context: gpgsql-nsec3-both
754 - auth-regress:
755 context: gpgsql-nsec3-optout-both
756 - auth-regress:
757 context: gpgsql-nsec3-narrow
758
759 test-auth-regress-ldap:
760 resource_class: small
761
762 docker:
763 - image: debian:buster
764 environment:
765 LDAPHOST: ldap://ldapserver/
766 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
767 name: ldapserver
768 command: '--loglevel debug'
769 environment:
770 LDAP_LOG_LEVEL: 0
771 steps:
772 - auth-regress-setup
773 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
774 - auth-regress:
775 context: ldap-tree
776 doroot: false
777 - auth-regress:
778 context: ldap-simple
779 doroot: false
780 - auth-regress:
781 context: ldap-strict
782 doroot: false
783
784 test-auth-regress-tinydns:
785 resource_class: small
786
787 docker:
788 - image: debian:buster
789 steps:
790 - auth-regress-setup
791 - auth-regress:
792 context: tinydns
793 doroot: false
794
795 test-auth-regress-lmdb:
796 resource_class: small
797
798 docker:
799 - image: debian:buster
800 steps:
801 - auth-regress-setup
802 - run: apt-get install -y -qq jq curl
803 - auth-regress:
804 context: lmdb-nodnssec-both
805 - auth-regress:
806 context: lmdb-both
807 - auth-regress:
808 context: lmdb-nsec3-both
809 - auth-regress:
810 context: lmdb-nsec3-optout-both
811 - auth-regress:
812 context: lmdb-nsec3-narrow
813
814 test-auth-algorithms:
815 resource_class: small
816
817 docker:
818 - image: debian:buster
819 steps:
820 - auth-regress-setup
821 - run:
822 name: Test all algorithms
823 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
824
825 test-auth-api:
826 resource_class: small
827
828 docker:
829 - image: debian:buster
830 steps:
831 - auth-regress-setup
832 - run: apt-get -y -qq install virtualenv sqlite3
833 - run:
834 name: Run API tests
835 workdir: ~/project/regression-tests.api
836 command: |
837 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
838 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
839 SDIG="/opt/pdns-auth/bin/sdig" \
840 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
841 ./runtests authoritative
842
843 build-recursor:
844 docker:
845 - image: debian:buster
846 steps:
847 - restore-cache-ccache:
848 product: recursor
849 - run:
850 name: Install dependencies
851 command: |
852 apt-get update && apt-get -qq --no-install-recommends install \
853 autoconf \
854 automake \
855 ca-certificates \
856 curl \
857 bison \
858 flex \
859 g++ \
860 git \
861 libboost-all-dev \
862 libcap-dev \
863 libluajit-5.1-dev \
864 libfstrm-dev \
865 libprotobuf-dev \
866 libsodium-dev \
867 libssl-dev \
868 libsystemd-dev \
869 libtool \
870 make \
871 pkg-config \
872 protobuf-compiler \
873 ragel \
874 systemd \
875 virtualenv
876 - get-workspace
877 - run:
878 name: autoconf
879 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
880 working_directory: ~/project/pdns/recursordist
881 - run:
882 name: configure
883 command: |
884 CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security" \
885 CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
886 ./configure \
887 --enable-unit-tests \
888 --enable-nod \
889 --enable-systemd \
890 --prefix=/opt/pdns-recursor \
891 --with-libsodium \
892 --with-lua=luajit \
893 --with-libcap \
894 --with-protobuf=yes \
895 --without-net-snmp
896 working_directory: ~/project/pdns/recursordist
897 - run:
898 name: build
899 command: make -j3 -k
900 working_directory: ~/project/pdns/recursordist
901 - save-ccache-cache:
902 product: recursor
903 - run:
904 name: Run unit tests
905 command: make check || (cat test-suite.log; false)
906 working_directory: ~/project/pdns/recursordist
907 - run:
908 name: Install resulting binaries
909 command: make install
910 working_directory: ~/project/pdns/recursordist
911 - persist_to_workspace:
912 root: /opt
913 paths:
914 - pdns-recursor
915
916 test-recursor-regression:
917 resource_class: small
918
919 docker:
920 - image: debian:buster
921 steps:
922 - add-auth-repo
923 - run: apt-get --no-install-recommends install -qq -y pdns-server pdns-backend-bind pdns-tools daemontools authbind jq libfaketime lua-posix lua-socket moreutils bc virtualenv protobuf-compiler
924 - install-recursor-deps
925 - run:
926 name: Set up authbind
927 command: |
928 touch /etc/authbind/byport/53
929 chmod 755 /etc/authbind/byport/53
930 - get-workspace
931 - run:
932 name: Run regression tests
933 workdir: ~/project
934 command: |
935 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
936 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
937 ./build-scripts/test-recursor
938
939 test-recursor-bulk:
940 resource_class: small
941
942 docker:
943 - image: debian:buster
944 steps:
945 - add-auth-repo
946 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
947 - install-recursor-deps
948 - get-workspace
949 - run:
950 name: Get the majestic million list
951 workdir: ~/project/regression-tests
952 command: |
953 apt-get install -qq -y unzip && \
954 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
955 unzip top-1m.csv.zip -d .
956 - run:
957 name: Run bulktests
958 command: |
959 DNSBULKTEST=/usr/bin/dnsbulktest \
960 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
961 THRESHOLD=95 \
962 TRACE=no \
963 ./timestamp ./recursor-test 5300 50000 || \
964 (cat recursor.log; false)
965 workdir: ~/project/regression-tests
966
967 test-recursor-api:
968 resource_class: small
969
970 docker:
971 - image: debian:buster
972 steps:
973 - add-auth-repo
974 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
975 - install-recursor-deps
976 - get-workspace
977 - run:
978 name: Run API tests
979 workdir: ~/project/regression-tests.api
980 command: |
981 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
982 ./runtests recursor
983
984 build-auth-docs:
985 resource_class: small
986
987 docker:
988 - image: debian:buster
989 steps:
990 - get-workspace
991 - install-doc-deps
992 - build-auth-docs
993
994 deploy-auth-docs:
995 resource_class: small
996
997 docker:
998 - image: debian:buster
999 steps:
1000 - get-workspace
1001 - install-doc-deps
1002 - build-auth-docs
1003 - add-docs-upload-ssh
1004 - upload-auth-docs
1005
1006 build-recursor-docs:
1007 resource_class: small
1008
1009 docker:
1010 - image: debian:buster
1011 steps:
1012 - get-workspace
1013 - install-doc-deps
1014 - build-recursor-docs
1015
1016 deploy-recursor-docs:
1017 resource_class: small
1018
1019 docker:
1020 - image: debian:buster
1021 steps:
1022 - get-workspace
1023 - install-doc-deps
1024 - build-recursor-docs
1025 - add-docs-upload-ssh
1026 - upload-recursor-docs
1027
1028 build-dnsdist-docs:
1029 resource_class: small
1030
1031 docker:
1032 - image: debian:buster
1033 steps:
1034 - get-workspace
1035 - install-doc-deps
1036 - build-dnsdist-docs
1037
1038 deploy-dnsdist-docs:
1039 resource_class: small
1040
1041 docker:
1042 - image: debian:buster
1043 steps:
1044 - get-workspace
1045 - install-doc-deps
1046 - build-dnsdist-docs
1047 - add-docs-upload-ssh
1048 - upload-dnsdist-docs
1049
1050 coverity-auth:
1051 docker:
1052 - image: debian:buster
1053 steps:
1054 - install-auth-dev-deps
1055 - install-coverity-tools
1056 - checkout-shallow
1057 - run:
1058 name: autoconf
1059 working_directory: /opt/project/
1060 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1061 - run:
1062 name: configure
1063 working_directory: /opt/project/
1064 command: |
1065 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1066 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1067 ./configure \
1068 --disable-lua-records \
1069 --disable-systemd \
1070 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc random tinydns' \
1071 --enable-tools \
1072 --with-lmdb=/usr \
1073 --with-libsodium \
1074 --prefix=/opt/pdns-auth
1075 - run:
1076 name: build
1077 working_directory: /opt/project/
1078 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1079 - run:
1080 name: Create Coverity tarball
1081 working_directory: /opt/project/
1082 command: tar caf auth.tar.bz2 cov-int
1083 - run:
1084 name: Upload tarball to coverity
1085 working_directory: /opt/project/
1086 command: |
1087 curl --form token=${COVERITY_TOKEN} \
1088 --form email="${COVERITY_EMAIL}" \
1089 --form file=@auth.tar.bz2 \
1090 --form version="$(./builder-support/gen-version)" \
1091 --form description="master build" \
1092 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1093
1094 coverity-dnsdist:
1095 docker:
1096 - image: debian:buster
1097 steps:
1098 - run:
1099 name: Install dependencies
1100 command: |
1101 apt-get update && apt-get -qq --no-install-recommends install \
1102 autoconf \
1103 automake \
1104 bison \
1105 bzip2 \
1106 ca-certificates \
1107 curl \
1108 flex \
1109 g++ \
1110 git \
1111 libboost-all-dev \
1112 libcap-dev \
1113 libcdb-dev \
1114 libedit-dev \
1115 libfstrm-dev \
1116 liblmdb-dev \
1117 libluajit-5.1-dev \
1118 libprotobuf-dev \
1119 libre2-dev \
1120 libsnmp-dev \
1121 libsodium-dev \
1122 libssl-dev \
1123 libsystemd-dev \
1124 libtool \
1125 make \
1126 pkg-config \
1127 protobuf-compiler \
1128 ragel \
1129 virtualenv
1130 - install-coverity-tools
1131 - checkout-shallow
1132 - run:
1133 name: autoconf
1134 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1135 working_directory: /opt/project/pdns/dnsdistdist
1136 - run:
1137 name: configure
1138 command: |
1139 CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security" \
1140 CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1141 ./configure \
1142 --disable-systemd \
1143 --disable-unit-tests \
1144 --enable-dnstap \
1145 --enable-dnscrypt \
1146 --enable-dns-over-tls \
1147 --prefix=/opt/dnsdist \
1148 --with-libsodium \
1149 --with-lua=luajit \
1150 --with-libcap \
1151 --with-protobuf=yes \
1152 --with-re2
1153 working_directory: /opt/project/pdns/dnsdistdist
1154 - run:
1155 name: build
1156 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1157 working_directory: /opt/project/pdns/dnsdistdist
1158 - run:
1159 name: Create Coverity tarball
1160 command: tar caf dnsdist.tar.bz2 cov-int
1161 working_directory: /opt/project/pdns/dnsdistdist
1162 - run:
1163 name: Upload tarball to coverity
1164 working_directory: /opt/project/
1165 command: |
1166 curl --form token=${COVERITY_TOKEN} \
1167 --form email="${COVERITY_EMAIL}" \
1168 --form file=@pdns/dnsdistdist/dnsdist.tar.bz2 \
1169 --form version="$(./builder-support/gen-version)" \
1170 --form description="master build" \
1171 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1172
1173 coverity-recursor:
1174 docker:
1175 - image: debian:buster
1176 steps:
1177 - run:
1178 name: Install dependencies
1179 command: |
1180 apt-get update && apt-get -qq --no-install-recommends install \
1181 autoconf \
1182 automake \
1183 ca-certificates \
1184 curl \
1185 bison \
1186 bzip2 \
1187 flex \
1188 g++ \
1189 git \
1190 libboost-all-dev \
1191 libcap-dev \
1192 libluajit-5.1-dev \
1193 libfstrm-dev \
1194 libprotobuf-dev \
1195 libsodium-dev \
1196 libssl-dev \
1197 libsystemd-dev \
1198 libtool \
1199 make \
1200 pkg-config \
1201 protobuf-compiler \
1202 ragel \
1203 virtualenv
1204 - install-coverity-tools
1205 - checkout-shallow
1206 - run:
1207 name: autoconf
1208 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1209 working_directory: /opt/project/pdns/recursordist
1210 - run:
1211 name: configure
1212 command: |
1213 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1214 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1215 ./configure \
1216 --disable-systemd \
1217 --disable-unit-tests \
1218 --prefix=/opt/pdns-recursor \
1219 --with-libsodium \
1220 --with-lua=luajit \
1221 --with-libcap \
1222 --with-protobuf=yes \
1223 --without-net-snmp
1224 working_directory: /opt/project/pdns/recursordist
1225 - run:
1226 name: build
1227 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1228 working_directory: /opt/project/pdns/recursordist
1229 - run:
1230 name: Create Coverity tarball
1231 command: tar caf recursor.tar.bz2 cov-int
1232 working_directory: /opt/project/pdns/recursordist
1233 - run:
1234 name: Upload tarball to coverity
1235 working_directory: /opt/project/
1236 command: |
1237 curl --form token=${COVERITY_TOKEN} \
1238 --form email="${COVERITY_EMAIL}" \
1239 --form file=@pdns/recursordist/recursor.tar.bz2 \
1240 --form version="$(./builder-support/gen-version)" \
1241 --form description="master build" \
1242 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1243
1244 build-dnsdist:
1245 docker:
1246 - image: debian:buster
1247 environment:
1248 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1249 steps:
1250 - restore-cache-ccache:
1251 product: dnsdist
1252 - run:
1253 name: Install dependencies
1254 command: |
1255 apt-get update && apt-get -qq --no-install-recommends install \
1256 autoconf \
1257 automake \
1258 g++ \
1259 git \
1260 libboost-all-dev \
1261 libcap-dev \
1262 libcdb-dev \
1263 libedit-dev \
1264 libfstrm-dev \
1265 libh2o-evloop-dev \
1266 liblmdb-dev \
1267 libluajit-5.1-dev \
1268 libprotobuf-dev \
1269 libre2-dev \
1270 libsnmp-dev \
1271 libsodium-dev \
1272 libssl-dev \
1273 libsystemd-dev \
1274 libtool \
1275 make \
1276 pkg-config \
1277 protobuf-compiler \
1278 ragel \
1279 systemd \
1280 virtualenv
1281 - get-workspace
1282 - run:
1283 name: autoconf
1284 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1285 working_directory: ~/project/pdns/dnsdistdist
1286 - run:
1287 name: configure
1288 command: |
1289 CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security" \
1290 CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1291 ./configure \
1292 --enable-unit-tests \
1293 --enable-dnstap \
1294 --enable-dnscrypt \
1295 --enable-dns-over-tls \
1296 --enable-dns-over-https \
1297 --enable-systemd \
1298 --prefix=/opt/dnsdist \
1299 --with-libsodium \
1300 --with-lua=luajit \
1301 --with-libcap \
1302 --with-protobuf=yes \
1303 --with-re2 \
1304 --enable-asan \
1305 --enable-ubsan
1306 working_directory: ~/project/pdns/dnsdistdist
1307 - run:
1308 name: build
1309 command: make -j1 -k
1310 working_directory: ~/project/pdns/dnsdistdist
1311 - save-ccache-cache:
1312 product: dnsdist
1313 - run:
1314 name: Run unit tests
1315 command: make check || (cat test-suite.log; false)
1316 working_directory: ~/project/pdns/dnsdistdist
1317 - run:
1318 name: Install resulting binaries
1319 command: make install
1320 working_directory: ~/project/pdns/dnsdistdist
1321 - persist_to_workspace:
1322 root: /opt
1323 paths:
1324 - dnsdist
1325
1326 test-dnsdist-regression:
1327 resource_class: small
1328
1329 docker:
1330 - image: debian:buster
1331 environment:
1332 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1333 steps:
1334 - install-dnsdist-deps
1335 - get-workspace
1336 - run:
1337 name: setup snmp
1338 command: |
1339 apt-get -qq --no-install-recommends install snmpd
1340 sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0700 0755/g" regression-tests.dnsdist/snmpd.conf > /etc/snmp/snmpd.conf
1341 /etc/init.d/snmpd start
1342 - run:
1343 name: install prometheus tools
1344 command: |
1345 apt-get -qq --no-install-recommends install prometheus
1346 - run:
1347 name: Run dnsdist tests
1348 workdir: ~/project/regression-tests.dnsdist
1349 command: |
1350 DNSDISTBIN="/opt/dnsdist/bin/dnsdist" \
1351 ./runtests
1352
1353 test-ixfrdist-regression:
1354 resource_class: small
1355
1356 docker:
1357 - image: debian:buster
1358 environment:
1359 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1360 steps:
1361 - install-ixfrdist-deps
1362 - get-workspace
1363 - run:
1364 name: Run ixfrdist tests
1365 workdir: ~/project/regression-tests.ixfrdist
1366 command: |
1367 IXFRDISTBIN="/opt/pdns-auth/bin/ixfrdist" \
1368 ./runtests
1369
1370 workflows:
1371 version: 2
1372 coverity:
1373 triggers:
1374 - schedule:
1375 cron: "0 0 * * *"
1376 filters:
1377 branches:
1378 only: master
1379 jobs:
1380 - coverity-auth:
1381 context: auth-coverity
1382 - coverity-dnsdist:
1383 context: dnsdist-coverity
1384 - coverity-recursor:
1385 context: recursor-coverity
1386
1387 build-and-test-all:
1388 jobs:
1389 - checkout
1390 - build-auth:
1391 requires:
1392 - checkout
1393 - test-auth-api:
1394 requires:
1395 - build-auth
1396 - test-auth-algorithms:
1397 requires:
1398 - build-auth
1399 - test-auth-regress-odbc-sqlite3:
1400 requires:
1401 - build-auth
1402 - test-auth-regress-odbc-mssql:
1403 requires:
1404 - build-auth
1405 - test-auth-regress-gmysql:
1406 requires:
1407 - build-auth
1408 - test-auth-regress-bind:
1409 requires:
1410 - build-auth
1411 - test-auth-regress-gsqlite3:
1412 requires:
1413 - build-auth
1414 - test-auth-regress-gpgsql:
1415 requires:
1416 - build-auth
1417 - test-auth-regress-lmdb:
1418 requires:
1419 - build-auth
1420 - test-auth-regress-ldap:
1421 requires:
1422 - build-auth
1423 - test-auth-regress-tinydns:
1424 requires:
1425 - build-auth
1426 - check-formatting:
1427 requires:
1428 - checkout
1429 - build-recursor:
1430 requires:
1431 - checkout
1432 - test-recursor-regression:
1433 requires:
1434 - build-recursor
1435 - test-recursor-bulk:
1436 requires:
1437 - build-recursor
1438 - test-recursor-api:
1439 requires:
1440 - build-recursor
1441 - build-dnsdist:
1442 requires:
1443 - checkout
1444 - test-dnsdist-regression:
1445 requires:
1446 - build-dnsdist
1447 - test-ixfrdist-regression:
1448 requires:
1449 - build-auth
1450
1451 build-docs:
1452 jobs:
1453 - checkout
1454 - build-auth-docs:
1455 filters:
1456 branches:
1457 ignore: master
1458 requires:
1459 - checkout
1460 - build-recursor-docs:
1461 filters:
1462 branches:
1463 ignore: master
1464 requires:
1465 - checkout
1466 - build-dnsdist-docs:
1467 filters:
1468 branches:
1469 ignore: master
1470 requires:
1471 - checkout
1472
1473 # These actually deploy
1474 - deploy-auth-docs:
1475 context: docs
1476 filters:
1477 branches:
1478 only: master
1479 requires:
1480 - checkout
1481 - deploy-recursor-docs:
1482 context: docs
1483 filters:
1484 branches:
1485 only: master
1486 requires:
1487 - checkout
1488 - deploy-dnsdist-docs:
1489 context: docs
1490 filters:
1491 branches:
1492 only: master
1493 requires:
1494 - checkout