diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /bin/secpick | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'bin/secpick')
-rwxr-xr-x | bin/secpick | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/bin/secpick b/bin/secpick index a68dabc8c47..517465d3f5d 100755 --- a/bin/secpick +++ b/bin/secpick @@ -21,28 +21,18 @@ module Secpick @options = self.class.options end - def ee? - File.exist?(File.expand_path('../ee/app/models/license.rb', __dir__)) - end - def dry_run? @options[:try] == true end - def original_branch - @options[:branch].strip - end - def source_branch - branch = "#{original_branch}-#{@options[:version]}" + branch = "#{@options[:branch]}-#{@options[:version]}" branch.prepend("#{BRANCH_PREFIX}-") unless branch.start_with?("#{BRANCH_PREFIX}-") branch.freeze end def stable_branch - "#{@options[:version]}-#{STABLE_SUFFIX}".tap do |name| - name << "-ee" if ee? - end.freeze + "#{@options[:version]}-#{STABLE_SUFFIX}-ee".freeze end def git_commands @@ -50,7 +40,7 @@ module Secpick "git checkout -B #{source_branch} #{@options[:remote]}/#{stable_branch} --no-track", "git cherry-pick #{@options[:sha]}", "git push #{@options[:remote]} #{source_branch}", - "git checkout #{original_branch}"] + "git checkout #{@options[:branch]}"] end def gitlab_params @@ -64,11 +54,7 @@ module Secpick end def new_mr_url - if ee? - SECURITY_MR_URL - else - SECURITY_MR_URL.sub('/gitlab/', '/gitlab-foss/') - end + SECURITY_MR_URL end def create! @@ -131,8 +117,8 @@ module Secpick parser.parse! - options[:sha] ||= `git rev-parse HEAD` - options[:branch] ||= `git rev-parse --abbrev-ref HEAD` + options[:sha] ||= `git rev-parse HEAD`.strip + options[:branch] ||= `git rev-parse --abbrev-ref HEAD`.strip options[:remote] ||= DEFAULT_REMOTE nil_options = options.select {|_, v| v.nil? } |