From 6361fcb6bb32a3c150a6e82538393d11f8957e79 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:06:14 +0200 Subject: [PATCH 1/8] added Jenkinsfile, moved together with Dockerfile into automation folder having the automation files in an empty folder accelerates docker build. Also, I think these files are not related to the source code and as such should live in their own space --- automation/Dockerfile-q7s | 18 ++++++++++++++ automation/Jenkinsfile | 49 +++++++++++++++++++++++++++++++++++++++ bsp_q7s/Dockerfile | 35 ---------------------------- 3 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 automation/Dockerfile-q7s create mode 100644 automation/Jenkinsfile delete mode 100644 bsp_q7s/Dockerfile diff --git a/automation/Dockerfile-q7s b/automation/Dockerfile-q7s new file mode 100644 index 00000000..207afa04 --- /dev/null +++ b/automation/Dockerfile-q7s @@ -0,0 +1,18 @@ +FROM ubuntu:focal + +RUN apt-get update +RUN apt-get --yes upgrade +RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl + +# Q7S root filesystem, required for cross-compilation. +RUN mkdir -p /usr/rootfs; \ +curl https://buggy.irs.uni-stuttgart.de/eive/tools/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \ + | tar -xz -C /usr/rootfs + +# Cross compiler +RUN mkdir -p /usr/tools; \ +curl https://buggy.irs.uni-stuttgart.de/eive/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.gz \ + | tar -xz -C /usr/tools + +ENV Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi" +ENV PATH=$PATH:"/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile new file mode 100644 index 00000000..8b735710 --- /dev/null +++ b/automation/Jenkinsfile @@ -0,0 +1,49 @@ +pipeline { + agent any + stages { + stage('Build Container') { + when { + changeset "automation/Dockerfile-q7s" + branch 'develop' + } + steps { + sh 'docker build -t eive-fsw-build-q7s:gcc8 - < automation/Dockerfile-q7s' + + } + } + stage('Clean') { + when { + anyof { + changelog 'cleanCI' + changeset '*.cmake' + changeset 'CMakeLists.txt' + } + } + steps { + sh 'rm -rf build-q7s-debug' + } + } + stage('Build Q7S') { + agent { + docker { + image 'eive-fsw-build-q7s:gcc8' + reuseNode true + } + } + steps { + dir('build-q7s-debug') { + sh 'cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..' + sh 'cmake --build . -j' + } + } + } + stage('Deploy') { + when { + tag 'v*.*.*' + } + steps { + sh 'echo Deploying' + } + } + } +} diff --git a/bsp_q7s/Dockerfile b/bsp_q7s/Dockerfile deleted file mode 100644 index 04184c4a..00000000 --- a/bsp_q7s/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:latest -# FROM alpine:latest - -ENV TZ=Europe/Berlin -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && apt-get install -y curl cmake g++ - -# Q7S root filesystem, required for cross-compilation. Use IPv6 for curl -RUN mkdir -p /usr/rootfs; \ - curl -6 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/dnfMy9kGpgynN6J/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \ - | tar xvz -C /usr/rootfs -# Q7S C++ cross-compiler. Use IPv6 for curl -RUN mkdir -p /usr/tools; \ - curl -6 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/RMsbHydJc6PSqcz/download/gcc-arm-linux-gnueabi.tar.gz \ - | tar xvz -C /usr/tools - -# RUN apk add cmake make g++ - -# Required for cmake build -ENV Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi" -ENV PATH=$PATH:"/usr/tools/gcc-arm-linux-gnueabi/bin" - -WORKDIR /usr/src/app -COPY . . - -RUN set -ex; \ - rm -rf build-q7s; \ - mkdir build-q7s; \ - cd build-q7s; \ - cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=linux -DTGT_BSP="arm/q7s" ..; - -ENTRYPOINT ["cmake", "--build", "build-q7s"] -CMD ["-j"] -# CMD ["bash"] From afb7a2008f8267d118e34e23b1e90deb8d5e1d0f Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:14:37 +0200 Subject: [PATCH 2/8] typo in Jenkinsfile --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 8b735710..52cd895b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { } stage('Clean') { when { - anyof { + anyOf { changelog 'cleanCI' changeset '*.cmake' changeset 'CMakeLists.txt' From acaf87095aa504c8ceb603e3e4eca9516eecbc47 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:17:30 +0200 Subject: [PATCH 3/8] forcing docker build --- automation/Dockerfile-q7s | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/Dockerfile-q7s b/automation/Dockerfile-q7s index 207afa04..21b56439 100644 --- a/automation/Dockerfile-q7s +++ b/automation/Dockerfile-q7s @@ -14,5 +14,6 @@ RUN mkdir -p /usr/tools; \ curl https://buggy.irs.uni-stuttgart.de/eive/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.gz \ | tar -xz -C /usr/tools + ENV Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi" ENV PATH=$PATH:"/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" From af6f24d66866c4cc6e512bfab35cf89ccb9c94d6 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:18:32 +0200 Subject: [PATCH 4/8] forcing docker build #2 --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 52cd895b..70db7d41 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage('Build Container') { when { changeset "automation/Dockerfile-q7s" - branch 'develop' + branch 'mohr_ci' } steps { sh 'docker build -t eive-fsw-build-q7s:gcc8 - < automation/Dockerfile-q7s' From 6c8336bcfedc629b0ae95694cd00ec6269da1963 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:20:02 +0200 Subject: [PATCH 5/8] something's broken with the automatic docker build, reverting change, will look into it later --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 70db7d41..52cd895b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage('Build Container') { when { changeset "automation/Dockerfile-q7s" - branch 'mohr_ci' + branch 'develop' } steps { sh 'docker build -t eive-fsw-build-q7s:gcc8 - < automation/Dockerfile-q7s' From 93fa82c4135b173de84efa34226ecfe51b788dc5 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:23:17 +0200 Subject: [PATCH 6/8] copy pasted wrong cmake line --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 52cd895b..7b184280 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -32,7 +32,7 @@ pipeline { } steps { dir('build-q7s-debug') { - sh 'cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..' + sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..' sh 'cmake --build . -j' } } From 12be969ca2562649228caba9f043f087f56a1107 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:34:01 +0200 Subject: [PATCH 7/8] jenkins seems to overwrite out PATH --- automation/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 7b184280..43bf8728 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -32,6 +32,8 @@ pipeline { } steps { dir('build-q7s-debug') { + sh 'echo $PATH' + sh 'export PATH=$PATH:/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin' sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..' sh 'cmake --build . -j' } From 4fbfbe8bb86f5908374f2674398ee1bb8d88dff3 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 29 Jul 2021 12:38:24 +0200 Subject: [PATCH 8/8] cleanCI --- automation/Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 43bf8728..7b184280 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -32,8 +32,6 @@ pipeline { } steps { dir('build-q7s-debug') { - sh 'echo $PATH' - sh 'export PATH=$PATH:/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin' sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..' sh 'cmake --build . -j' }