Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
1acdeb3b
Commit
1acdeb3b
authored
10 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
test-bot: support taps and use Bintray class.
Also: use curl method where sensible.
parent
e303a97a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/cmd/test-bot.rb
+13
-22
13 additions, 22 deletions
Library/Homebrew/cmd/test-bot.rb
with
13 additions
and
22 deletions
Library/Homebrew/cmd/test-bot.rb
+
13
−
22
View file @
1acdeb3b
...
...
@@ -668,8 +668,7 @@ module Homebrew
bintray_user
=
ENV
[
"BINTRAY_USER"
]
bintray_key
=
ENV
[
"BINTRAY_KEY"
]
# Skip taps for now until we're using Bintray for Homebrew/homebrew
if
!
tap
&&
(
!
bintray_user
||
!
bintray_key
)
if
!
bintray_user
||
!
bintray_key
raise
"Missing BINTRAY_USER or BINTRAY_KEY variables!"
end
...
...
@@ -703,10 +702,10 @@ module Homebrew
safe_system
"brew"
,
"pull"
,
"--clean"
,
pull_pr
end
# Check for existing bottles as we don't want them to be autopublished
# on Bintray until manually `brew pull`ed.
existing_bottles
=
{}
Dir
.
glob
(
"*.bottle*.tar.gz"
)
do
|
filename
|
# Skip taps for now until we're using Bintray for Homebrew/homebrew
next
if
tap
formula_name
=
bottle_filename_formula_name
filename
formula
=
Formulary
.
factory
formula_name
existing_bottles
[
formula_name
]
=
!!
formula
.
bottle
...
...
@@ -723,38 +722,30 @@ module Homebrew
safe_system
"git"
,
"push"
,
"--force"
,
remote
,
"master:master"
,
":refs/tags/
#{
tag
}
"
# Bintray upload (will take over soon)
repo
=
if
tap
tap
.
sub
(
"/"
,
"-"
)
+
"-bottles"
else
"bottles"
end
bintray_repo
=
Bintray
.
repository
(
tap_name
)
bintray_repo_url
=
"https://api.bintray.com/packages/homebrew/
#{
bintray_repo
}
"
formula_packaged
=
{}
Dir
.
glob
(
"*.bottle*.tar.gz"
)
do
|
filename
|
# Skip taps for now until we're using Bintray for Homebrew/homebrew
next
if
tap
version
=
BottleVersion
.
parse
(
filename
).
to_s
version
=
Bintray
.
version
(
f
.
bottle
.
url
)
formula
=
bottle_filename_formula_name
filename
existing_bottle
=
existing_bottles
[
formula
]
unless
formula_packaged
[
formula
]
repo_url
=
"https://api.bintray.com/packages/homebrew/
#{
repo
}
"
package_url
=
"
#{
repo_url
}
/
#{
formula
}
"
package_url
=
"
#{
bintray_repo_url
}
/
#{
formula
}
"
unless
system
"curl"
,
"--silent"
,
"--fail"
,
"--output"
,
"/dev/null"
,
package_url
safe_system
"curl"
,
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{
\"
name
\"
:
\"
#{
formula
}
\"
}"
,
repo_url
curl
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{
\"
name
\"
:
\"
#{
formula
}
\"
}"
,
bintray_repo_url
puts
end
formula_packaged
[
formula
]
=
true
end
content_url
=
"https://api.bintray.com/content/homebrew/
#{
repo
}
/
#{
formula
}
/
#{
version
}
/
#{
filename
}
"
content_url
=
"https://api.bintray.com/content/homebrew/
#{
bintray_
repo
}
/
#{
formula
}
/
#{
version
}
/
#{
filename
}
"
content_url
+=
"?publish=1&override=1"
if
existing_bottle
safe_system
"
curl
"
,
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-T"
,
filename
,
content_url
curl
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-T"
,
filename
,
content_url
puts
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment