From 83c2829ed00736a64dfdac17dfc618b834284773 Mon Sep 17 00:00:00 2001 From: Thomas Oulevey Date: Apr 06 2015 13:24:59 +0000 Subject: - Add project and release support - Support -common repository - Beta need more testing ; checking with cloud SIG for feedback --- diff --git a/scripts/create_sig.sh b/scripts/create_sig.sh index 3e52e6e..49d7cd8 100755 --- a/scripts/create_sig.sh +++ b/scripts/create_sig.sh @@ -8,10 +8,12 @@ usage: $0 -d -s -t This script generate new build target in koji for SIGS. OPTIONS: - -d Distribution : 5 6 7 - -s SIG name : bananas, storage - -t DISTTAGS : "el7 el7.centos el7_0" - -c COLLECTION : mariadb100 (a single collection can be used at this time) + -d Distribution : 5 6 7 + -s SIG name : cloud + -p SIG project name : cloud6-, sclo-, etc... + -r SIG project release name : cloud6-openstack- + -t DISTTAGS : "el7 el7.centos el7_0" + -c COLLECTION : mariadb100 (a single collection can be used at this time) EOF } @@ -19,8 +21,10 @@ optiond=false options=false optiont=false optionc=false +optionp=false +optionr=false -while getopts ":hd:s:t:c:" OPTION +while getopts ":hd:s:t:c:p:r:" OPTION do case $OPTION in h) @@ -35,6 +39,14 @@ do options=true SIGS="${OPTARG}" ;; + r) + optionr=true + RELEASES="${OPTARG}" + ;; + p) + optionp=true + PROJECTS="${OPTARG}" + ;; t) optiont=true TAGS="${OPTARG}" @@ -99,48 +111,72 @@ do $KOJI add-user $SIG &> /dev/null [ $? -eq 0 ] && echo "Creating user : ${SIG}" SIG="${SIG}${DIST}" - $KOJI list-tags | grep $SIG-testing &> /dev/null - [ $? -gt 0 ] && echo "Creating tag : ${SIG}-testing" && $KOJI add-tag $SIG-testing - $KOJI list-tags | grep $SIG-release &> /dev/null - [ $? -gt 0 ] && echo "Creating tag : ${SIG}-release" && $KOJI add-tag $SIG-release - - for TAG in $TAGS + for PROJECT in $PROJECTS do - # Add collection support abuse TAG variable - REALTAG=$TAG - if ( $optionc ) - then - TAG="$TAG-$COLLECTIONS" - fi - $KOJI list-tags | grep $SIG-$TAG-build &> /dev/null - [ $? -eq 0 ] && echo " -> $SIG-$TAG target already exists. skipping." && continue - echo " -> creating $SIG-$TAG" - $KOJI add-tag --arches "$ARCHES" $SIG-$TAG-build - $KOJI add-target $SIG-$TAG $SIG-$TAG-build $SIG-testing - $KOJI add-external-repo --tag=$SIG-$TAG-build centos${DIST}-updates - $KOJI add-external-repo --tag=$SIG-$TAG-build centos${DIST}-os - $KOJI add-group $SIG-$TAG-build build - $KOJI add-group $SIG-$TAG-build srpm-build - # Add -build to the buildroot if collection enabled - if ( $optionc ) - then - $KOJI add-group-pkg $SIG-$TAG-build build bash bzip2 coreutils cpio diffutils redhat-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which buildsys-macros-$REALTAG tar buildsys-tools $COLLECTIONS-build - $KOJI add-group-pkg $SIG-$TAG-build srpm-build bash buildsys-macros curl cvs redhat-release gnupg make redhat-rpm-config rpm-build shadow-utils buildsys-macros-$REALTAG tar buildsys-tools $COLLECTIONS-build - else - $KOJI add-group-pkg $SIG-$TAG-build build bash bzip2 coreutils cpio diffutils redhat-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which buildsys-macros-$REALTAG tar buildsys-tools - $KOJI add-group-pkg $SIG-$TAG-build srpm-build bash buildsys-macros curl cvs redhat-release gnupg make redhat-rpm-config rpm-build shadow-utils buildsys-macros-$REALTAG tar buildsys-tools - fi - $KOJI add-tag-inheritance --priority 1 $SIG-$TAG-build buildsys${DIST} - $KOJI add-tag-inheritance --priority 2 $SIG-$TAG-build $SIG-testing - $KOJI list-tagged buildsys${DIST} | grep buildsys-macros-$REALTAG &> /dev/null - if [ $? -gt 0 ] - then - if [ "x$REALTAG" != "x$DEFAULT_DISTTAG" ] - then - echo " -> [WARN] buildsys-macros-$REALTAG rpm not found. Please build it within koji." - [ -f $PWD/etc/buildsys.spec.template ] && echo " -> Generating buildsys-macros-$TAG.spec" - fi - fi + P_SIG="${SIG}-${PROJECT}" + # Check for -common + #$KOJI list-tags | grep $P_SIG-common-candidate &> /dev/null + #if [ $? -gt 0 ] + #then + # echo "Creating tag : ${P_SIG}-common" + # $KOJI add-tag $P_SIG-common-candidate + # + #fi + for RELEASE in $RELEASES + do + R_SIG="${P_SIG}-${RELEASE}" + $KOJI list-tags | grep $R_SIG-candidate &> /dev/null + [ $? -gt 0 ] && echo "Creating tag : ${R_SIG}-candidate" && $KOJI add-tag $R_SIG-testing + $KOJI list-tags | grep $R_SIG-testing &> /dev/null + [ $? -gt 0 ] && echo "Creating tag : ${R_SIG}-testing" && $KOJI add-tag $R_SIG-testing + $KOJI list-tags | grep $R_SIG-release &> /dev/null + [ $? -gt 0 ] && echo "Creating tag : ${R_SIG}-release" && $KOJI add-tag $R_SIG-release + + for TAG in $TAGS + do + # Add collection support abuse TAG variable + REALTAG=$TAG + if ( $optionc ) + then + TAG="$TAG-$COLLECTIONS" + fi + $KOJI list-tags | grep $R_SIG-$TAG-build &> /dev/null + [ $? -eq 0 ] && echo " -> $R_SIG-$TAG target already exists. skipping." && continue + echo " -> creating $R_SIG-$TAG" + $KOJI add-tag --arches "$ARCHES" $R_SIG-$TAG-build + $KOJI add-target $R_SIG-$TAG $R_SIG-$TAG-build $R_SIG-candidate + $KOJI add-external-repo --tag=$R_SIG-$TAG-build centos${DIST}-updates + $KOJI add-external-repo --tag=$R_SIG-$TAG-build centos${DIST}-os + $KOJI add-group $R_SIG-$TAG-build build + $KOJI add-group $R_SIG-$TAG-build srpm-build + # Add -build to the buildroot if collection enabled + if ( $optionc ) + then + $KOJI add-group-pkg $R_SIG-$TAG-build build bash bzip2 coreutils cpio diffutils redhat-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which buildsys-macros-$REALTAG tar buildsys-tools $COLLECTIONS-build + $KOJI add-group-pkg $R_SIG-$TAG-build srpm-build bash buildsys-macros curl cvs redhat-release gnupg make redhat-rpm-config rpm-build shadow-utils buildsys-macros-$REALTAG tar buildsys-tools $COLLECTIONS-build + else + $KOJI add-group-pkg $R_SIG-$TAG-build build bash bzip2 coreutils cpio diffutils redhat-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which buildsys-macros-$REALTAG tar buildsys-tools + $KOJI add-group-pkg $R_SIG-$TAG-build srpm-build bash buildsys-macros curl cvs redhat-release gnupg make redhat-rpm-config rpm-build shadow-utils buildsys-macros-$REALTAG tar buildsys-tools + fi + $KOJI add-tag-inheritance --priority 5 $R_SIG-$TAG-build buildsys${DIST} + $KOJI add-tag-inheritance --priority 10 $R_SIG-$TAG-build $R_SIG-candidate + # If -common exists for the project add it + $KOJI list-tags | grep $P_SIG-common-candidate &> /dev/null + if [ "x$RELEASE" != "xcommon" ] + then + [ $? -gt 0 ] && echo "Adding $P_SIG-common-candidate as inheritance" && $KOJI add-tag-inheritance --priority 15 $R_SIG-$TAG-build $P_SIG-common-candidate + fi + $KOJI list-tagged buildsys${DIST} | grep buildsys-macros-$REALTAG &> /dev/null + if [ $? -gt 0 ] + then + if [ "x$REALTAG" != "x$DEFAULT_DISTTAG" ] + then + echo " -> [WARN] buildsys-macros-$REALTAG rpm not found. Please build it within koji." + [ -f $PWD/etc/buildsys.spec.template ] && echo " -> Generating buildsys-macros-$TAG.spec" + fi + fi + done + done done done done