connaryscott

acmeJenkinsJobsSpec

Apr 10th, 2011
309
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .PHONY: acme-jenkins-jobs
  2.  
  3. acme-jenkins-jobs: clean
  4.         mkdir -p dist/RPMS/noarch
  5.         rm -rf build-target
  6.         cp -r buildroot build-target
  7.         rpmbuild -bb --target=noarch --define "_topdir ${PWD}/dist" --buildroot="${PWD}/build-target" acme-jenkins-jobs.spec
  8.  
  9. clean:
  10.         rm -rf build-target
  11.         rm -rf dist
  12. [chuck@centos-55-64-vm6 acme-jenkins-jobs]$ cat acme-jenkins-jobs.spec
  13. name: acme-jenkins-jobs
  14. version: 1.0
  15. release: 0
  16. summary: acme-jenkins platform package
  17. group: acme/releaseMgmt
  18. license: acme inc.
  19.  
  20. requires: acme-jenkins-config
  21.  
  22. %description
  23. jenkins jobs package
  24.  
  25. %files
  26. %dir %attr(750, jenkins, jenkins) /etc/jenkins.jobs.d
  27. %attr(640, jenkins, jenkins) /etc/jenkins.jobs.d/helloworld.config.xml
  28.  
  29. %post
  30.  
  31. /etc/rc.d/init.d/jenkins restart
  32. sleep 10
  33. tries=0
  34. while [ 1 ]
  35. do
  36.    echo waiting for jenkins to start
  37.    sleep 5
  38.    /usr/bin/jenkins-jobs list >/dev/null 2>&1
  39.    if [ $? -eq 0 ]
  40.    then
  41.       break
  42.    fi
  43.    let tries=tries+1
  44.    if [ $tries -eq 30 ]
  45.    then
  46.       echo "jenkins startup failed" 1>&2
  47.       exit 1
  48.    fi
  49. done
  50. /usr/bin/jenkins-jobs load --overwrite --file /etc/jenkins.jobs.d/helloworld.config.xml --name helloworld --username acme --password acmepass
  51.  
  52. %changelog
  53. * Sun Mar 27 2011 Chuck Scott <chuck@acme.com> 1.0-0
  54.     - initial version
RAW Paste Data