diff --git a/automation/Dockerfile b/automation/Dockerfile index 93a4fe7db..52e5acfb4 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -6,3 +6,9 @@ RUN apt-get --yes upgrade #tzdata is a dependency, won't install otherwise ARG DEBIAN_FRONTEND=noninteractive RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano + +RUN git clone https://github.com/catchorg/Catch2.git && \ + cd Catch2 && \ + git checkout v3.0.0-preview4 && \ + cmake -Bbuild -H. -DBUILD_TESTING=OFF && \ + cmake --build build/ --target install diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index e7f85e28e..3050a68b4 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -1,22 +1,28 @@ pipeline { agent any environment { + DOCKER_TAG = 'fsfw-build' BUILDDIR = 'build-tests' } stages { - stage('Create Docker') { - agent { - dockerfile { - dir 'automation' - additionalBuildArgs '--no-cache' - reuseNode true + stage('Build Container') { + when { + anyOf { + changeset "automation/Dockerfile"; + changelog 'cleanDocker' } } steps { - sh 'rm -rf $BUILDDIR' + sh 'docker build -t $DOCKER_TAG - < automation/Dockerfile' } } stage('Clean') { + agent { + docker { + image '$DOCKER_TAG' + reuseNode true + } + } when { anyOf { changelog 'cleanCI' @@ -30,8 +36,8 @@ pipeline { } stage('Configure') { agent { - dockerfile { - dir 'automation' + docker { + image '$DOCKER_TAG' reuseNode true } } @@ -43,8 +49,8 @@ pipeline { } stage('Build') { agent { - dockerfile { - dir 'automation' + docker { + image '$DOCKER_TAG' reuseNode true } } @@ -56,8 +62,8 @@ pipeline { } stage('Unittests') { agent { - dockerfile { - dir 'automation' + docker { + image '$DOCKER_TAG' reuseNode true } } @@ -69,8 +75,8 @@ pipeline { } stage('Valgrind') { agent { - dockerfile { - dir 'automation' + docker { + image '$DOCKER_TAG' reuseNode true } }