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}" > .ssh/known_hosts
43 description: Prepare the environment for auth regression tests
46 name: ensure ca-certificates is installed
47 command: apt-get update && apt-get -qq -y install ca-certificates
52 name: Install test dependencies
54 apt-get -y -qq install \
57 default-jre-headless \
63 name: Install jdnssectools
65 if [ ! -e /usr/bin/jdnssec-verifyzone ]; then
66 apt-get install -qq -y wget
67 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
68 tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /
69 rm jdnssec-tools-0.14.tar.gz
73 name: Allow missing tools in verify-dnssec-zone
74 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
77 description: Run one auth regression context
93 default: "/opt/pdns-auth/"
96 workdir: ~/project/regression-tests
97 name: Run << parameters.context >> tests
99 [ -e ./vars ] && . ./vars
101 for t in << parameters.skip >>
105 PDNS=<< parameters.prefix >>sbin/pdns_server \
106 PDNS2=<< parameters.prefix >>sbin/pdns_server \
107 SDIG=<< parameters.prefix >>bin/sdig \
108 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
109 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
110 SAXFR=<< parameters.prefix >>bin/saxfr \
111 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
112 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
113 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
114 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
115 ./start-test-stop 5300 << parameters.context >>
117 condition: << parameters.doroot >>
120 workdir: ~/project/regression-tests.rootzone
121 name: Run << parameters.context >> tests for the root zone
123 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
125 for t in << parameters.rootskip >>
129 PDNS=<< parameters.prefix >>sbin/pdns_server \
130 PDNS2=<< parameters.prefix >>sbin/pdns_server \
131 SDIG=<< parameters.prefix >>bin/sdig \
132 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
133 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
134 SAXFR=<< parameters.prefix >>bin/saxfr \
135 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
136 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
137 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
138 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
139 ./start-test-stop 5300 << parameters.context >>
141 install-recursor-deps:
142 description: "Install all libraries needed for the recursor"
144 - run: apt-get update
147 apt-get install -qq -y \
157 description: Install all libraries needed to run the auth
160 apt-get install -qq -y --no-install-recommends \
170 default-libmysqlclient-dev \
173 install-auth-dev-deps:
174 description: Install all packages needed to build the auth
176 - run: apt-get update
179 apt-get install -qq -y --no-install-recommends \
185 default-libmysqlclient-dev \
208 description: "Add the debian repo for the auth"
221 name: "Install dependencies"
222 command: "apt-get update && apt-get install -qq -y curl gnupg2"
224 name: "Install apt-keys"
226 if [ "<< parameters.version >>" = "master" ]; then
227 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
229 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
232 name: "Add repository"
234 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
238 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
239 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
240 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
242 name: update apt cache
243 command: apt-get update
246 description: Install .ccache and set $PATH
250 command: apt-get update && apt-get -qq -y install ccache
252 name: Setup ccache in $PATH
253 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
256 description: Store the .ccache directory
263 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
267 restore-cache-ccache:
268 description: Restore the .ccache directory
276 name: ensure ca-certificates is installed
277 command: apt-get update && apt-get -qq -y install ca-certificates
280 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
281 - ccache-cache-{{ arch }}-<< parameters.product >>-
284 description: Install dependencies needed to build the documentation
287 name: Install dependencies
289 apt-get update && apt-get -qq -y install \
306 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
307 apt-get update && apt-get -qq -y install \
312 description: Build documentation
317 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
322 --disable-lua-records \
323 --disable-unit-tests \
324 --without-dynmodules \
329 make -C docs html-docs
330 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
331 make -C docs all-docs
337 name: Upload documents
339 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
340 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs/ doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/authoritative/
341 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs.tar.bz2 doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/authoritative/
342 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/PowerDNS-Authoritative.pdf doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/authoritative/
346 description: Build Recursor documentation
351 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
352 working_directory: ~/project/pdns/recursordist
357 --disable-unit-tests \
359 working_directory: ~/project/pdns/recursordist
364 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
367 working_directory: ~/project/pdns/recursordist
369 upload-recursor-docs:
372 name: Upload documents
373 working_directory: ~/project/pdns/recursordist
375 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
376 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/recursor/
377 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/recursor/
378 rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf doc_powerdns_com@${DOCS_HOST}:/srv/www/doc.powerdns.com/recursor/
382 description: Build dnsdist documentation
387 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
388 working_directory: ~/project/pdns/dnsdistdist
393 --disable-unit-tests \
395 working_directory: ~/project/pdns/dnsdistdist
400 working_directory: ~/project/pdns/dnsdistdist
405 name: Upload documents
406 working_directory: ~/project/pdns/dnsdistdist
408 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
409 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@${DOCS_HOST}:/srv/www/dnsdist.org
410 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@${DOCS_HOST}:/srv/www/dnsdist.org
411 rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@${DOCS_HOST}:/srv/www/dnsdist.org
417 - image: debian:stretch
421 - install-auth-dev-deps
422 - restore-cache-ccache:
426 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
430 CFLAGS="-O1 -Werror=vla" \
431 CXXFLAGS="-O1 -Werror=vla" \
433 --disable-lua-records \
434 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
438 --prefix=/opt/pdns-auth
445 name: Install the binaries
446 command: make install
447 - persist_to_workspace:
452 test-auth-regress-odbc-sqlite3:
454 - image: debian:stretch
458 name: Configure ODBC for sqlite
460 cat >> ~/.odbc.ini \<<- __EOF__
463 Database = ${PWD}/regression-tests/pdns.sqlite3
466 Database = ${PWD}/regression-tests/pdns.sqlite32
469 name: Install ODBC deps
471 apt-get install -qq -y \
476 name: Set up sqlite3 odbc testing
477 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
478 workdir: ~/project/regression-tests
480 context: godbc_sqlite3-nsec3
481 doroot: false # Broken at the moment
483 test-auth-regress-odbc-mssql:
485 - image: debian:stretch
486 - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
489 - SA_PASSWORD: 'SAsa12%%'
493 name: Install ODBC deps
495 apt-get install -qq -y \
500 name: set up mssql odbc
502 cat >> ~/.odbc.ini \<<- __EOF__
510 [pdns-mssql-docker-nodb]
518 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
520 name: create database
521 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
523 name: Set up mssql odbc testing
524 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
525 workdir: ~/project/regression-tests
527 context: godbc_mssql-nodnssec
528 skip: 8bit-txt-unescaped
531 skip: 8bit-txt-unescaped
533 context: godbc_mssql-nsec3
534 skip: 8bit-txt-unescaped
536 context: godbc_mssql-nsec3-optout
537 skip: 8bit-txt-unescaped
539 context: godbc_mssql-nsec3-narrow
540 skip: 8bit-txt-unescaped
542 test-auth-regress-gsqlite3:
544 - image: debian:stretch
548 command: apt-get install -qq -y sqlite3
550 context: gsqlite3-nodnssec-both
552 context: gsqlite3-both
554 context: gsqlite3-nsec3-both
556 context: gsqlite3-nsec3-optout-both
558 context: gsqlite3-nsec3-narrow
560 test-auth-regress-bind:
562 - image: debian:stretch
563 - image: circleci/mysql:5 # for the hybrid test
567 command: apt-get install -qq -y sqlite3
571 context: bind-dnssec-both
573 context: bind-dnssec-nsec3-both
575 context: bind-dnssec-nsec3-optout-both
577 context: bind-dnssec-nsec3-narrow
579 command: apt-get install -qq -y default-mysql-client
582 cat >> ~/.my.cnf \<<- __EOF__
587 context: bind-hybrid-nsec3
589 test-auth-regress-mydns:
591 - image: debian:stretch
592 - image: circleci/mysql:5
596 command: apt-get install -qq -y default-mysql-client
599 cat >> ~/.my.cnf \<<- __EOF__
607 test-auth-regress-gmysql:
609 - image: debian:stretch
610 - image: circleci/mysql:5
614 command: apt-get install -qq -y default-mysql-client
617 cat >> ~/.my.cnf \<<- __EOF__
622 context: gmysql-nodnssec-both
626 context: gmysql-nsec3-both
628 context: gmysql-nsec3-optout-both
630 context: gmysql-nsec3-narrow
632 test-auth-regress-gpgsql:
634 - image: debian:stretch
635 - image: circleci/postgres:9
641 command: apt-get install -qq -y postgresql-client
643 name: Use TCP for Postgresql connections
645 cat >> ./vars \<<- __EOF__
646 export PGHOST=127.0.0.1
649 workdir: ~/project/regression-tests
651 context: gpgsql-nodnssec-both
655 context: gpgsql-nsec3-both
657 context: gpgsql-nsec3-optout-both
659 context: gpgsql-nsec3-narrow
661 test-auth-regress-ldap:
663 - image: debian:stretch
665 LDAPHOST: ldap://ldapserver/
666 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
668 command: '--loglevel debug'
673 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
684 test-auth-regress-tinydns:
686 - image: debian:stretch
693 test-auth-regress-lmdb:
695 - image: debian:stretch
698 - run: apt-get install -y -qq jq curl
700 context: lmdb-nodnssec-both
704 context: lmdb-nsec3-both
706 context: lmdb-nsec3-optout-both
708 context: lmdb-nsec3-narrow
710 test-auth-algorithms:
712 - image: debian:stretch
716 name: Test all algorithms
717 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
721 - image: debian:stretch
724 - run: apt-get -y -qq install virtualenv sqlite3
727 workdir: ~/project/regression-tests.api
729 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
730 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
731 SDIG="/opt/pdns-auth/bin/sdig" \
732 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
733 ./runtests authoritative
737 - image: debian:stretch
739 - restore-cache-ccache:
742 name: Install dependencies
744 apt-get update && apt-get -qq --no-install-recommends install \
769 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
770 working_directory: ~/project/pdns/recursordist
774 CFLAGS="-O1 -Werror=vla" \
775 CXXFLAGS="-O1 -Werror=vla" \
777 --enable-unit-tests \
779 --prefix=/opt/pdns-recursor \
783 --with-protobuf=yes \
785 working_directory: ~/project/pdns/recursordist
789 working_directory: ~/project/pdns/recursordist
794 command: make check || (cat test-suite.log; false)
795 working_directory: ~/project/pdns/recursordist
797 name: Install resulting binaries
798 command: make install
799 working_directory: ~/project/pdns/recursordist
800 - persist_to_workspace:
805 test-recursor-regression:
807 - image: debian:stretch
810 - 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
811 - install-recursor-deps
813 name: Set up authbind
815 touch /etc/authbind/byport/53
816 chmod 755 /etc/authbind/byport/53
821 name: Run regression tests
824 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
825 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
826 ./build-scripts/test-recursor
830 - image: debian:stretch
833 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
834 - install-recursor-deps
839 name: Get the majestic million list
840 workdir: ~/project/regression-tests
842 apt-get install -qq -y unzip && \
843 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
844 unzip top-1m.csv.zip -d .
848 DNSBULKTEST=/usr/bin/dnsbulktest \
849 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
852 ./timestamp ./recursor-test 5300 50000 || \
853 (cat recursor.log; false)
854 workdir: ~/project/regression-tests
858 - image: debian:stretch
861 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
862 - install-recursor-deps
868 workdir: ~/project/regression-tests.api
870 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
875 - image: debian:stretch
883 - image: debian:stretch
888 - add-docs-upload-ssh
893 - image: debian:stretch
897 - build-recursor-docs
899 deploy-recursor-docs:
901 - image: debian:stretch
905 - build-recursor-docs
906 - add-docs-upload-ssh
907 - upload-recursor-docs
911 - image: debian:stretch
919 - image: debian:stretch
924 - add-docs-upload-ssh
925 - upload-dnsdist-docs
929 - image: debian:stretch
931 - install-auth-dev-deps
932 - install-coverity-tools
936 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
940 CFLAGS="-O1 -Werror=vla" \
941 CXXFLAGS="-O1 -Werror=vla" \
943 --disable-lua-records \
944 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
948 --prefix=/opt/pdns-auth
951 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
953 name: Create Coverity tarball
954 command: tar caf auth.tar.bz2 cov-int
956 name: Upload tarball to coverity
958 curl --form token=${COVERITY_TOKEN} \
959 --form email="${COVERITY_EMAIL}" \
960 --form file=@auth.tar.bz2 \
961 --form version="$(./builder-support/gen-version)" \
962 --form description="master build" \
963 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
967 - image: debian:stretch
970 name: Install dependencies
972 apt-get update && apt-get -qq --no-install-recommends install \
999 - install-coverity-tools
1003 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1004 working_directory: ~/project/pdns/dnsdistdist
1008 CFLAGS="-O1 -Werror=vla" \
1009 CXXFLAGS="-O1 -Werror=vla" \
1012 --disable-unit-tests \
1015 --enable-dns-over-tls \
1016 --prefix=/opt/dnsdist \
1020 --with-protobuf=yes \
1022 working_directory: ~/project/pdns/dnsdistdist
1025 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1026 working_directory: ~/project/pdns/dnsdistdist
1028 name: Create Coverity tarball
1029 command: tar caf dnsdist.tar.bz2 cov-int
1030 working_directory: ~/project/pdns/dnsdistdist
1032 name: Upload tarball to coverity
1034 curl --form token=${COVERITY_TOKEN} \
1035 --form email="${COVERITY_EMAIL}" \
1036 --form file=@pdns/dnsdistdist/dnsdist.tar.bz2 \
1037 --form version="$(./builder-support/gen-version)" \
1038 --form description="master build" \
1039 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1043 - image: debian:stretch
1046 name: Install dependencies
1048 apt-get update && apt-get -qq --no-install-recommends install \
1071 - install-coverity-tools
1075 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1076 working_directory: ~/project/pdns/recursordist
1080 CFLAGS="-O1 -Werror=vla" \
1081 CXXFLAGS="-O1 -Werror=vla" \
1084 --disable-unit-tests \
1085 --prefix=/opt/pdns-recursor \
1089 --with-protobuf=yes \
1091 working_directory: ~/project/pdns/recursordist
1094 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1095 working_directory: ~/project/pdns/recursordist
1097 name: Create Coverity tarball
1098 command: tar caf recursor.tar.bz2 cov-int
1099 working_directory: ~/project/pdns/recursordist
1101 name: Upload tarball to coverity
1103 curl --form token=${COVERITY_TOKEN} \
1104 --form email="${COVERITY_EMAIL}" \
1105 --form file=@pdns/recursordist/recursor.tar.bz2 \
1106 --form version="$(./builder-support/gen-version)" \
1107 --form description="master build" \
1108 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1121 context: auth-coverity
1123 context: dnsdist-coverity
1124 - coverity-recursor:
1125 context: recursor-coverity
1133 - test-auth-algorithms:
1136 - test-auth-regress-odbc-sqlite3:
1139 - test-auth-regress-odbc-mssql:
1142 - test-auth-regress-gmysql:
1145 - test-auth-regress-mydns:
1148 - test-auth-regress-bind:
1151 - test-auth-regress-gsqlite3:
1154 - test-auth-regress-gpgsql:
1157 - test-auth-regress-lmdb:
1160 - test-auth-regress-ldap:
1163 - test-auth-regress-tinydns:
1167 - test-recursor-regression:
1170 - test-recursor-bulk:
1173 - test-recursor-api:
1183 - build-recursor-docs:
1187 - build-dnsdist-docs:
1192 # These actually deploy
1198 - deploy-recursor-docs:
1203 - deploy-dnsdist-docs: