Skip to content
Snippets Groups Projects
Commit 7195984e authored by Eduard Ciolompea's avatar Eduard Ciolompea
Browse files

Initial upload of crosscompilation files

parent a1b74d6e
No related branches found
No related tags found
No related merge requests found
################################################################################
# Copyright (c) 2020-2021 in-tech GmbH
# 2021 ITK-Engineering GmbH
# 2023 Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
# 2022-2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update && apt-get -qq dist-upgrade && apt-get install -qq -y --no-install-recommends \
antlr4 \
build-essential \
ca-certificates \
ccache \
cmake \
clang-format-15 \
doxygen \
g++ \
gcc \
git \
google-mock \
googletest \
graphviz \
lcov \
libboost-filesystem-dev \
libgmock-dev \
libgtest-dev \
libprotobuf-dev \
libqt5xmlpatterns5-dev \
libantlr4-runtime4.9 \
libantlr4-runtime-java \
libantlr4-runtime-dev \
openjdk-17-jre \
pkg-config \
protobuf-compiler \
python3 \
python3-distutils \
python3-pip \
qtbase5-dev \
uuid-dev \
g++-mingw-w64-x86-64 \
gcc-mingw-w64-x86-64 \
&& apt-get -qq clean
RUN apt-get install -qq -y --no-install-recommends \
texlive-base \
texlive-latex-extra
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install \
approvaltests==3.1.0 \
empty-files \
breathe \
"conan>=2.0" \
exhale \
"junitparser==3.1.0" \
"lxml==4.9.3" \
"pandas==2.1.0" \
"numpy==1.24.2" \
"pytest==7.4.2" \
"psutil==5.9.5" \
"pytest-xdist[psutil]==3.3.1" \
"filelock==3.12.3" \
sphinx \
sphinx-rtd-theme \
sphinx-tabs \
sphinxcontrib-spelling \
watchdog \
myst-parser
# Create a folder
RUN mkdir -p /scm/conan
RUN mkdir -p /.cache && chmod -R 777 /.cache
# set the folder as a conan home
ENV CONAN_HOME='/scm/conan'
# copy the required contents from the repo to build conan packages
COPY repo/utils/ci/scripts/15_prepare-thirdParty.sh repo/utils/ci/scripts/15_prepare-thirdParty.sh
COPY repo/utils/conan repo/utils/conan
RUN chmod 777 repo/utils/ci/scripts/15_prepare-thirdParty.sh
# Create conan packages and make it available in /scm, allows not to build everytime
RUN repo/utils/ci/scripts/15_prepare-thirdParty.sh && chmod -R 777 /scm
/********************************************************************************
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
pipeline {
agent none
parameters {
booleanParam(name: 'BUILD_DOCKER_IMAGE', defaultValue: false, description: 'Force docker image (re-)build')
}
options {
checkoutToSubdirectory('repo')
timeout(time: 10, unit: 'HOURS')
timestamps()
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder(logRotator(numToKeepStr: '14', artifactNumToKeepStr: '5'))
}
environment {
IMAGE_NAME = "eclipsescm/scm-ci-cross-compilation"
REPO_URL = "https://gitlab.eclipse.org/eclipse/scm/scm.git"
DOCKERFILE_PATH = "utils/Dockerfile.CrossCompilation"
OP_RELEASE_VERSION = "v1.1.0"
}
stages {
stage('Build docker image or set image tag') {
agent {
kubernetes {
inheritFrom 'scm-agent-pod-' + env.BUILD_NUMBER
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: ose-build
image: nmraghu/openpass:fmicrosscompilation
tty: true
resources:
limits:
memory: "16Gi"
cpu: "4"
requests:
memory: "16Gi"
cpu: "4"
- name: jnlp
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
volumes:
- name: volume-known-hosts
configMap:
name: known-hosts
"""
}
}
stages {
stage('Build docker image') {
when {
expression {
return params.BUILD_DOCKER_IMAGE
}
}
steps {
script {
env.IMAGE_TAG = "v0.1"
}
build job: 'Docker-build', parameters: [string(name: 'IMAGE_NAME', value: "${env.IMAGE_NAME}"),
string(name: 'IMAGE_TAG', value:"${env.IMAGE_TAG}"),
string(name: 'REPO_URL', value: "${env.REPO_URL}"),
string(name: 'BRANCH_NAME', value: "${env.GIT_BRANCH}"),
string(name: 'DOCKERFILE_PATH', value: "${env.DOCKERFILE_PATH}")],
propagate: true
}
}
stage('Set image tag') {
when {
expression {
return !params.BUILD_DOCKER_IMAGE
}
}
steps {
script {
env.IMAGE_TAG = "v0.1"
}
}
}
}
}
stage('SCM Linux build')
{
parallel
{
stage('Stage: E2E')
{
agent {
kubernetes {
inheritFrom 'scm-agent-pod-' + env.BUILD_NUMBER
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: e2etest-build
image: "${env.IMAGE_NAME}:${env.IMAGE_TAG}"
tty: true
resources:
limits:
memory: "16Gi"
cpu: "4"
requests:
memory: "16Gi"
cpu: "4"
- name: jnlp
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
volumes:
- name: volume-known-hosts
configMap:
name: known-hosts
"""
}
}
stages
{
stage('End2End-Tests (Prepare and run)')
{
steps
{
container('e2etest-build')
{
sh 'bash repo/utils/ci/scripts/10_prepare.sh'
sh 'bash repo/utils/ci/scripts/12_download-openpass-artifacts.sh'
sh 'bash repo/utils/ci/scripts/11_prepare-openpass.sh'
sh 'bash repo/utils/ci/scripts/15_prepare-thirdParty.sh'
sh 'bash repo/utils/ci/scripts/21_configure-integration.sh'
sh 'bash repo/utils/ci/scripts/30_build.sh'
sh 'bash repo/utils/ci/scripts/51_e2e-test.sh'
}
}
post
{
always
{
junit allowEmptyResults: true, testResults: 'dist/pyOpenPASS/result_*.xml'
sh 'bash repo/utils/ci/scripts/60_pack_artifacts.sh'
archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false
}
}
}
}
}
stage('Stage: Unittests')
{
agent {
kubernetes {
inheritFrom 'scm-agent-pod-' + env.BUILD_NUMBER
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: unittest-build
image: "${env.IMAGE_NAME}:${env.IMAGE_TAG}"
tty: true
resources:
limits:
memory: "16Gi"
cpu: "4"
requests:
memory: "16Gi"
cpu: "4"
- name: jnlp
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
volumes:
- name: volume-known-hosts
configMap:
name: known-hosts
"""
}
}
stages
{
stage('Unittests')
{
steps
{
container('unittest-build')
{
sh 'bash repo/utils/ci/scripts/10_prepare.sh'
sh 'bash repo/utils/ci/scripts/15_prepare-thirdParty.sh'
sh 'bash repo/utils/ci/scripts/20_configure.sh'
sh 'bash repo/utils/ci/scripts/30_build.sh'
sh 'bash repo/utils/ci/scripts/50_test.sh'
withCredentials([string(credentialsId: 'gitlab-api-token', variable: 'GITLAB_BOT_TOKEN')])
{
sh 'bash repo/utils/ci/scripts/61_pack_scm_artifacts.sh'
}
}
}
post
{
always
{
junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml'
archiveArtifacts allowEmptyArchive: true, artifacts: 'dist/**', followSymlinks: false
emailext attachLog: (currentBuild.currentResult == 'FAILURE') ? true : false,
subject: "Jenkins ${env.JOB_BASE_NAME} ${STAGE_NAME} [${currentBuild.currentResult}] - ${env.BRANCH_NAME} #${env.BUILD_NUMBER}",
body: "More info at: ${env.BUILD_URL}",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
}
}
}
stage ('Deploy')
{
when {
anyOf {
tag pattern: "v.*", comparator: "REGEXP"
branch "main"
}
}
steps {
container('jnlp') {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh 'bash repo/utils/ci/scripts/70_publish_artifacts.sh'
}
}
}
}
}
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment