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
Branches containing commit
No related tags found
Tags containing commit
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
...
@@ -668,8 +668,7 @@ module Homebrew
bintray_user
=
ENV
[
"BINTRAY_USER"
]
bintray_user
=
ENV
[
"BINTRAY_USER"
]
bintray_key
=
ENV
[
"BINTRAY_KEY"
]
bintray_key
=
ENV
[
"BINTRAY_KEY"
]
# Skip taps for now until we're using Bintray for Homebrew/homebrew
if
!
bintray_user
||
!
bintray_key
if
!
tap
&&
(
!
bintray_user
||
!
bintray_key
)
raise
"Missing BINTRAY_USER or BINTRAY_KEY variables!"
raise
"Missing BINTRAY_USER or BINTRAY_KEY variables!"
end
end
...
@@ -703,10 +702,10 @@ module Homebrew
...
@@ -703,10 +702,10 @@ module Homebrew
safe_system
"brew"
,
"pull"
,
"--clean"
,
pull_pr
safe_system
"brew"
,
"pull"
,
"--clean"
,
pull_pr
end
end
# Check for existing bottles as we don't want them to be autopublished
# on Bintray until manually `brew pull`ed.
existing_bottles
=
{}
existing_bottles
=
{}
Dir
.
glob
(
"*.bottle*.tar.gz"
)
do
|
filename
|
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_name
=
bottle_filename_formula_name
filename
formula
=
Formulary
.
factory
formula_name
formula
=
Formulary
.
factory
formula_name
existing_bottles
[
formula_name
]
=
!!
formula
.
bottle
existing_bottles
[
formula_name
]
=
!!
formula
.
bottle
...
@@ -723,38 +722,30 @@ module Homebrew
...
@@ -723,38 +722,30 @@ module Homebrew
safe_system
"git"
,
"push"
,
"--force"
,
remote
,
"master:master"
,
":refs/tags/
#{
tag
}
"
safe_system
"git"
,
"push"
,
"--force"
,
remote
,
"master:master"
,
":refs/tags/
#{
tag
}
"
# Bintray upload (will take over soon)
# Bintray upload (will take over soon)
repo
=
if
tap
bintray_repo
=
Bintray
.
repository
(
tap_name
)
tap
.
sub
(
"/"
,
"-"
)
+
"-bottles"
bintray_repo_url
=
"https://api.bintray.com/packages/homebrew/
#{
bintray_repo
}
"
else
"bottles"
end
formula_packaged
=
{}
formula_packaged
=
{}
Dir
.
glob
(
"*.bottle*.tar.gz"
)
do
|
filename
|
Dir
.
glob
(
"*.bottle*.tar.gz"
)
do
|
filename
|
# Skip taps for now until we're using Bintray for Homebrew/homebrew
version
=
Bintray
.
version
(
f
.
bottle
.
url
)
next
if
tap
version
=
BottleVersion
.
parse
(
filename
).
to_s
formula
=
bottle_filename_formula_name
filename
formula
=
bottle_filename_formula_name
filename
existing_bottle
=
existing_bottles
[
formula
]
existing_bottle
=
existing_bottles
[
formula
]
unless
formula_packaged
[
formula
]
unless
formula_packaged
[
formula
]
repo_url
=
"https://api.bintray.com/packages/homebrew/
#{
repo
}
"
package_url
=
"
#{
bintray_repo_url
}
/
#{
formula
}
"
package_url
=
"
#{
repo_url
}
/
#{
formula
}
"
unless
system
"curl"
,
"--silent"
,
"--fail"
,
"--output"
,
"/dev/null"
,
package_url
unless
system
"curl"
,
"--silent"
,
"--fail"
,
"--output"
,
"/dev/null"
,
package_url
safe_system
"curl"
,
"--silent"
,
"--fail"
,
curl
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-H"
,
"Content-Type: application/json"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{
\"
name
\"
:
\"
#{
formula
}
\"
}"
,
bintray_repo_url
"-d"
,
"{
\"
name
\"
:
\"
#{
formula
}
\"
}"
,
repo_url
puts
puts
end
end
formula_packaged
[
formula
]
=
true
formula_packaged
[
formula
]
=
true
end
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
content_url
+=
"?publish=1&override=1"
if
existing_bottle
safe_system
"
curl
"
,
"--silent"
,
"--fail"
,
curl
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-T"
,
filename
,
content_url
"-T"
,
filename
,
content_url
puts
puts
end
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