Commit ac397b3a authored by Tomas Krizek's avatar Tomas Krizek

job_manager/create: support different Knot DNS branches

parent 0f4c22a7
Pipeline #38551 passed with stage
in 1 minute and 12 seconds
......@@ -30,3 +30,16 @@ To build the container locally, with the desired git version:
**Only use commit sha or tags.** Using branch names may lead to unexpected behaviour,
as the container cache with outdated code might be used, despite any updates to the
branch itself.
For compiling with different Knot DNS versions, use ``--build_arg KNOT_BRANCH=x.y``.
Registry Maintance - new builds
-------------------------------
.. code-block:: console
$ export KNOT_BRANCH=2.7
$ docker build -t registry.labs.nic.cz/knot/respdiff/knot-resolver-buildenv:knot-$KNOT_BRANCH --build-arg KNOT_BRANCH=$KNOT_BRANCH knot-resolver-buildenv
$ docker login registry.labs.nic.cz
$ docker push registry.labs.nic.cz/knot/respdiff/knot-resolver-buildenv:knot-$KNOT_BRANCH
FROM ubuntu:latest
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
ARG KNOT_BRANCH=master
RUN apt-get update -qq
RUN apt-get upgrade -y -qqq
......@@ -7,7 +8,7 @@ RUN apt-get upgrade -y -qqq
# Install Knot DNS from sources
RUN apt-get -y -qqq install git-core make gcc libtool autoconf pkg-config \
liburcu-dev liblmdb-dev libgnutls28-dev libjansson-dev libedit-dev libidn11-dev
RUN git clone -b 2.6 --depth=1 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
RUN git clone -b $KNOT_BRANCH --depth=1 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
WORKDIR /tmp/knot
RUN autoreconf -if
RUN ./configure --disable-static --disable-fastparser --disable-documentation
......
# first build stage, it will not persist in the final image
FROM registry.labs.nic.cz/knot/respdiff/knot-resolver-buildenv as intermediate
ARG SSH_PRIVATE_KEY
ARG GIT_SHA
ARG KNOT_BRANCH=2.7
# first build stage, it will not persist in the final image
FROM registry.labs.nic.cz/knot/respdiff/knot-resolver-buildenv:knot-$KNOT_BRANCH as intermediate
RUN mkdir /root/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
......
......@@ -132,6 +132,7 @@ def create_jobs(args: argparse.Namespace) -> None:
for test_case in test_cases:
config = load_test_case_config(test_case)
config['git_sha'] = git_sha
config['knot_branch'] = args.knot_branch
directory = os.path.join(args.jobs_dir, commit_dir, test_case)
prepare_dir(directory, clean=args.clean)
......@@ -163,6 +164,9 @@ def main() -> None:
parser.add_argument(
'--jobs-dir', default='/var/tmp/respdiff-jobs',
help="Directory with job collections (default: /var/tmp/respdiff-jobs)")
parser.add_argument(
'--knot-branch', type=str, default='2.7',
help="Build knot-resolver against selected Knot DNS branch")
args = parser.parse_args()
create_jobs(args)
......
......@@ -11,6 +11,7 @@ services:
args:
GIT_SHA: {{ git_sha }}
SSH_PRIVATE_KEY: ${SSH_PRIVATE_KEY}
KNOT_BRANCH: ${KNOT_BRANCH}
image: knot-resolver:{{ git_sha }}
volumes:
- "./{{ name }}.conf:/etc/knot-resolver/kresd.conf:ro"
......
......@@ -67,6 +67,7 @@ export SSH_PRIVATE_KEY
set -o xtrace
# Attempt to build containers (to have stdout/err logs in case of failure)
export KNOT_BRANCH={{ knot_branch }}
time docker-compose up --no-start
# Start and wait for resolvers to be available
./restart-all.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment