diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh index b4e2335..384c3b3 100644 --- a/ci/entrypoint.sh +++ b/ci/entrypoint.sh @@ -1,116 +1,117 @@ #!/bin/bash if [ ! -d "/srv/stick.git" ]; then git clone https://git.kolab.org/diffusion/QA/stick.git /srv/stick.git else pushd /srv/stick.git git remote set-url origin https://git.kolab.org/diffusion/QA/stick.git git fetch origin git reset --hard origin/master git clean -d -f -x popd fi # Create 3 as an alias for 1, so the _shell function # can output data without the caller getting the input. exec 3>&1 # If PS1 is set, we're interactive if [ ! -z "${PS1}" ]; then # Set a sensible prompt PS1='[\u@${IMAGE} \W]\$ ' export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWUNTRACKEDFILES=1 export GIT_PS1_SHOWUPSTREAM="auto verbose" if [ ! -f "/etc/bash_completion" ]; then if [ -f "/etc/bash_completion.d/git" ]; then . /etc/bash_completion.d/git PS1='[\u@${IMAGE} \W$(__git_ps1 " (%s)")]\$ ' fi else PS1='[\u@${IMAGE} \W$(__git_ps1 " (%s)")]\$ ' fi export PS1 PROMPT_COMMAND="echo -ne '\033]0;${IMAGE} (in ${HOSTNAME})\007'" if [ -f "/usr/share/git-core/contrib/completion/git-prompt.sh" ]; then source /usr/share/git-core/contrib/completion/git-prompt.sh fi fi function _report { echo $(printf '%0.1s' "="{1..72}) cat ${TMPDIR:-/tmp}/report.log rm -rf ${TMPDIR:-/tmp}/report.log echo $(printf '%0.1s' "="{1..72}) } function _report_msg { printf "%*s" $(( ${BASH_SUBSHELL} * 4 )) " " >> ${TMPDIR:-/tmp}/report.log echo "$@" >> ${TMPDIR:-/tmp}/report.log } function _shell { echo "Running $@ ..." >&3 $@ >&3 2>&3 ; retval=$? if [ ${retval} -eq 0 ]; then _report_msg "Running '$@' OK (at $(git rev-parse HEAD))" echo "Running $@ OK (at $(git rev-parse HEAD))" >&3 else _report_msg "Running '$@' FAILED (at $(git rev-parse HEAD))" echo "Running $@ FAILED (at $(git rev-parse HEAD))" >&3 fi echo ${retval} } if [ ! -d "/srv/${PACKAGE}.git" ]; then git clone ${RO_URI} /srv/${PACKAGE}.git else pushd /srv/${PACKAGE}.git git remote set-url origin ${RO_URI} git fetch origin git reset --hard origin/master git clean -d -f -x popd fi yum clean metadata yum -y update +rpmdev-setuptree pushd /srv/${PACKAGE}.git if [ ! -z "${COMMIT}" ]; then git checkout ${COMMIT} fi retval=$(_shell yum-builddep -y ${PACKAGE}) if [ ${retval} -ne 0 ]; then _report exit 1 fi if [ -x "../stick.git/drydocker/${PACKAGE}/test_build.sh" ]; then retval=$(_shell ../stick.git/drydocker/${PACKAGE}/test_build.sh) if [ ${retval} -ne 0 ]; then _report exit 1 fi fi if [ -x "../stick.git/drydocker/${PACKAGE}/test_unit.sh" ]; then retval=$(_shell ../stick.git/drydocker/${PACKAGE}/test_unit.sh) if [ ${retval} -ne 0 ]; then _report exit 1 fi fi popd _report diff --git a/ci/maipo b/ci/maipo index 52c654e..a0c4dbe 100644 --- a/ci/maipo +++ b/ci/maipo @@ -1,26 +1,27 @@ FROM centos:centos7 MAINTAINER Kolab Systems ADD http://obs.kolabsys.com/repositories/Kolab:/Development/CentOS_7/Kolab:Development.repo \ /etc/yum.repos.d/Kolab:Development.repo RUN rpm --import https://ssl.kolabsys.com/community.asc ENV IMAGE maipo RUN yum clean metadata && \ yum -y install \ epel-release \ git \ - yum-utils && \ - yum -y install @development && \ + yum-utils \ + @development \ + @fedora-packager && \ yum-builddep -y \ $(yum -d 0 -e 0 \ --disablerepo=\* \ --enablerepo=Kolab_Development \ list available 2>&1 | \ grep -vE "^(Available Packages|\s+)" | \ awk '{print $1}' \ ) ADD https://cgit.kolab.org/docker/plain/ci/entrypoint.sh / RUN chmod 755 /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ]