Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
add10e14
Commit
add10e14
authored
Dec 18, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update/secpick' into 'master'
Update/secpick See merge request gitlab-org/gitlab-ce!23900
parents
58ee1746
9ba303bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
bin/secpick
bin/secpick
+22
-1
No files found.
bin/secpick
View file @
add10e14
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# frozen_string_literal: false
require
'active_support/core_ext/object/to_query'
require
'optparse'
require
'optparse'
require
'open3'
require
'open3'
require
'rainbow/refinement'
require
'rainbow/refinement'
...
@@ -6,6 +9,7 @@ using Rainbow
...
@@ -6,6 +9,7 @@ using Rainbow
BRANCH_PREFIX
=
'security'
.
freeze
BRANCH_PREFIX
=
'security'
.
freeze
REMOTE
=
'dev'
.
freeze
REMOTE
=
'dev'
.
freeze
NEW_MR_URL
=
'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/new'
.
freeze
options
=
{
version:
nil
,
branch:
nil
,
sha:
nil
}
options
=
{
version:
nil
,
branch:
nil
,
sha:
nil
}
...
@@ -48,7 +52,24 @@ end.freeze
...
@@ -48,7 +52,24 @@ end.freeze
command
=
"git fetch
#{
REMOTE
}
#{
stable_branch
}
&& git checkout
#{
stable_branch
}
&& git pull
#{
REMOTE
}
#{
stable_branch
}
&& git checkout -B
#{
branch
}
&& git cherry-pick
#{
options
[
:sha
]
}
&& git push
#{
REMOTE
}
#{
branch
}
&& git checkout
#{
original_branch
}
"
command
=
"git fetch
#{
REMOTE
}
#{
stable_branch
}
&& git checkout
#{
stable_branch
}
&& git pull
#{
REMOTE
}
#{
stable_branch
}
&& git checkout -B
#{
branch
}
&& git cherry-pick
#{
options
[
:sha
]
}
&& git push
#{
REMOTE
}
#{
branch
}
&& git checkout
#{
original_branch
}
"
_stdin
,
stdout
,
stder
r
=
Open3
.
popen3
(
command
)
stdin
,
stdout
,
stderr
,
wait_th
r
=
Open3
.
popen3
(
command
)
puts
stdout
.
read
&
.
green
puts
stdout
.
read
&
.
green
puts
stderr
.
read
&
.
red
puts
stderr
.
read
&
.
red
if
wait_thr
.
value
.
success?
params
=
{
merge_request:
{
source_branch:
branch
,
target_branch:
stable_branch
,
title:
"WIP: [
#{
options
[
:version
].
tr
(
'-'
,
'.'
)
}
] "
,
description:
'/label ~security'
}
}
puts
"
#{
NEW_MR_URL
}
?
#{
params
.
to_query
}
"
.
blue
end
stdin
.
close
stdout
.
close
stderr
.
close
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment