Skip to content

Commit

Permalink
CI : Remove duplication accross SLC6 and CentOS7 build job configs; r…
Browse files Browse the repository at this point in the history
…efs issue #51
  • Loading branch information
tswilliams committed Aug 1, 2017
1 parent fe3988e commit c39bbed
Showing 1 changed file with 27 additions and 37 deletions.
64 changes: 27 additions & 37 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,61 +88,51 @@ doxygen_job:



build:centos7:

.job_template: &build_job
stage: build
image: tswilliams/ipbus-sw-dev-cc7:latest
tags:
- docker
except:
- triggers
before_script:
- sudo yum -y install boost-devel pugixml-devel
- sudo yum -y install createrepo krb5-workstation openssh-clients
- sudo yum -y install createrepo krb5-workstation openssh-clients ${ADDITIONAL_RPMS_TO_INSTALL}
- mkdir -p ~/.ssh && cp ci/ssh_config ~/.ssh/config
- export OUTPUT_PIPELINE_DIR=${OUTPUT_ROOT_DIR}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export OUTPUT_PIPELINE_DIR=${OUTPUT_PIPELINE_DIR/commits/tags} ; fi
script:
- env | grep -v PASSWORD | grep -v TOKEN
- make -k Set=all
- make -k Set=all rpm
- mkdir -p cc7_rpms
- cp `find . -iname "*.rpm"` cc7_rpms
- cp yumgroups-centos7.xml cc7_rpms/
- ls cc7_rpms
- createrepo -vg yumgroups-centos7.xml cc7_rpms/
- mkdir -p yumrepo
- cp `find . -iname "*.rpm"` yumrepo
- cp ${YUMGROUPS_FILE} yumrepo/yumgroups.xml
- ls yumrepo
- createrepo -vg yumgroups.xml yumrepo
- echo "${KRB_PASSWORD}" | kinit ${KRB_USERNAME}@CERN.CH
- klist
- ssh ${KRB_USERNAME}@lxplus "mkdir -p ${OUTPUT_PIPELINE_DIR}"
- ssh ${KRB_USERNAME}@lxplus "mkdir -p ${OUTPUT_PIPELINE_DIR}/repos"
- ssh ${KRB_USERNAME}@lxplus "ln -sfn ${OUTPUT_PIPELINE_DIR} `dirname ${OUTPUT_PIPELINE_DIR}`/latest"
- rsync -av cc7_rpms/ ${KRB_USERNAME}@lxplus:${OUTPUT_PIPELINE_DIR}/centos7_x86_64
- rsync -av yumrepo/ ${KRB_USERNAME}@lxplus:${OUTPUT_PIPELINE_DIR}/repos/${OUTPUT_REPO_SUBDIR}


build:slc6:
stage: build
<<: *build_job
image: tswilliams/ipbus-sw-dev-slc6:latest
tags:
- docker
except:
- triggers
before_script:
- sudo yum -y install createrepo krb5-workstation openssh-clients
- mkdir -p ~/.ssh && cp ci/ssh_config ~/.ssh/config
- export OUTPUT_PIPELINE_DIR=${OUTPUT_ROOT_DIR}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export OUTPUT_PIPELINE_DIR=${OUTPUT_PIPELINE_DIR/commits/tags} ; fi
script:
- env | grep -v PASSWORD | grep -v TOKEN
- make -k Set=all
- make -k Set=all rpm
- mkdir -p slc6_rpms
- cp `find . -iname "*.rpm"` slc6_rpms
- cp yumgroups-slc6.xml slc6_rpms/
- ls slc6_rpms
- createrepo -vg yumgroups-slc6.xml slc6_rpms
- echo "${KRB_PASSWORD}" | kinit ${KRB_USERNAME}@CERN.CH
- klist
- ssh ${KRB_USERNAME}@lxplus "mkdir -p ${OUTPUT_PIPELINE_DIR}"
- ssh ${KRB_USERNAME}@lxplus "ln -sfn ${OUTPUT_PIPELINE_DIR} `dirname ${OUTPUT_PIPELINE_DIR}`/latest"
- rsync -av slc6_rpms/ ${KRB_USERNAME}@lxplus:${OUTPUT_PIPELINE_DIR}/slc6_x86_64
variables:
ADDITIONAL_RPMS_TO_INSTALL: ""
YUMGROUPS_FILE: "yumgroups-slc6.xml"
OUTPUT_REPO_SUBDIR: "slc6_x86_64"


build:centos7:
<<: *build_job
image: tswilliams/ipbus-sw-dev-cc7:latest
variables:
ADDITIONAL_RPMS_TO_INSTALL: "boost-devel pugixml-devel"
YUMGROUPS_FILE: "yumgroups-centos7.xml"
OUTPUT_REPO_SUBDIR: "centos7_x86_64"




Expand All @@ -156,7 +146,7 @@ build:slc6:
- export OUTPUT_PIPELINE_URL=${OUTPUT_ROOT_URL}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export OUTPUT_PIPELINE_URL=${OUTPUT_PIPELINE_URL/commits/tags} ; fi
- sudo cp ci/ipbus-sw-ci.repo /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo sed -i -re "s|^baseurl=.*|baseurl=${OUTPUT_PIPELINE_URL}/slc6_x86_64|g" /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo sed -i -re "s|^baseurl=.*|baseurl=${OUTPUT_PIPELINE_URL}/repos/slc6_x86_64|g" /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo yum clean all
- sudo yum -y groupinstall uhal
- rpm -qa | grep cactus | sort
Expand All @@ -172,7 +162,7 @@ build:slc6:
- export OUTPUT_PIPELINE_URL=${OUTPUT_ROOT_URL}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export OUTPUT_PIPELINE_URL=${OUTPUT_PIPELINE_URL/commits/tags} ; fi
- sudo cp ci/ipbus-sw-ci.repo /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo sed -i -re "s|^baseurl=.*|baseurl=${OUTPUT_PIPELINE_URL}/centos7_x86_64|g" /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo sed -i -re "s|^baseurl=.*|baseurl=${OUTPUT_PIPELINE_URL}/repos/centos7_x86_64|g" /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo yum clean all
- sudo yum -y groupinstall uhal
- sudo yum -y install which
Expand Down

0 comments on commit c39bbed

Please sign in to comment.