70 lines
2.6 KiB
Ruby
70 lines
2.6 KiB
Ruby
class JenkinsJobBuilder < Formula
|
|
homepage "http://ci.openstack.org/jjb.html"
|
|
url "https://pypi.python.org/packages/source/j/jenkins-job-builder/jenkins-job-builder-1.1.0.tar.gz"
|
|
sha256 "4176a06efec3985823245a460e93fd678d78250defcc9f3109beb58aff34e609"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "2d2202bfb2b3d211531ebc9c953b56a41c4a79848f80f5368e5c293d5a86de3a" => :yosemite
|
|
sha256 "4bfee71dff0c10d2847babf2567ef529a0db2b28d18cee34713ac7b40429b166" => :mavericks
|
|
sha256 "d83cbc28b1fe07b0d2f02d1a391dea5b279e86cc5353b3054d6621bb1457956d" => :mountain_lion
|
|
end
|
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
resource "argparse" do
|
|
url "https://pypi.python.org/packages/source/a/argparse/argparse-1.3.0.tar.gz"
|
|
sha256 "b3a79a23d37b5a02faa550b92cbbbebeb4aa1d77e649c3eb39c19abf5262da04"
|
|
end
|
|
|
|
resource "pyyaml" do
|
|
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz"
|
|
sha256 "c36c938a872e5ff494938b33b14aaa156cb439ec67548fcab3535bb78b0846e8"
|
|
end
|
|
|
|
resource "ordereddict" do
|
|
url "https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz"
|
|
sha256 "1c35b4ac206cef2d24816c89f89cf289dd3d38cf7c449bb3fab7bf6d43f01b1f"
|
|
end
|
|
|
|
resource "python-jenkins" do
|
|
url "https://pypi.python.org/packages/source/p/python-jenkins/python-jenkins-0.4.5.tar.gz"
|
|
sha256 "e69949ff81064b17bf9f82f89ce511b4c19a8ddd0a69c180494278905e86e85b"
|
|
end
|
|
|
|
resource "pbr" do
|
|
url "https://pypi.python.org/packages/source/p/pbr/pbr-0.10.8.tar.gz"
|
|
sha256 "a741650c697abe9dd3da00039a57a45a15a6eed017a16f6b7e4c0161fae2b4b2"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
|
|
sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5"
|
|
end
|
|
|
|
resource "pip" do
|
|
url "https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz"
|
|
sha256 "0d58487a1b7f5be2e5e965c11afbea1dc44ecec8069de03491a4d0d6c85f4551"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
|
|
%w[argparse pyyaml ordereddict python-jenkins pbr six pip].each do |r|
|
|
resource(r).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
|