]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: update dockerfiles to support different knot versions
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 27 Jul 2018 11:28:46 +0000 (13:28 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Wed, 1 Aug 2018 07:46:33 +0000 (07:46 +0000)
.gitlab-ci.yml
ci/README.md [new file with mode: 0644]
ci/debian-stable/Dockerfile
ci/debian-unstable/Dockerfile

index f8c4006847077bfd7308802a79a3f2cf497eca04..5cec39ba7957356cbb34ba5889c3a3d370c54bb3 100644 (file)
@@ -1,4 +1,4 @@
-image: $CI_REGISTRY/knot/knot-resolver/ci:debian-stable
+image: $CI_REGISTRY/knot/knot-resolver/ci/debian-stable:knot-2.6
 
 variables:
   DEBIAN_FRONTEND: noninteractive
@@ -32,7 +32,7 @@ build:linux:amd64:
 
 build:clang:linux:amd64:
   stage: build
-  image: $CI_REGISTRY/knot/knot-resolver/ci:debian-unstable  # newer Debian for newer Clang
+  image: $CI_REGISTRY/knot/knot-resolver/ci/debian-unstable:knot-2.6  # newer Debian for newer Clang
   script:
     - rm daemon/lua/kres-gen.lua
     - CXX=clang++-5.0 CC=clang-5.0 make -k all "CFLAGS=-Werror -Wno-error=unused-command-line-argument -ggdb"
@@ -70,7 +70,7 @@ lint:lua:
 
 lint:c:
   stage: test
-  image: $CI_REGISTRY/knot/knot-resolver/ci:debian-unstable  # newer Debian for newer Clang
+  image: $CI_REGISTRY/knot/knot-resolver/ci/debian-unstable:knot-2.6  # newer Debian for newer Clang
   dependencies: []  # do not download build artifacts
   script:
     - make lint-c CLANG_TIDY="clang-tidy-5.0 -quiet"
@@ -80,7 +80,7 @@ lint:c:
 lint:clang-scan-build:
   allow_failure: true  # for now it is just informative
   stage: test
-  image: $CI_REGISTRY/knot/knot-resolver/ci:debian-unstable  # newer Debian for newer Clang
+  image: $CI_REGISTRY/knot/knot-resolver/ci/debian-unstable:knot-2.6  # newer Debian for newer Clang
   dependencies: []  # do not download build artifacts
   script:
     - MAKEFLAGS="-k -j$(nproc)" SCAN_BUILD="/usr/lib/llvm-5.0/bin/scan-build -o scan-results --status-bugs -no-failure-reports" ./tests/clang_scan_build.sh make
diff --git a/ci/README.md b/ci/README.md
new file mode 100644 (file)
index 0000000..7b495ae
--- /dev/null
@@ -0,0 +1,14 @@
+Docker Build
+------------
+
+* debian-stable / debian-unstable
+
+```
+$ export KNOT_BRANCH=2.6
+$ docker build -t registry.labs.nic.cz/knot/knot-resolver/ci/debian-stable:knot-$KNOT_BRANCH --build-arg KNOT_BRANCH=$KNOT_BRANCH debian-stable
+$ docker build -t registry.labs.nic.cz/knot/knot-resolver/ci/debian-unstable:knot-$KNOT_BRANCH --build-arg KNOT_BRANCH=$KNOT_BRANCH debian-unstable
+
+$ docker login registry.labs.nic.cz
+$ docker push registry.labs.nic.cz/knot/knot-resolver/ci/debian-stable:knot-$KNOT_BRANCH
+$ docker push registry.labs.nic.cz/knot/knot-resolver/ci/debian-unstable:knot-$KNOT_BRANCH
+```
index 093744254ea8b9dbaf11ef7d1c75c5ff6b52ea0b..9aa700a804a4de19c2c8f9f87e3e5e820adc1cd1 100644 (file)
@@ -1,5 +1,6 @@
 FROM debian:stable
 MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
+ARG KNOT_BRANCH=master
 
 WORKDIR /root
 CMD ["/bin/bash"]
@@ -33,11 +34,11 @@ RUN pip3 install -r /tmp/deckard-req.txt
 
 # build and install latest version of Knot DNS
 # (kresd depends on libknot and libdnssec)
-RUN git clone --depth=1 --branch=2.6 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
+RUN git clone --depth=1 --branch=$KNOT_BRANCH https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
 WORKDIR /tmp/knot
 RUN pwd
 RUN autoreconf -if
-RUN ./configure
+RUN ./configure --prefix=/usr
 RUN make
 RUN make install
 RUN ldconfig
index 69a2932d74606e0d676bbb902bef1fba141d6876..3c473e89aef4bc0105193db9e71973b18f165129 100644 (file)
@@ -1,5 +1,6 @@
 FROM debian:unstable
 MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
+ARG KNOT_BRANCH=master
 
 WORKDIR /root
 CMD ["/bin/bash"]
@@ -13,11 +14,11 @@ RUN apt-get install -y -qqq make cmake pkg-config git build-essential bsdmainuti
 
 # build and install latest version of Knot DNS
 # (kresd depends on libknot and libdnssec)
-RUN git clone --depth=1 --branch=2.6 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
+RUN git clone --depth=1 --branch=$KNOT_BRANCH https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
 WORKDIR /tmp/knot
 RUN pwd
 RUN autoreconf -if
-RUN ./configure
+RUN ./configure --prefix=/usr
 RUN make
 RUN make install
 RUN ldconfig