5 description: "Do a shallow checkout of the repository"
8 name: Install git and openssh
9 command: apt-get update && apt-get -qq -y install openssh-client git
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
16 if [ -n "$CIRCLE_PR_NUMBER" ]
18 echo === Checking out PR "$CIRCLE_PR_NUMBER" from "$CIRCLE_REPOSITORY_URL"
19 git clone --depth 1 $CIRCLE_REPOSITORY_URL ~/project
21 git fetch --depth 1 origin +refs/pull/${CIRCLE_PR_NUMBER}/merge
22 git checkout -qf FETCH_HEAD
24 echo === Checking out branch "${CIRCLE_BRANCH}" from "$CIRCLE_REPOSITORY_URL"
25 git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL ~/project
29 install-coverity-tools:
30 description: Install the coverity tools to /usr/local
33 name: Install Coverity tools
34 command: curl -s https://scan.coverity.com/download/linux64 --data "token=${COVERITY_TOKEN}&project=${COVERITY_PROJECT}" | gunzip | tar xvf /dev/stdin --strip-components=2 --no-same-owner -C /usr/local
37 description: Add ssh known_hosts fingerprints
40 command: mkdir -p $HOME/.ssh && echo "${DOCS_HOST} ${DOCS_FINGERPRINT}" > $HOME/.ssh/known_hosts
43 - "3e:0a:aa:2c:30:69:89:f3:eb:17:c1:3f:3b:78:40:7a"
46 description: Prepare the environment for auth regression tests
49 name: ensure ca-certificates is installed
50 command: apt-get update && apt-get -qq -y install ca-certificates
55 name: Install test dependencies
57 apt-get -y -qq install \
60 default-jre-headless \
66 name: Install jdnssectools
68 if [ ! -e /usr/bin/jdnssec-verifyzone ]; then
69 apt-get install -qq -y wget
70 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
71 tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /
72 rm jdnssec-tools-0.14.tar.gz
76 name: Allow missing tools in verify-dnssec-zone
77 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
80 description: Run one auth regression context
96 default: "/opt/pdns-auth/"
99 workdir: ~/project/regression-tests
100 name: Run << parameters.context >> tests
102 [ -e ./vars ] && . ./vars
104 for t in << parameters.skip >>
108 PDNS=<< parameters.prefix >>sbin/pdns_server \
109 PDNS2=<< parameters.prefix >>sbin/pdns_server \
110 SDIG=<< parameters.prefix >>bin/sdig \
111 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
112 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
113 SAXFR=<< parameters.prefix >>bin/saxfr \
114 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
115 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
116 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
117 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
118 ./start-test-stop 5300 << parameters.context >>
120 condition: << parameters.doroot >>
123 workdir: ~/project/regression-tests.rootzone
124 name: Run << parameters.context >> tests for the root zone
126 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
128 for t in << parameters.rootskip >>
132 PDNS=<< parameters.prefix >>sbin/pdns_server \
133 PDNS2=<< parameters.prefix >>sbin/pdns_server \
134 SDIG=<< parameters.prefix >>bin/sdig \
135 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
136 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
137 SAXFR=<< parameters.prefix >>bin/saxfr \
138 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
139 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
140 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
141 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
142 ./start-test-stop 5300 << parameters.context >>
144 install-recursor-deps:
145 description: "Install all libraries needed for the recursor"
147 - run: apt-get update
150 apt-get install -qq -y \
160 description: Install all libraries needed to run the auth
163 apt-get install -qq -y --no-install-recommends \
173 default-libmysqlclient-dev \
176 install-auth-dev-deps:
177 description: Install all packages needed to build the auth
179 - run: apt-get update
182 apt-get install -qq -y --no-install-recommends \
188 default-libmysqlclient-dev \
211 description: "Add the debian repo for the auth"
224 name: "Install dependencies"
225 command: "apt-get update && apt-get install -qq -y curl gnupg2"
227 name: "Install apt-keys"
229 if [ "<< parameters.version >>" = "master" ]; then
230 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
232 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
235 name: "Add repository"
237 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
241 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
242 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
243 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
245 name: update apt cache
246 command: apt-get update
249 description: Install .ccache and set $PATH
253 command: apt-get update && apt-get -qq -y install ccache
255 name: Setup ccache in $PATH
256 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
259 description: Store the .ccache directory
266 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
270 restore-cache-ccache:
271 description: Restore the .ccache directory
279 name: ensure ca-certificates is installed
280 command: apt-get update && apt-get -qq -y install ca-certificates
283 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
284 - ccache-cache-{{ arch }}-<< parameters.product >>-
287 description: Install dependencies needed to build the documentation
290 name: Install dependencies
292 apt-get update && apt-get -qq -y install \
309 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
310 apt-get update && apt-get -qq -y install \
315 description: Build documentation
320 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
325 --disable-lua-records \
326 --disable-unit-tests \
327 --without-dynmodules \
332 make -C docs html-docs
333 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
334 make -C docs all-docs
340 name: Upload documents
342 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
343 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs/ docs_powerdns_com@${DOCS_HOST}:/authoritative/
344 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/authoritative/
345 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/PowerDNS-Authoritative.pdf docs_powerdns_com@${DOCS_HOST}:/authoritative/
349 description: Build Recursor documentation
354 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
355 working_directory: ~/project/pdns/recursordist
360 --disable-unit-tests \
362 working_directory: ~/project/pdns/recursordist
367 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
370 working_directory: ~/project/pdns/recursordist
372 upload-recursor-docs:
375 name: Upload documents
376 working_directory: ~/project/pdns/recursordist
378 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
379 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ docs_powerdns_com@${DOCS_HOST}:/recursor/
380 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/recursor/
381 rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf docs_powerdns_com@${DOCS_HOST}:/recursor/
385 description: Build dnsdist documentation
390 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
391 working_directory: ~/project/pdns/dnsdistdist
396 --disable-unit-tests \
398 working_directory: ~/project/pdns/dnsdistdist
403 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
406 working_directory: ~/project/pdns/dnsdistdist
411 name: Upload documents
412 working_directory: ~/project/pdns/dnsdistdist
414 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
415 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@${DOCS_HOST}:
416 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@${DOCS_HOST}:
417 rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@${DOCS_HOST}:
423 - image: debian:stretch
427 - install-auth-dev-deps
428 - restore-cache-ccache:
432 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
436 CFLAGS="-O1 -Werror=vla" \
437 CXXFLAGS="-O1 -Werror=vla" \
439 --disable-lua-records \
440 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
444 --prefix=/opt/pdns-auth
451 name: Install the binaries
452 command: make install
453 - persist_to_workspace:
458 test-auth-regress-odbc-sqlite3:
460 - image: debian:stretch
464 name: Configure ODBC for sqlite
466 cat >> ~/.odbc.ini \<<- __EOF__
469 Database = ${PWD}/regression-tests/pdns.sqlite3
472 Database = ${PWD}/regression-tests/pdns.sqlite32
475 name: Install ODBC deps
477 apt-get install -qq -y \
482 name: Set up sqlite3 odbc testing
483 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
484 workdir: ~/project/regression-tests
486 context: godbc_sqlite3-nsec3
487 doroot: false # Broken at the moment
489 test-auth-regress-odbc-mssql:
491 - image: debian:stretch
492 - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
495 - SA_PASSWORD: 'SAsa12%%'
499 name: Install ODBC deps
501 apt-get install -qq -y \
506 name: set up mssql odbc
508 cat >> ~/.odbc.ini \<<- __EOF__
516 [pdns-mssql-docker-nodb]
524 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
526 name: create database
527 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
529 name: Set up mssql odbc testing
530 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
531 workdir: ~/project/regression-tests
533 context: godbc_mssql-nodnssec
534 skip: 8bit-txt-unescaped
537 skip: 8bit-txt-unescaped
539 context: godbc_mssql-nsec3
540 skip: 8bit-txt-unescaped
542 context: godbc_mssql-nsec3-optout
543 skip: 8bit-txt-unescaped
545 context: godbc_mssql-nsec3-narrow
546 skip: 8bit-txt-unescaped
548 test-auth-regress-gsqlite3:
550 - image: debian:stretch
554 command: apt-get install -qq -y sqlite3
556 context: gsqlite3-nodnssec-both
558 context: gsqlite3-both
560 context: gsqlite3-nsec3-both
562 context: gsqlite3-nsec3-optout-both
564 context: gsqlite3-nsec3-narrow
566 test-auth-regress-bind:
568 - image: debian:stretch
569 - image: circleci/mysql:5 # for the hybrid test
573 command: apt-get install -qq -y sqlite3
577 context: bind-dnssec-both
579 context: bind-dnssec-nsec3-both
581 context: bind-dnssec-nsec3-optout-both
583 context: bind-dnssec-nsec3-narrow
585 command: apt-get install -qq -y default-mysql-client
588 cat >> ~/.my.cnf \<<- __EOF__
593 context: bind-hybrid-nsec3
595 test-auth-regress-mydns:
597 - image: debian:stretch
598 - image: circleci/mysql:5
602 command: apt-get install -qq -y default-mysql-client
605 cat >> ~/.my.cnf \<<- __EOF__
613 test-auth-regress-gmysql:
615 - image: debian:stretch
616 - image: circleci/mysql:5
620 command: apt-get install -qq -y default-mysql-client
623 cat >> ~/.my.cnf \<<- __EOF__
628 context: gmysql-nodnssec-both
632 context: gmysql-nsec3-both
634 context: gmysql-nsec3-optout-both
636 context: gmysql-nsec3-narrow
638 test-auth-regress-gpgsql:
640 - image: debian:stretch
641 - image: circleci/postgres:9
647 command: apt-get install -qq -y postgresql-client
649 name: Use TCP for Postgresql connections
651 cat >> ./vars \<<- __EOF__
652 export PGHOST=127.0.0.1
655 workdir: ~/project/regression-tests
657 context: gpgsql-nodnssec-both
661 context: gpgsql-nsec3-both
663 context: gpgsql-nsec3-optout-both
665 context: gpgsql-nsec3-narrow
667 test-auth-regress-ldap:
669 - image: debian:stretch
671 LDAPHOST: ldap://ldapserver/
672 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
674 command: '--loglevel debug'
679 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
690 test-auth-regress-tinydns:
692 - image: debian:stretch
699 test-auth-regress-lmdb:
701 - image: debian:stretch
704 - run: apt-get install -y -qq jq curl
706 context: lmdb-nodnssec-both
710 context: lmdb-nsec3-both
712 context: lmdb-nsec3-optout-both
714 context: lmdb-nsec3-narrow
716 test-auth-algorithms:
718 - image: debian:stretch
722 name: Test all algorithms
723 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
727 - image: debian:stretch
730 - run: apt-get -y -qq install virtualenv sqlite3
733 workdir: ~/project/regression-tests.api
735 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
736 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
737 SDIG="/opt/pdns-auth/bin/sdig" \
738 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
739 ./runtests authoritative
743 - image: debian:stretch
745 - restore-cache-ccache:
748 name: Install dependencies
750 apt-get update && apt-get -qq --no-install-recommends install \
775 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
776 working_directory: ~/project/pdns/recursordist
780 CFLAGS="-O1 -Werror=vla" \
781 CXXFLAGS="-O1 -Werror=vla" \
783 --enable-unit-tests \
785 --prefix=/opt/pdns-recursor \
789 --with-protobuf=yes \
791 working_directory: ~/project/pdns/recursordist
795 working_directory: ~/project/pdns/recursordist
800 command: make check || (cat test-suite.log; false)
801 working_directory: ~/project/pdns/recursordist
803 name: Install resulting binaries
804 command: make install
805 working_directory: ~/project/pdns/recursordist
806 - persist_to_workspace:
811 test-recursor-regression:
813 - image: debian:stretch
816 - run: apt-get --no-install-recommends install -qq -y pdns-server pdns-backend-bind pdns-tools daemontools authbind jq libfaketime lua-posix moreutils bc virtualenv protobuf-compiler
817 - install-recursor-deps
819 name: Set up authbind
821 touch /etc/authbind/byport/53
822 chmod 755 /etc/authbind/byport/53
827 name: Run regression tests
830 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
831 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
832 ./build-scripts/test-recursor
836 - image: debian:stretch
839 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
840 - install-recursor-deps
845 name: Get the majestic million list
846 workdir: ~/project/regression-tests
848 apt-get install -qq -y unzip && \
849 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
850 unzip top-1m.csv.zip -d .
854 DNSBULKTEST=/usr/bin/dnsbulktest \
855 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
858 ./timestamp ./recursor-test 5300 50000 || \
859 (cat recursor.log; false)
860 workdir: ~/project/regression-tests
864 - image: debian:stretch
867 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
868 - install-recursor-deps
874 workdir: ~/project/regression-tests.api
876 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
881 - image: debian:stretch
889 - image: debian:stretch
894 - add-docs-upload-ssh
899 - image: debian:stretch
903 - build-recursor-docs
905 deploy-recursor-docs:
907 - image: debian:stretch
911 - build-recursor-docs
912 - add-docs-upload-ssh
913 - upload-recursor-docs
917 - image: debian:stretch
925 - image: debian:stretch
930 - add-docs-upload-ssh
931 - upload-dnsdist-docs
935 - image: debian:stretch
937 - install-auth-dev-deps
938 - install-coverity-tools
942 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
946 CFLAGS="-O1 -Werror=vla" \
947 CXXFLAGS="-O1 -Werror=vla" \
949 --disable-lua-records \
950 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
954 --prefix=/opt/pdns-auth
957 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
959 name: Create Coverity tarball
960 command: tar caf auth.tar.bz2 cov-int
962 name: Upload tarball to coverity
964 curl --form token=${COVERITY_TOKEN} \
965 --form email="${COVERITY_EMAIL}" \
966 --form file=@auth.tar.bz2 \
967 --form version="$(./builder-support/gen-version)" \
968 --form description="master build" \
969 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
973 - image: debian:stretch
976 name: Install dependencies
978 apt-get update && apt-get -qq --no-install-recommends install \
1005 - install-coverity-tools
1009 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1010 working_directory: ~/project/pdns/dnsdistdist
1014 CFLAGS="-O1 -Werror=vla" \
1015 CXXFLAGS="-O1 -Werror=vla" \
1018 --disable-unit-tests \
1021 --enable-dns-over-tls \
1022 --prefix=/opt/dnsdist \
1026 --with-protobuf=yes \
1028 working_directory: ~/project/pdns/dnsdistdist
1031 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1032 working_directory: ~/project/pdns/dnsdistdist
1034 name: Create Coverity tarball
1035 command: tar caf dnsdist.tar.bz2 cov-int
1036 working_directory: ~/project/pdns/dnsdistdist
1038 name: Upload tarball to coverity
1040 curl --form token=${COVERITY_TOKEN} \
1041 --form email="${COVERITY_EMAIL}" \
1042 --form file=@pdns/dnsdistdist/dnsdist.tar.bz2 \
1043 --form version="$(./builder-support/gen-version)" \
1044 --form description="master build" \
1045 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1049 - image: debian:stretch
1052 name: Install dependencies
1054 apt-get update && apt-get -qq --no-install-recommends install \
1077 - install-coverity-tools
1081 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1082 working_directory: ~/project/pdns/recursordist
1086 CFLAGS="-O1 -Werror=vla" \
1087 CXXFLAGS="-O1 -Werror=vla" \
1090 --disable-unit-tests \
1091 --prefix=/opt/pdns-recursor \
1095 --with-protobuf=yes \
1097 working_directory: ~/project/pdns/recursordist
1100 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1101 working_directory: ~/project/pdns/recursordist
1103 name: Create Coverity tarball
1104 command: tar caf recursor.tar.bz2 cov-int
1105 working_directory: ~/project/pdns/recursordist
1107 name: Upload tarball to coverity
1109 curl --form token=${COVERITY_TOKEN} \
1110 --form email="${COVERITY_EMAIL}" \
1111 --form file=@pdns/recursordist/recursor.tar.bz2 \
1112 --form version="$(./builder-support/gen-version)" \
1113 --form description="master build" \
1114 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1127 context: auth-coverity
1129 context: dnsdist-coverity
1130 - coverity-recursor:
1131 context: recursor-coverity
1139 - test-auth-algorithms:
1142 - test-auth-regress-odbc-sqlite3:
1145 - test-auth-regress-odbc-mssql:
1148 - test-auth-regress-gmysql:
1151 - test-auth-regress-mydns:
1154 - test-auth-regress-bind:
1157 - test-auth-regress-gsqlite3:
1160 - test-auth-regress-gpgsql:
1163 - test-auth-regress-lmdb:
1166 - test-auth-regress-ldap:
1169 - test-auth-regress-tinydns:
1173 - test-recursor-regression:
1176 - test-recursor-bulk:
1179 - test-recursor-api:
1189 - build-recursor-docs:
1193 - build-dnsdist-docs:
1198 # These actually deploy
1204 - deploy-recursor-docs:
1209 - deploy-dnsdist-docs: