stages: - build:srpm - build:rpm - build:dockerimage - rename:dockerimage - test - publish_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/^[^-]*-//') cta_srpm: stage: build:srpm image: gitlab-registry.cern.ch/linuxsupport/cc7-base 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/ tags: - docker cta_rpm: stage: build:rpm image: gitlab-registry.cern.ch/linuxsupport/cc7-base 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-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 tags: - docker cta_tagged_rpm: stage: build:rpm image: gitlab-registry.cern.ch/linuxsupport/cc7-base script: - if [ -z "${CI_COMMIT_TAG}" ]; then echo "This is not a tagged commit, exiting"; exit 0; fi - echo "Building package for tag ${CI_COMMIT_TAG}. CTA_VERSION=${TAG_VERSION} - CTA_RELEASE=${TAG_RELEASE}" - 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-builddep --nogpgcheck -y build_srpm/RPM/SRPMS/* - mkdir build_tagged_rpm - cd build_tagged_rpm - CTA_VERSION=${TAG_VERSION} cmake -DVCS_VERSION=${TAG_RELEASE} .. - make cta_rpm artifacts: expire_in: 30 days paths: - build_tagged_rpm/RPM/RPMS tags: - docker publish_tagged_rpm: stage: publish_rpm image: gitlab-registry.cern.ch/linuxsupport/cc7-base script: - if [ -z "${CI_COMMIT_TAG}" ]; then echo "This is not a tagged commit, exiting"; exit 0; fi - EOS_ACCOUNT_USERNAME=${DOCKER_LOGIN_USERNAME} EOS_ACCOUNT_PASSWORD=${DOCKER_LOGIN_PASSWORD} CI_OUTPUT_DIR=build_tagged_rpm/RPM/RPMS EOS_PATH=/eos/user/c/ctareg/www/cta-repo HOOK=/eos/user/c/ctareg/www/cta-repo/update_repos.sh continuousintegration/ci_helpers/deploy-eos.sh tags: - docker cta_valgrind: stage: test variables: CTAREPODIR: /tmp/repo image: gitlab-registry.cern.ch/linuxsupport/cc7-base script: - cp -f continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/* /etc/yum.repos.d/ - yum -y install yum-plugin-priorities createrepo - cp -f continuousintegration/docker/ctafrontend/cc7/etc/yum/pluginconf.d/versionlock.list /etc/yum/pluginconf.d/ - mkdir -p ${CTAREPODIR}; cp -r build_rpm/RPM ${CTAREPODIR} - createrepo ${CTAREPODIR}; echo -e "[cta-artifacts]\nname=CTA artifacts\nbaseurl=file://${CTAREPODIR}\ngpgcheck=0\nenabled=1\npriority=2" > /etc/yum.repos.d/cta-artifacts.repo - yum -y --nogpgcheck install cta-systemtests cta-debuginfo sqlite-debuginfo --enablerepo=debug - /usr/bin/cta-unitPlusSystemTests.sh tags: - docker ctageneric_docker: stage: build:dockerimage tags: - docker-image-build script: - "" variables: TO: gitlab-registry.cern.ch/cta/ctageneric:${CI_PIPELINE_ID} DOCKER_FILE: continuousintegration/docker/ctafrontend/cc7/Dockerfile ctageneric_docker_rename: stage: rename:dockerimage variables: TO: gitlab-registry.cern.ch/cta/ctageneric REPOSITORY: cta/ctageneric GITLAB_HOST: gitlab.cern.ch script: - export OLDTAG=${CI_PIPELINE_ID} - export NEWTAG=${CTA_BUILD_ID} - cd continuousintegration/ci_helpers/ - ./rename_tag.sh archiveretrieve: stage: test script: - export NAMESPACE="archiveretrieve-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)" - cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/archive_retrieve.sh artifacts: when: always expire_in: 30 days paths: - pod_logs tags: - kubernetes - mhvtl