diff --git a/drydocker/generic_functions.sh b/drydocker/generic_functions.sh index 5bc4704..77f84f0 100644 --- a/drydocker/generic_functions.sh +++ b/drydocker/generic_functions.sh @@ -1,195 +1,195 @@ #!/bin/bash function _install_package_builddep { if [ -x "$(which yum 2>/dev/null)" ]; then yum-builddep -y --disablerepo=openSUSE_Tools $@ elif [ -x "$(which apt-get 2>/dev/null)" ]; then apt-get -y build-dep $@ fi } function package_version_for_osc_project_repo { osc_project=$1 osc_repository=$2 rpm_filename=$(osc ls -b ${osc_project} ${PACKAGE} ${osc_repository} x86_64 2>&1 | grep "^${PACKAGE}" | grep -vE "*\.src\.rpm$" | sort | head -n 1) if [ -z "${rpm_filename}" ]; then echo "0" return fi success=$(osc getbinaries ${osc_project} ${PACKAGE} ${osc_repository} x86_64 ${rpm_filename} >/dev/null 2>&1; echo $?) if [ ${success} -ne 0 ]; then echo "0" return fi version=$(rpm -q --queryformat="%{VERSION}\n" -p binaries/${rpm_filename}) echo ${version} } function project_for_package_version { osc_project=$1 target_version=$2 declare -a projects projects[${#projects[@]}]="Kolab:14" projects[${#projects[@]}]="Kolab:14:Fasttrack" projects[${#projects[@]}]="Kolab:3.4" projects[${#projects[@]}]="Kolab:3.4:Updates" - projects[${#projects[@]}]="Kolab:Development" + projects[${#projects[@]}]="Kolab:Winterfell" current_version="" current_project="" x=0 while [ ${x} -lt ${#projects[@]} ]; do version=$(package_version_for_osc_project_repo ${projects[${x}]} ${osc_project}) retval=$(rpmdev-vercmp "${version}" "${target_version}" >/dev/null ; echo $?) if [ ${retval} -eq 12 -o ${retval} -eq 0 ]; then retval=$(rpmdev-vercmp "${current_version}" "${version}" >/dev/null ; echo $?) if [ ${retval} -eq 12 -o ${retval} -eq 0 ]; then current_version="${version}" current_project="${projects[${x}]}" fi fi let x++ done echo "${current_project}" } function repository_configuration { set -x version=$(version_for_commit) osc_project=$(project_for_package_version CentOS_7 ${version}) case ${osc_project} in Kolab:3.4*) sed -i -r \ -e 's/enabled=.*/enabled=0/g' \ $(find /etc/yum.repos.d/ -type f -name "Kolab:*.repo" ! -name "Kolab:3.4*.repo") ;; - Kolab:Development) + Kolab:Winterfell) sed -i -r \ -e 's/enabled=.*/enabled=0/g' \ - $(find /etc/yum.repos.d/ -type f -name "Kolab:*.repo" ! -name "Kolab:Development.repo") + $(find /etc/yum.repos.d/ -type f -name "Kolab:*.repo" ! -name "Kolab:Winterfell.repo") ;; esac set - -x } function version_for_commit { # Obtain and copy in sources pushd /srv/${PACKAGE}.git >&3 short_rev=$(git rev-parse --short HEAD) long_rev=$(git rev-parse HEAD) set -x branches=$(git branch --contains ${long_rev} | \ sed -r \ -e 's/^\* //g' \ -e 's/^ //g' | \ grep -E "^(master|${PACKAGE}|[a-z0-9-]+([0-9]+\.?))" | \ sort --version-sort -u ) echo "Branches that contain ${COMMIT}:" >&3 echo "${branches}" | sed -e 's/\s/\r\n/g' >&3 if [ ! -z "$(echo ${branches} | sed -e 's/\s/\r\n/g' | grep -E '^master$')" ]; then branch=master else branch=$(echo ${branches} | sed -e 's/\s/\r\n/g' | tail -n 1) fi echo "Branch is '${branch}'" >&3 latest_stable_branch=$(git branch -la | \ sed -r \ -e 's/^\* //g' \ -e 's/^ remotes\/origin\///g' \ -e '/^HEAD/d' | \ grep -E "^(${PACKAGE}|[a-z0-9-]+([0-9]+\.?))" | \ sort --version-sort -u | \ tail -n 1 ) echo "The latest stable branch is '${latest_stable_branch}'" >&3 if [ "${branch}" == "master" ]; then if [ ! -z "${latest_stable_branch}" ]; then master_version=$(echo ${latest_stable_branch} | \ sed -r -e 's/^.*([0-9]+(\.[0-9]+)+)$/\1/g' | \ awk -F. '{$NF+=1; OFS="."; print $0}' ) echo "This puts the version for master at '${master_version}'" >&3 else master_version="" fi stable_version=0 tag_version=$(git tag -l | \ grep -E "${master_version}(\.[0-9]+)+$" | \ sed -r -e 's/^.*([0-9]\.([0-9]+(\.[0-9]+)+))$/\1/g' | \ sed -r -e 's/[^0-9\.]+//g' | \ sort --version-sort -u | \ tail -n 1 | \ awk -F. '{$NF+=1; OFS="."; print $0}' ) if [ -z "${tag_version}" -a -z "${master_version}" ]; then tag_version=$(git tag -l | \ grep -E "(\.[0-9]+)+$" | \ sed -r -e 's/^.*([0-9]\.([0-9]+(\.[0-9]+)+))$/\1/g' | \ sort --version-sort -u | \ tail -n 1 | \ awk -F. '{$NF+=1; OFS="."; print $0}' ) fi else master_version=0 stable_version=$(echo ${latest_stable_branch} | \ sed -r -e 's/^.*([0-9]+(\.[0-9]+)+)$/\1/g' ) echo "This puts the version for stable at ${stable_version}" >&3 tag_version=$(git tag -l | \ grep -E "${stable_version}(\.[0-9]+)+$" | \ sed -r -e 's/^.*([0-9]\.([0-9]+(\.[0-9]+)+))$/\1/g' | \ sort --version-sort -u | \ tail -n 1 | \ awk -F. '{$NF+=1; OFS="."; print $0}' ) fi new_version=$(echo -e "${master_version}\n${stable_version}\n${tag_version}" | \ sort --version-sort -u | \ tail -n 1 ) if [ "${new_version}" == "0" ]; then new_version="0.1" fi echo "Going with new version: '${new_version}'" >&3 set - -x echo "${new_version}" } diff --git a/vms/autoinstall/bootstrap/bootstrap-jessie-dev-script.txt b/vms/autoinstall/bootstrap/bootstrap-jessie-dev-script.txt index f90847f..555de06 100644 --- a/vms/autoinstall/bootstrap/bootstrap-jessie-dev-script.txt +++ b/vms/autoinstall/bootstrap/bootstrap-jessie-dev-script.txt @@ -1,18 +1,18 @@ #!/bin/bash # Add the kolab repository. cat > /etc/apt/sources.list.d/kolab.list << EOF -deb http://obs.kolabsys.com/repositories/Kolab:/Development/Debian_8.0/ ./ +deb http://obs.kolabsys.com/repositories/Kolab:/Winterfell/Debian_8.0/ ./ EOF -wget http://obs.kolabsys.com/repositories/Kolab:/Development/Debian_8.0/Release.key +wget http://obs.kolabsys.com/repositories/Kolab:/Winterfell/Debian_8.0/Release.key apt-key add Release.key || : rm -rf Release.key apt-get update || : wget -q -O/tmp/common.sh "http://git.kolab.org/kolab-scripts/plain/autoinstall/bootstrap/common.txt" chmod 755 /tmp/common.sh /tmp/common.sh chown -R developer:developer ~developer diff --git a/vms/autoinstall/bootstrap/bootstrap-wheezy-dev-script.txt b/vms/autoinstall/bootstrap/bootstrap-wheezy-dev-script.txt index fdf0154..9649008 100644 --- a/vms/autoinstall/bootstrap/bootstrap-wheezy-dev-script.txt +++ b/vms/autoinstall/bootstrap/bootstrap-wheezy-dev-script.txt @@ -1,18 +1,18 @@ #!/bin/bash # Add the kolab repository. cat > /etc/apt/sources.list.d/kolab.list << EOF -deb http://obs.kolabsys.com/repositories/Kolab:/Development/Debian_7.0/ ./ +deb http://obs.kolabsys.com/repositories/Kolab:/Winterfell/Debian_7.0/ ./ EOF -wget http://obs.kolabsys.com/repositories/Kolab:/Development/Debian_7.0/Release.key +wget http://obs.kolabsys.com/repositories/Kolab:/Winterfell/Debian_7.0/Release.key apt-key add Release.key || : rm -rf Release.key apt-get update || : wget -q -O/tmp/common.sh "http://git.kolab.org/kolab-scripts/plain/autoinstall/bootstrap/common.txt" chmod 755 /tmp/common.sh /tmp/common.sh chown -R developer:developer ~developer diff --git a/vms/autoinstall/maipo-34.cfg b/vms/autoinstall/maipo-34.cfg index c9e9971..f744827 100644 --- a/vms/autoinstall/maipo-34.cfg +++ b/vms/autoinstall/maipo-34.cfg @@ -1,133 +1,133 @@ lang en_US.UTF-8 keyboard us timezone --utc Europe/Zurich text skipx auth --useshadow --enablemd5 selinux --permissive firewall --disabled firstboot --disabled zerombr clearpart --all --initlabel autopart rootpw --plaintext Welcome2KolabSystems bootloader --location=mbr services --enabled=NetworkManager --disabled=network network --hostname=kolab.example.org reboot repo --name=release --baseurl=http://mirror.kolabsys.com/distr/centos/7/os/x86_64/ repo --name=updates --baseurl=http://mirror.kolabsys.com/distr/centos/7/updates/x86_64/ repo --name=epel --baseurl=http://mirror.kolabsys.com/repos/epel/beta/7/x86_64/ -repo --name=kolab-development --baseurl=http://obs.kolabsys.com/repositories/Kolab:/Development/CentOS_7/ +repo --name=kolab-winterfell --baseurl=http://obs.kolabsys.com/repositories/Kolab:/Winterfell/CentOS_7/ %packages NetworkManager kolab # Allow LDAP to be used with PAM nscd nss-pam-ldapd pam_ldap # For development purposes git vim-enhanced # Build requirements for pykolab automake autoconf gcc gettext glib2-devel intltool python python-icalendar python-kolabformat python-ldap python-nose # Build utilities @fedora-packager # Other build dependencies binutils-devel boost-devel cmake cyrus-sasl-devel e2fsprogs-devel gcc-c++ js-devel libcalendaring-devel libcurl-devel libical-devel libkolabxml-devel llvm-devel php-devel python-devel qt-devel swig uuid-devel v8-devel xerces-c-devel xsd # Development tools php-pecl-xdebug %end %post pushd /etc/systemd/system/ rm -rf default.target ln -s /lib/systemd/system/runlevel3.target default.target popd # Insert SSH key mkdir -p /root/.ssh/ cat >/root/.ssh/authorized_keys <>/etc/vimrc <>/etc/yum.repos.d/Kolab:3.3.repo<>/root/.toprc</root/.ssh/authorized_keys <>/etc/vimrc <>/etc/yum.repos.d/Kolab:3.3.repo<>/root/.toprc</root/.ssh/authorized_keys <>/etc/vimrc <>/etc/yum.repos.d/Kolab:3.1.repo<>/etc/yum.repos.d/Kolab:3.1:Updates.repo<>/etc/yum.repos.d/Kolab:Development.repo<>/etc/yum.repos.d/Kolab:Winterfell.repo<>/root/.toprc</root/.ssh/authorized_keys <>/etc/vimrc <>/etc/yum.repos.d/Kolab:Development.repo<>/etc/yum.repos.d/Kolab:Winterfell.repo<>/root/.toprc</root/.ssh/authorized_keys <>/etc/vimrc <>/etc/yum.repos.d/Kolab:Development.repo<>/etc/yum.repos.d/Kolab:Winterfell.repo<>/root/.toprc<