cta-build.yml 1.62 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
stages:
  - build:srpm
  - build:rpm

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/^[^-]*-//')
  - echo "Removing protectbase from all repos (same as Puppet)"
  - sed -i '/^protect=/d' /etc/yum.repos.d/*

cta_srpm:
  stage: build:srpm
  retry: 1
16
  image: centos:7
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  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:
    expire_in: 30 days
    paths:
    - build_srpm/RPM/SRPMS/


cta_rpm:
  except:
    - tags
  stage: build:rpm
  retry: 1
35
  image: centos:7
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  script:
    - cp -f continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/*.repo /etc/yum.repos.d/
    - yum install -y gcc-c++ cmake make rpm-build
    - yum -y install yum-plugin-priorities yum-plugin-versionlock
    - yum install -y git
    - git submodule update --init --recursive
    - cd xrootd-ssi-protobuf-interface && export XROOTD_SSI_PROTOBUF_INTERFACE_VERSION=$(git describe --abbrev=0) && cd ..
    - cp -f continuousintegration/docker/ctafrontend/cc7/etc/yum/pluginconf.d/versionlock.list /etc/yum/pluginconf.d/
    - yum-builddep --nogpgcheck -y build_srpm/RPM/SRPMS/*
    - mkdir build_rpm
    - cd build_rpm
    - cmake -DVCS_VERSION=${CTA_BUILD_ID} ..
    - make cta_rpm

  artifacts:
    expire_in: 30 days
    paths:
    - build_rpm/RPM/RPMS