cta-build.yml 4.14 KB
Newer Older
1
2
3
stages:
  - build:srpm
  - build:rpm
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
4
  - test:install
5
6
  - analysis:check
  - analysis:report
7
8
9
10
11
12
13
14
15
16

before_script:
  - export CTA_BUILD_ID=${CI_PIPELINE_ID}git${CI_COMMIT_SHA:0:8}
  - echo "Exporting CTA_BUILD_ID=${CTA_BUILD_ID}"
  - test -n "${CI_COMMIT_TAG}" && export TAG_VERSION=$(echo ${CI_COMMIT_TAG} | sed -e 's/^v//;s/-.*$//')
  - test -n "${CI_COMMIT_TAG}" && export TAG_RELEASE=$(echo ${CI_COMMIT_TAG} | sed -e 's/^[^-]*-//')

cta_srpm:
  stage: build:srpm
  retry: 1
17
  image: centos:7
18
19
20
21
22
23
24
25
  script:
    - yum install -y gcc-c++ cmake make rpm-build
    - mkdir build_srpm
    - cd build_srpm
    - cmake -DPackageOnly:Bool=true -DVCS_VERSION=${CTA_BUILD_ID} ..
    - make cta_srpm

  artifacts:
26
    expire_in: 2 days
27
28
29
30
31
32
33
34
35
    paths:
    - build_srpm/RPM/SRPMS/


cta_rpm:
  except:
    - tags
  stage: build:rpm
  retry: 1
36
  image: centos:7
37
  script:
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
38
    - yum install -y yum-utils epel-release
39
    - yum install -y centos-release-openstack-train
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
40
    - cp continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/eos-citrine-depend.repo /etc/yum.repos.d/.
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
41
    - rpm -import https://storage-ci.web.cern.ch/storage-ci/storageci.key
42
    # CTA uses a fixed version of CEPH
43
44
    #- yum install -y https://download.ceph.com/rpm-nautilus/el7/noarch/ceph-release-1-1.el7.noarch.rpm 
    #- yum install -y librados-devel librados2 libradosstriper-devel libradosstriper1 libradospp-devel
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
45
    - yum localinstall -y https://download.ceph.com/rpm-nautilus/el7/x86_64/librados-devel-14.2.20-0.el7.x86_64.rpm https://download.ceph.com/rpm-nautilus/el7/x86_64/librados2-14.2.20-0.el7.x86_64.rpm https://download.ceph.com/rpm-nautilus/el7/x86_64/libradosstriper-devel-14.2.20-0.el7.x86_64.rpm https://download.ceph.com/rpm-nautilus/el7/x86_64/libradosstriper1-14.2.20-0.el7.x86_64.rpm https://download.ceph.com/rpm-nautilus/el7/x86_64/libradospp-devel-14.2.20-0.el7.x86_64.rpm
46
    # oracle libs
47
48
49
    - rpm -import https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
    - yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64
    - yum install -y oracle-instantclient19.3-devel oracle-instantclient19.3-sqlplus oracle-instantclient19.3-basic
50
    # essential build tools
51
52
    - yum install -y gcc-c++ cmake make rpm-build
    - yum -y install yum-plugin-priorities yum-plugin-versionlock
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
53
    - cp -f continuousintegration/docker/ctafrontend/cc7/etc/yum/pluginconf.d/versionlock.list /etc/yum/pluginconf.d/
54
55
56
57
58
59
60
61
62
    - yum install -y git
    - git submodule update --init --recursive
    - yum-builddep --nogpgcheck -y build_srpm/RPM/SRPMS/*
    - mkdir build_rpm
    - cd build_rpm
    - cmake -DVCS_VERSION=${CTA_BUILD_ID} ..
    - make cta_rpm

  artifacts:
63
    expire_in: 2 days
64
65
    paths:
    - build_rpm/RPM/RPMS
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

test_install:
  except:
    - tags
  stage: test:install
  retry: 1
  image: centos:7
  script:
    - yum install -y wget
    - yum install -y yum-utils epel-release
    - yum install -y centos-release-openstack-train
    - cp continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/eos-citrine-depend.repo /etc/yum.repos.d/.
    - cp continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d-public/eos-citrine.repo /etc/yum.repos.d/.
    - rpm -import https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
    - yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64
    - yum install -y oracle-instantclient19.3-devel oracle-instantclient19.3-sqlplus oracle-instantclient19.3-bas
    - yum -y install yum-plugin-priorities yum-plugin-versionlock
    - yum -y install -x cta-migration\* build_rpm/RPM/RPMS/x86_64/cta-*

Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
85
cppcheck:
86
  stage: analysis:check
Tigran Mkrtchyan's avatar
Tigran Mkrtchyan committed
87
88
89
90
  image:
    name: neszt/cppcheck-docker
    entrypoint: ["/usr/bin/env"]
  script:
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    - cppcheck --xml --enable=warning,style,performance . 2> cppcheck_out.xml
  artifacts:
    expire_in: 2 days
    paths:
    - cppcheck_out.xml


# based on https://gitlab.com/ahogen/cppcheck-codequality
cppcheck_report:
  stage: analysis:report
  image: centos:7
  script:
    - yum -y install python3-pip
    - python3 -m pip install -U cppcheck_codequality
    - cppcheck-codequality --input-file=cppcheck_out.xml --output-file=cppcheck.json
  artifacts:
    reports:
      codequality: cppcheck.json