Updated CI Build

- Always clean and rebuild docker image.
- Use single docker container
This commit is contained in:
Ulrich Mohr 2022-01-31 14:59:45 +01:00
parent eba9abfc9a
commit b98127cea6

View File

@ -1,11 +1,8 @@
pipeline { pipeline {
agent any
environment { environment {
DOCK_FILE_DIR = 'automation' DOCK_FILE_DIR = 'automation'
BUILDDIR = 'build-tests' BUILDDIR = 'build-tests'
} }
stages {
stage('Create Docker') {
agent { agent {
dockerfile { dockerfile {
dir DOCK_FILE_DIR dir DOCK_FILE_DIR
@ -13,42 +10,13 @@ pipeline {
reuseNode true reuseNode true
} }
} }
// Does not work, but maybe not necessary anyway.. stages {
//when {
// anyOf {
// changeset "${DOCK_FILE_DIR}/Dockerfile";
// changelog 'cleanDocker'
// }
//}
steps {
sh 'rm -rf $BUILDDIR'
}
}
stage('Clean') { stage('Clean') {
agent {
dockerfile {
dir DOCK_FILE_DIR
reuseNode true
}
}
when {
anyOf {
changelog 'cleanCI'
changeset '*.cmake'
changeset 'CMakeLists.txt'
}
}
steps { steps {
sh 'rm -rf $BUILDDIR' sh 'rm -rf $BUILDDIR'
} }
} }
stage('Configure') { stage('Configure') {
agent {
dockerfile {
dir DOCK_FILE_DIR
reuseNode true
}
}
steps { steps {
dir(BUILDDIR) { dir(BUILDDIR) {
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..' sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
@ -56,12 +24,6 @@ pipeline {
} }
} }
stage('Build') { stage('Build') {
agent {
dockerfile {
dir DOCK_FILE_DIR
reuseNode true
}
}
steps { steps {
dir(BUILDDIR) { dir(BUILDDIR) {
sh 'cmake --build . -j' sh 'cmake --build . -j'
@ -69,12 +31,6 @@ pipeline {
} }
} }
stage('Unittests') { stage('Unittests') {
agent {
dockerfile {
dir DOCK_FILE_DIR
reuseNode true
}
}
steps { steps {
dir(BUILDDIR) { dir(BUILDDIR) {
sh 'cmake --build . -- fsfw-tests_coverage -j' sh 'cmake --build . -- fsfw-tests_coverage -j'
@ -82,12 +38,6 @@ pipeline {
} }
} }
stage('Valgrind') { stage('Valgrind') {
agent {
dockerfile {
dir DOCK_FILE_DIR
reuseNode true
}
}
steps { steps {
dir(BUILDDIR) { dir(BUILDDIR) {
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests' sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'