-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
116 lines (104 loc) · 4.06 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
before_script:
- echo '*** Install packages needed by aravis ***'
- export REL_OS_NAME=$(lsb_release -is)
- >
if [ "$REL_OS_NAME" = "CentOS" ]; then
if [ -x "/opt/rh/devtoolset-7/enable" ]; then
source /opt/rh/devtoolset-7/enable
fi
yum install -y intltool glib2-devel
elif [ "$REL_OS_NAME" = "Ubuntu" ]; then
apt-get update
apt-get install -y intltool libglib2.0-dev
fi
stages:
- lint
- build
.release_build_template: &release_build
stage: build
script:
- export REL_OS_NAME=$(lsb_release -is)
- export REL_OS_VERS=$(lsb_release -rs | sed -r "s/^([0-9]+).*/\1/")
- export REL_ARCH=$(uname -m)
- export REL_PROJECT_NAME=$CI_PROJECT_NAME
- export REL_TAG=$CI_COMMIT_REF_NAME
- export REL_ARTIFACT_DEST=karaboDevices/$REL_PROJECT_NAME/tags/$CI_COMMIT_REF_NAME
- export KARABO_TAG=$(echo $REL_TAG | sed -r "s/^([0-9]+.[0-9]+.[0-9]+)-([0-9]+.[0-9]+.[0-9]+)/\2/")
- export REL_ARTIFACT_NAME=$REL_PROJECT_NAME-$REL_TAG-$KARABO_TAG-$REL_OS_NAME-$REL_OS_VERS-$REL_ARCH-Release.sh
- curl http://exflserv05.desy.de/karabo/karaboFramework/tags/$KARABO_TAG/karabo-$KARABO_TAG-Release-$REL_OS_NAME-$REL_OS_VERS-x86_64.sh > karabo.sh
- bash karabo.sh --prefix=/root
- source /root/karabo/activate
- export KARABO_BROKER_TOPIC="gitlab_ci_$CI_JOB_ID"
- pushd $CI_PROJECT_DIR
- karabo -g https://[email protected] install $REL_PROJECT_NAME $REL_TAG
- export NUM_JOBS=$(grep "processor" /proc/cpuinfo | wc -l)
- make -j$NUM_JOBS CONF=Release package
- echo package/$REL_ARTIFACT_NAME
- mv package/*sh $REL_ARTIFACT_NAME
- echo $REL_ARTIFACT_DEST
- sshpass -p "$XKARABO_PWD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null xkarabo@exflserv05 "mkdir -p /var/www/html/karabo/$REL_ARTIFACT_DEST"
- sshpass -p "$XKARABO_PWD" scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $REL_ARTIFACT_NAME xkarabo@exflserv05:/var/www/html/karabo/$REL_ARTIFACT_DEST
only:
- /^(\d+\.)(\d+\.)(\d+)-(\d+\.)(\d+\.)(\d+)((a|b|rc)\d+)?$/
except:
- branches
.test_build_template: &test_build
stage: build
script:
- export REL_OS_NAME=$(lsb_release -is)
- export REL_OS_VERS_LONG=$(lsb_release -rs | sed -r "s/^([0-9]+).*/\1/")
- export REL_PROJECT_NAME=$CI_PROJECT_NAME
- export REL_TAG=$CI_BUILD_REF_NAME
- export KARABO_TAG="latest_prerelease_build"
- curl http://exflserv05.desy.de/karabo/karaboFramework/tags/$KARABO_TAG/karabo-$KARABO_TAG-Release-$REL_OS_NAME-$REL_OS_VERS_LONG-x86_64.sh > karabo.sh
- bash karabo.sh --prefix=/root
- source /root/karabo/activate
- export KARABO_BROKER_TOPIC="gitlab_ci_$CI_JOB_ID"
- pushd $CI_PROJECT_DIR
- karabo -g https://[email protected] install $REL_PROJECT_NAME $REL_TAG
- export NUM_JOBS=$(grep "processor" /proc/cpuinfo | wc -l)
- make -j$NUM_JOBS build CONF=Release
- export GTEST_OUTPUT=xml:$CI_PROJECT_DIR/report.xml
- make test CONF=Release
only:
- branches
except:
- master
artifacts:
when: always
reports:
junit: report.xml
##### Static source code analysis #####
lint:
stage: lint
image: europeanxfel/karabo-ci:miniconda-3lint
script:
- git clone https://[email protected]/Karabo/linter-tools.git ci
- source ci/lint-cppcheck.sh
##### Static source code analysis #####
lint-clang-tidy:
stage: lint
image: europeanxfel/karabo-ci:miniconda-3lint
script:
- git clone https://[email protected]/Karabo/linter-tools.git ci
- source ci/lint-clang-tidy.sh
##### Release build #####
release:ubuntu20:
image: europeanxfel/karabo-ci:ubuntu-20
<<: *release_build
release:ubuntu22:
image: europeanxfel/karabo-ci:ubuntu-22
<<: *release_build
release:centos7:
image: europeanxfel/karabo-ci:centos-7gcc7
<<: *release_build
##### Test build #####
test:ubuntu20:
image: europeanxfel/karabo-ci:ubuntu-20
<<: *test_build
test:ubuntu22:
image: europeanxfel/karabo-ci:ubuntu-22
<<: *test_build
test:centos7:
image: europeanxfel/karabo-ci:centos-7gcc7
<<: *test_build