Extract certain ci build steps into separate scripts.
The steps for building CTA from scratch in a container consists of a few steps. At the moment, these steps are all done separately in .gitlab/ci/build.gitlab-ci.yml
. However, for the development containerized compilation (#724) we will need similar functionality (and there might be more places where something like this is desirable).
As such, to ensure we don't end up with duplicated scripts, we can extract scripts and put them in continuousintegration/ci_helpers
. Specifically these two parts of the .gitlab/ci/build.gitlab-ci.yml
:
cta_srpm_alma9:
- yum -y install epel-release almalinux-release-devel git
- yum -y install git wget gcc gcc-c++ cmake3 make rpm-build yum-utils
- git submodule update --init --recursive
- ./continuousintegration/docker/ctafrontend/alma9/installOracle21.sh
- mkdir build_srpm
- cd build_srpm
- echo ${CMAKE_OPTIONS}
- cmake3 -DPackageOnly:Bool=true -DVCS_VERSION=${CTA_BUILD_ID} ${CMAKE_OPTIONS} ..
- make cta_srpm
cta_rpm_alma9:
- yum -y install epel-release almalinux-release-devel git
- yum -y install git wget gcc gcc-c++ cmake3 make rpm-build yum-utils
- yum -y install yum-plugin-versionlock
- git submodule update --init --recursive
- ./continuousintegration/docker/ctafrontend/alma9/installOracle21.sh
- cd xrootd-ssi-protobuf-interface && export XROOTD_SSI_PROTOBUF_INTERFACE_VERSION=$(git describe --tags --abbrev=0) && cd ..
- yum-builddep --nogpgcheck -y build_srpm/RPM/SRPMS/*
- mkdir build_rpm
- cd build_rpm
- cmake3 -DVCS_VERSION=${CTA_BUILD_ID} ${CMAKE_OPTIONS} ..
- make cta_rpm
Both of these follow a similar structure and can be put in the script:
- make the
yum install
optional to ensure this doesn't have to be done during development - Leave out the
git submodule update
- Make some other ci specific stuff (such as
CTA_BUILD_ID
optional)