(package_name, args, bucket, package_s3_key)
| 93 | |
| 94 | |
| 95 | def postbuild_osx(package_name, args, bucket, package_s3_key): |
| 96 | if args.upload: |
| 97 | url = package_s3_key.generate_url(expires_in=0, query_auth=False) |
| 98 | else: |
| 99 | # For testing "brew install" locally |
| 100 | url = "http://127.0.0.1:8000/%s" % package_name |
| 101 | |
| 102 | print "Generating formula..." |
| 103 | sha1 = sha1_file(package_name) |
| 104 | formula_str = BREW_FORMULA.format(url=url, sha1=sha1) |
| 105 | with open("kite.rb", "w") as f: |
| 106 | f.write(formula_str) |
| 107 | |
| 108 | if args.upload: |
| 109 | print "Uploading new brew formula..." |
| 110 | formula_key = Key(bucket) |
| 111 | formula_key.key = "kite.rb" |
| 112 | formula_key.set_contents_from_string(formula_str) |
| 113 | formula_key.make_public() |
| 114 | formula_url = formula_key.generate_url(expires_in=0, query_auth=False) |
| 115 | |
| 116 | print "kite tool has been uplaoded successfully.\n" \ |
| 117 | "Users can install it with:\n " \ |
| 118 | "brew install \"%s\"" % formula_url |
| 119 | else: |
| 120 | print "Did not upload to S3. " \ |
| 121 | "If you want to upload, run with --upload flag." |
| 122 | |
| 123 | |
| 124 | def postbuild_linux(package_name, args, bucket, package_s3_key): |
nothing calls this directly
no test coverage detected