class JenkinsJobBuilder < Formula desc "Configure Jenkins jobs with YAML files stored in Git" homepage "https://docs.openstack.org/infra/system-config/jjb.html" url "https://files.pythonhosted.org/packages/ac/48/5ece5b3f0be82e9ec89524d0a7c612a3a780e6e02743ea40c36709195be1/jenkins-job-builder-2.0.3.tar.gz" sha256 "2b3207638d45fec579592ee545fc880e99f41b6e3fbf2a5eb4a8399764e67913" bottle do cellar :any_skip_relocation sha256 "1cfb94f21026f666b171b6a9c40daf9fff7dc20ba59c9ce5dba2b3925fef9e04" => :high_sierra sha256 "7644dc1dc366c90c7942b42445349377cb4b4dce1b5e454c906fa4cf7e849914" => :sierra sha256 "b3bca391ac76e140f777bf24f68a1d45254fbe13ad2357cb3fd31aa51d9d5822" => :el_capitan end depends_on "python@2" if MacOS.version <= :snow_leopard resource "fasteners" do url "https://files.pythonhosted.org/packages/f4/6f/41b835c9bf69b03615630f8a6f6d45dafbec95eb4e2bb816638f043552b2/fasteners-0.14.1.tar.gz" sha256 "427c76773fe036ddfa41e57d89086ea03111bbac57c55fc55f3006d027107e18" end resource "Jinja2" do url "https://files.pythonhosted.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz" sha256 "f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz" sha256 "a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" end resource "monotonic" do url "https://files.pythonhosted.org/packages/14/73/04da85fc1bacfa94361f00205a464b7f1ed23bfe8de3511cbff0fa2eeda7/monotonic-1.4.tar.gz" sha256 "a02611d5b518cd4051bf22d21bd0ae55b3a03f2d2993a19b6c90d9d168691f84" end resource "multi_key_dict" do url "https://files.pythonhosted.org/packages/6d/97/2e9c47ca1bbde6f09cb18feb887d5102e8eacd82fbc397c77b221f27a2ab/multi_key_dict-2.0.3.tar.gz" sha256 "deebdec17aa30a1c432cb3f437e81f8621e1c0542a0c0617a74f71e232e9939e" end resource "pbr" do url "https://files.pythonhosted.org/packages/d5/d6/f2bf137d71e4f213b575faa9eb426a8775732432edb67588a8ee836ecb80/pbr-3.1.1.tar.gz" sha256 "05f61c71aaefc02d8e37c0a3eeb9815ff526ea28b3b76324769e6158d7f95be1" end resource "python-jenkins" do url "https://files.pythonhosted.org/packages/15/dd/8dc3f8dca1532401ff06b2e0f29784e894f5def08223a24c722378a93905/python-jenkins-0.4.16.tar.gz" sha256 "af899c4fb773a97acc920dc329dcc39f8bc6d2b3b6c7ad231d46f2eb370f9ab3" end resource "PyYAML" do url "https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz" sha256 "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab" end resource "six" do url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz" sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" end resource "stevedore" do url "https://files.pythonhosted.org/packages/ba/40/92295187c3157c109fde84eb2d4002c2bb3ab5a9c1df09f7fd96e6dfd5c9/stevedore-1.28.0.tar.gz" sha256 "f1c7518e7b160336040fee272174f1f7b29a46febb3632502a8f2055f973d60b" end def install ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" resources.each do |resource| resource.stage do system "python", *Language::Python.setup_install_args(libexec/"vendor") end end ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" system "python", *Language::Python.setup_install_args(libexec) bin.install Dir[libexec/"bin/*"] bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end test do assert_match(/Managed by Jenkins Job Builder/, pipe_output("#{bin}/jenkins-jobs test /dev/stdin", "- job:\n name: test-job\n\n", 0)) end end