Ewoud Kohl van Wijngaarden has posted comments on this change.

Change subject: jenkins: adding manainnace script for nightly builds
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(7 inline comments)

....................................................
Commit Message
Line 3: AuthorDate: 2013-05-11 13:46:37 +0300
Line 4: Commit:     Eyal Edri <ee...@redhat.com>
Line 5: CommitDate: 2013-05-11 13:48:46 +0300
Line 6: 
Line 7: jenkins: adding manainnace script for nightly builds
s/manainnace/maintenance/
Line 8: 
Line 9:     - move nighly builds - move the builds from jenkins homedir to repos
Line 10:     - clean nighly builds - remove all builds from build server
Line 11: 


....................................................
File tools/nightly-builds/clean_nightly_builds.sh
Line 2: ### clean old nighly builds ###################################
Line 3: ###############################################################
Line 4: 
Line 5: 
Line 6: #!/bin/bash
Shouldn't this be on the very first line?
Line 7: 
Line 8: #clean Fedora 17 RPM's
Line 9: /usr/local/sbin/tidy-rpm-cache.py -q -f -s --dir 
/var/www/html/releases/nightly/rpm/Fedora/17/SRPMS/ --num-obsolete=1
Line 10: /usr/local/sbin/tidy-rpm-cache.py -q -f --dir 
/var/www/html/releases/nightly/rpm/Fedora/17/x86_64/ --num-obsolete=1


Line 18: 
Line 19: #Clean EL6 RPM's
Line 20: /usr/local/sbin/tidy-rpm-cache.py -q -f -s --dir 
/var/www/html/releases/nightly/rpm/EL/6/SRPMS/ --num-obsolete=1
Line 21: /usr/local/sbin/tidy-rpm-cache.py -q -f --dir 
/var/www/html/releases/nightly/rpm/EL/6/x86_64/ --num-obsolete=1
Line 22: /usr/local/sbin/tidy-rpm-cache.py -q -f --dir 
/var/www/html/releases/nightly/rpm/EL/6/noarch/ --num-obsolete=1
I'd write this in a for loop:

    for $dir in /var/www/html/releases/nightly/rpm/{Fedora/{17,18}},EL/6} ; do
        /usr/local/sbin/tidy-rpm-cache.py -q -f -s --dir ${DIR}/SRPMS/ 
--num-obsolete=1
        /usr/local/sbin/tidy-rpm-cache.py -q -f --dir ${DIR}/x86_64/ 
--num-obsolete=1
        /usr/local/sbin/tidy-rpm-cache.py -q -f --dir ${DIR}/noarch/ 
--num-obsolete=1
    done

Maybe even /rpm/*/* so it's generic.
Line 23: 
Line 24: 
Line 25: # Source folder to check
Line 26: source="/var/www/html/releases/nightly/tools/"


....................................................
File tools/nightly-builds/move_nightly_builds.sh
Line 3: if [ -f /home/jenkins/FINISHED ]
Line 4: then
Line 5: 
Line 6: # noarch
Line 7: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*fc17*noarch*" 
-exec mv {} /var/www/html/releases/nightly/rpm/Fedora/17/noarch \;
I think you can use + instead of \; to reduce the invocations of mv.
Line 8: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*fc18*noarch*" 
-exec mv {} /var/www/html/releases/nightly/rpm/Fedora/18/noarch \;
Line 9: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*ovirt-release-fedora-*" -exec mv {} 
/var/www/html/releases/nightly/rpm/Fedora/17/noarch \;
Line 10: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*el6*noarch*" 
-exec mv {} /var/www/html/releases/nightly/rpm/EL/6/noarch \;
Line 11: 


Line 18: # srpms
Line 19: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*fc17*src*" 
-exec mv {} /var/www/html/releases/nightly/rpm/Fedora/17/SRPMS \;
Line 20: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*fc18*src*" 
-exec mv {} /var/www/html/releases/nightly/rpm/Fedora/18/SRPMS \;
Line 21: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*ovirt-release-*" -exec mv {} 
/var/www/html/releases/nightly/rpm/Fedora/17/SRPMS \;
Line 22: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name "*el6*src*" 
-exec mv {} /var/www/html/releases/nightly/rpm/EL/6/SRPMS \;
Maybe do this in a loop for each version?

    # All supported Fedora versions
    for version in 17 18 ; do
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*fc${version}*noarch*" -exec mv {} 
/var/www/html/releases/nightly/rpm/Fedora/${version}/noarch +
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*fc${version}*x86_64*" -exec mv {} 
/var/www/html/releases/nightly/rpm/Fedora/${version}/x86_64 +
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*fc${version}*src*" -exec mv {} 
/var/www/html/releases/nightly/rpm/Fedora/${version}/SRPMS +
        createrepo -q /var/www/html/releases/nightly/rpm/Fedora/${version}
    done

    # All supported EL versions
    for version in 6 ; do
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*el${version}*noarch*" -exec mv {} 
/var/www/html/releases/nightly/rpm/EL/${version}/noarch +
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*el${version}*x86_64*" -exec mv {} 
/var/www/html/releases/nightly/rpm/EL/${version}/x86_64 +
        /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*el${version}*src*" -exec mv {} 
/var/www/html/releases/nightly/rpm/EL/${version}/SRPMS +
        createrepo -q /var/www/html/releases/nightly/rpm/EL/${version}
    done

Only thing I'm unsure of here is the ovirt-release. Shouldn't we have one in 
each repo?
Line 23: 
Line 24: # iso
Line 25: /bin/find /home/jenkins/ovirt-nightly/artifacts/ -name 
"*ovirt-node-iso*.iso*" -exec mv {} /var/www/html/releases/nightly/tools \;
Line 26: 


Line 37: 
Line 38: # Remove temp files from jenkins homedir
Line 39: rm -rf /home/jenkins/ovirt-nightly/artifacts
Line 40: mkdir -p /home/jenkins/ovirt-nightly/artifacts
Line 41: chown -R jenkins.jenkins /home/jenkins/ovirt-nightly
This implies we run as root. Do we want that?
Line 42: 
Line 43: fi


....................................................
File tools/nightly-builds/README
Line 1: # Misc tools meant  tools meant for managing nightly builds from 
jenkins #
s/tools meant  //


--
To view, visit http://gerrit.ovirt.org/14665
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I834eeda10e0b71c18314dceec375e972f91ab6b0
Gerrit-PatchSet: 1
Gerrit-Project: jenkins
Gerrit-Branch: master
Gerrit-Owner: Eyal Edri <ee...@redhat.com>
Gerrit-Reviewer: Alexander Rydekull <rydek...@gmail.com>
Gerrit-Reviewer: David Caro <dcaro...@redhat.com>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ew...@kohlvanwijngaarden.nl>
Gerrit-Reviewer: Eyal Edri <ee...@redhat.com>
Gerrit-Reviewer: Karsten Wade <karstenw...@gmail.com>
Gerrit-Reviewer: Kiril Nesenko <knese...@redhat.com>
Gerrit-Reviewer: Michael Burns <mbu...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to