Changes to Dockerfile and Jenkinsfile

1. Install Catch2 from sources inside a Docker stage/layer
2. Some tweaks to Jenkinsfile
This commit is contained in:
Robin Müller 2022-01-27 11:30:33 +01:00
parent c453af5911
commit 441b3b83c8
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 27 additions and 15 deletions

View File

@ -6,3 +6,9 @@ RUN apt-get --yes upgrade
#tzdata is a dependency, won't install otherwise #tzdata is a dependency, won't install otherwise
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano 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

View File

@ -1,22 +1,28 @@
pipeline { pipeline {
agent any agent any
environment { environment {
DOCKER_TAG = 'fsfw-build'
BUILDDIR = 'build-tests' BUILDDIR = 'build-tests'
} }
stages { stages {
stage('Create Docker') { stage('Build Container') {
agent { when {
dockerfile { anyOf {
dir 'automation' changeset "automation/Dockerfile";
additionalBuildArgs '--no-cache' changelog 'cleanDocker'
reuseNode true
} }
} }
steps { steps {
sh 'rm -rf $BUILDDIR' sh 'docker build -t $DOCKER_TAG - < automation/Dockerfile'
} }
} }
stage('Clean') { stage('Clean') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
when { when {
anyOf { anyOf {
changelog 'cleanCI' changelog 'cleanCI'
@ -30,8 +36,8 @@ pipeline {
} }
stage('Configure') { stage('Configure') {
agent { agent {
dockerfile { docker {
dir 'automation' image '$DOCKER_TAG'
reuseNode true reuseNode true
} }
} }
@ -43,8 +49,8 @@ pipeline {
} }
stage('Build') { stage('Build') {
agent { agent {
dockerfile { docker {
dir 'automation' image '$DOCKER_TAG'
reuseNode true reuseNode true
} }
} }
@ -56,8 +62,8 @@ pipeline {
} }
stage('Unittests') { stage('Unittests') {
agent { agent {
dockerfile { docker {
dir 'automation' image '$DOCKER_TAG'
reuseNode true reuseNode true
} }
} }
@ -69,8 +75,8 @@ pipeline {
} }
stage('Valgrind') { stage('Valgrind') {
agent { agent {
dockerfile { docker {
dir 'automation' image '$DOCKER_TAG'
reuseNode true reuseNode true
} }
} }