]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
build docs in circleci
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 21 May 2019 10:39:37 +0000 (12:39 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 21 May 2019 13:43:17 +0000 (15:43 +0200)
.circleci/config.yml

index aee0e8c4234875ff46ef703f0c46e1d0d7f2b55d..9d2161fc23fd1543821bfe777a80c8108743fd88 100644 (file)
@@ -265,6 +265,128 @@ commands:
             - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
             - ccache-cache-{{ arch }}-<< parameters.product >>-
 
+  install-doc-deps:
+    description: Install dependencies needed to build the documentation
+    steps:
+      - run:
+          name: Install dependencies
+          command: |
+            apt-get update && apt-get -qq -y install \
+            autoconf \
+            automake \
+            bison \
+            curl \
+            flex \
+            g++ \
+            git \
+            latexmk \
+            libboost-all-dev \
+            libedit-dev \
+            libluajit-5.1-dev \
+            libssl-dev \
+            make \
+            pkg-config \
+            ragel \
+            virtualenv
+            if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+              apt-get update && apt-get -qq -y install \
+                texlive-full
+            fi
+
+  build-auth-docs:
+    description: Build documentation
+    steps:
+      - run:
+          name: autoconf
+          command: |
+            BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
+      - run:
+          name: configure
+          command: |
+            ./configure \
+            --disable-lua-records \
+            --disable-unit-tests \
+            --without-dynmodules \
+            --without-modules
+      - run:
+          name: build docs
+          command: |
+              make -C docs html-docs
+              if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+                make -C docs all-docs
+              fi
+      - run:
+          name: Upload documents
+          command: |
+            if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+              rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs/ doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs.tar.bz2 doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/PowerDNS-Authoritative.pdf doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
+            fi
+
+  build-recursor-docs:
+    description: Build Recursor documentation
+    steps:
+      - run:
+          name: autoconf
+          command: |
+            BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
+          working_directory: ~/project/pdns/recursordist
+      - run:
+          name: configure
+          command: |
+            ./configure \
+              --disable-unit-tests \
+              --disable-protobuf
+          working_directory: ~/project/pdns/recursordist
+      - run:
+          name: build docs
+          command: |
+            make html-docs
+            if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+              make all-docs
+            fi
+          working_directory: ~/project/pdns/recursordist
+      - run:
+          name: Upload documents
+          working_directory: ~/project/pdns/recursordist
+          command: |
+            if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+              rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
+            fi
+
+  build-dnsdist-docs:
+    description: Build dnsdist documentation
+    steps:
+      - run:
+          name: autoconf
+          command: |
+            BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
+          working_directory: ~/project/pdns/dnsdistdist
+      - run:
+          name: configure
+          command: |
+            ./configure \
+              --disable-unit-tests \
+              --disable-protobuf
+          working_directory: ~/project/pdns/dnsdistdist
+      - run:
+          name: build docs
+          command: |
+            make html-docs
+          working_directory: ~/project/pdns/dnsdistdist
+      - run:
+          name: Upload documents
+          working_directory: ~/project/pdns/dnsdistdist
+          command: |
+            if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
+              rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
+              rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
+            fi
+
 jobs:
   build-auth:
     docker:
@@ -723,6 +845,30 @@ jobs:
             PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
             ./runtests recursor
 
+  build-auth-docs:
+    docker:
+      - image: debian:stretch
+    steps:
+      - checkout-shallow
+      - install-doc-deps
+      - build-auth-docs
+
+  build-recursor-docs:
+    docker:
+      - image: debian:stretch
+    steps:
+      - checkout-shallow
+      - install-doc-deps
+      - build-recursor-docs
+
+  build-dnsdist-docs:
+    docker:
+      - image: debian:stretch
+    steps:
+      - checkout-shallow
+      - install-doc-deps
+      - build-dnsdist-docs
+
 workflows:
   version: 2
   build-and-test-all:
@@ -774,3 +920,9 @@ workflows:
       - test-recursor-api:
           requires:
             - build-recursor
+
+  build-docs:
+    jobs:
+      - build-auth-docs
+      - build-recursor-docs
+      - build-dnsdist-docs