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
e9e2be94
Commit
e9e2be94
authored
10 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
test-bot: autopublish existing bottles on Bintray.
parent
4f13858f
No related branches found
Branches containing commit
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
+34
-20
34 additions, 20 deletions
Library/Homebrew/cmd/test-bot.rb
with
34 additions
and
20 deletions
Library/Homebrew/cmd/test-bot.rb
+
34
−
20
View file @
e9e2be94
...
...
@@ -664,11 +664,14 @@ module Homebrew
jenkins
=
ENV
[
'JENKINS_HOME'
]
job
=
ENV
[
'UPSTREAM_JOB_NAME'
]
id
=
ENV
[
'UPSTREAM_BUILD_ID'
]
raise
"Missing Jenkins variables!"
unless
jenkins
and
job
and
id
raise
"Missing Jenkins variables!"
if
!
jenkins
||
!
job
||
!
id
user
=
ENV
[
"BINTRAY_USER"
]
key
=
ENV
[
"BINTRAY_KEY"
]
raise
"Missing Bintray variables!"
unless
user
&&
key
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
)
raise
"Missing BINTRAY_USER or BINTRAY_KEY variables!"
end
ARGV
<<
'--verbose'
...
...
@@ -700,6 +703,14 @@ module Homebrew
safe_system
"brew"
,
"pull"
,
"--clean"
,
pull_pr
end
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
=
bottle_filename_formula_name
filename
existing_bottles
[
formula
.
name
]
=
!!
formula
.
bottle
end
ENV
[
"GIT_AUTHOR_NAME"
]
=
ENV
[
"GIT_COMMITTER_NAME"
]
ENV
[
"GIT_AUTHOR_EMAIL"
]
=
ENV
[
"GIT_COMMITTER_EMAIL"
]
safe_system
"brew"
,
"bottle"
,
"--merge"
,
"--write"
,
*
Dir
[
"*.bottle.rb"
]
...
...
@@ -710,19 +721,6 @@ module Homebrew
tag
=
pr
?
"pr-
#{
pr
}
"
:
"testing-
#{
number
}
"
safe_system
"git"
,
"push"
,
"--force"
,
remote
,
"master:master"
,
":refs/tags/
#{
tag
}
"
# SourceForge upload (will be removed soon)
path
=
"/home/frs/project/m/ma/machomebrew/Bottles/"
if
tap
tap_user
,
tap_repo
=
tap
.
split
"/"
path
+=
"
#{
tap_repo
}
/"
end
url
=
"BrewTestBot,machomebrew@frs.sourceforge.net:
#{
path
}
"
rsync_args
=
%w[--partial --progress --human-readable --compress]
rsync_args
+=
Dir
[
"*.bottle*.tar.gz"
]
+
[
url
]
safe_system
"rsync"
,
*
rsync_args
# Bintray upload (will take over soon)
repo
=
if
tap
tap
.
sub
(
"/"
,
"-"
)
+
"-bottles"
...
...
@@ -735,22 +733,38 @@ module Homebrew
next
if
tap
version
=
BottleVersion
.
parse
(
filename
).
to_s
formula
=
bottle_filename_formula_name
filename
existing_bottle
=
existing_bottles
[
formula
.
name
]
repo_url
=
"https://api.bintray.com/packages/homebrew/
#{
repo
}
"
package_url
=
"
#{
repo_url
}
/
#{
formula
}
"
unless
system
"curl"
,
"--silent"
,
"--fail"
,
"--output"
,
"/dev/null"
,
package_url
safe_system
"curl"
,
"--silent"
,
"--fail"
,
"-u
#{
user
}
:
#{
key
}
"
,
safe_system
"curl"
,
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{
\"
name
\"
:
\"
#{
formula
}
\"
}"
,
repo_url
puts
end
content_url
=
"https://api.bintray.com/content/homebrew/
#{
repo
}
/
#{
formula
}
/
#{
version
}
/
#{
filename
}
"
safe_system
"curl"
,
"--silent"
,
"--fail"
,
"-u
#{
user
}
:
#{
key
}
"
,
"-T"
,
filename
,
content_url
content_url
+=
"?publish=1&override=1"
if
existing_bottle
safe_system
"curl"
,
"--silent"
,
"--fail"
,
"-u
#{
bintray_user
}
:
#{
bintray_key
}
"
,
"-T"
,
filename
,
content_url
puts
end
# SourceForge upload (will be removed soon)
path
=
"/home/frs/project/m/ma/machomebrew/Bottles/"
if
tap
tap_user
,
tap_repo
=
tap
.
split
"/"
path
+=
"
#{
tap_repo
}
/"
end
url
=
"BrewTestBot,machomebrew@frs.sourceforge.net:
#{
path
}
"
rsync_args
=
%w[--partial --progress --human-readable --compress]
rsync_args
+=
Dir
[
"*.bottle*.tar.gz"
]
+
[
url
]
safe_system
"rsync"
,
*
rsync_args
safe_system
"git"
,
"tag"
,
"--force"
,
tag
safe_system
"git"
,
"push"
,
"--force"
,
remote
,
"refs/tags/
#{
tag
}
"
return
...
...
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