forked from Unipisa/Simu5G
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
65 lines (60 loc) · 2.37 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
variables:
RV: 'crownet/scripts'
# Tags of all containers required for building and testing
# Note: Tags here must include ALL container tags required in the fingerprint
# *.csv and *.yml files.
INETBRANCH: 'v4.5.2'
BUILDMODE: 'release'
CROWNET_IMAGE_REG: '${CI_REGISTRY}'
CROWNET_IMAGE_BASE: '${CROWNET_IMAGE_REG}/rover/crownet'
CROWNET_OPP_CONT_TAG: '6.0.3' #tag of OMNeT++ container to be used
CROWNET_IMAGE_REG: '${CI_REGISTRY}'
CROWNET_IMAGE_BASE: '${CROWNET_IMAGE_REG}/rover/crownet'
stages:
- build
- test
# this job
# - prepares the environment
# (pulls required docker containers, clones and builds inet)
# - builds the simu5g project itself
Build:
stage: build
before_script:
# docker login asks for the password to be passed through stdin for security
# we use $CI_JOB_TOKEN here which is a special token provided by GitLab
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
- docker pull $CI_REGISTRY/rover/crownet/omnetpp:${CROWNET_OPP_CONT_TAG}
script:
- "mkdir .tmp"
- "mv * .tmp"
- "git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@sam-dev.cs.hm.edu/rover/crownet.git"
- "mv .tmp simu5g"
- "git clone --branch ${INETBRANCH} https://gitlab-ci-token:${CI_JOB_TOKEN}@sam-dev.cs.hm.edu/rover/inet.git inet4"
- "cd inet4"
- "../$RV/omnetpp ${CROWNET_OPP_CONT_TAG} exec \"source setenv && make makefiles\""
- "../$RV/omnetpp ${CROWNET_OPP_CONT_TAG} exec \"source setenv && make -j16 MODE=${BUILDMODE}\"; TEST_STATUS=${PIPESTATUS[0]}"
# we do not need the inet sources anymore - delete them to have less artifacts
- "find . -name \"*.cc\" -type f -delete"
# build simu5g itself
- "cd ../simu5g"
- "../$RV/omnetpp ${CROWNET_OPP_CONT_TAG} exec make makefiles"
- "../$RV/omnetpp ${CROWNET_OPP_CONT_TAG} exec make -j16 MODE=${BUILDMODE}"
artifacts:
paths:
# we keep the scripts
- crownet/scripts
# we need to keep the ned files and the simu5g lib
- simu5g
# we need to keep the ned files and the inet lib (all stored in the src subfolder)
- inet4/src
expire_in: 2 weeks
# This job runs the fingerprint tests
Fingerprints:
stage: test
script:
- "cd simu5g/tests/fingerprint"
- "../../../../$RV/omnetpp ${CROWNET_OPP_CONT_TAG} exec ./fingerprints"
artifacts:
paths:
- simu5g/tests/fingerprint
expire_in: 2 weeks