gitsflow 0.6.3 → 0.7.4.alfa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/Git/git.rb +2 -2
- data/lib/GitLab/gitlab.rb +1 -1
- data/lib/config.rb +12 -11
- data/lib/sflow/version.rb +3 -0
- data/lib/sflow.rb +22 -18
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b1671d1ec2c38a62cc6ac0f19c4c7f9e8d815952748978a6fa7700968b2b8fa
|
4
|
+
data.tar.gz: 4df17846f1872382de43a65dffb1f964358769b8adaee469e594170d531b211e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3802ec595ce0c5fcab461c52fcf450e7163178cfad478af7559c99f83495ac89ecd1a396c3e48014745de11ab3254d72766ca61deb0467b07a8672a08ca4c1
|
7
|
+
data.tar.gz: 5047ae95e2f532793b605023e70058710ba827c1549835e62c4acd1514e49b8f46813d2c9f8280340f8b5ef88c6775eee8a2f7885181c7daebc08a8e7ee0d8ca
|
data/lib/Git/git.rb
CHANGED
@@ -68,7 +68,7 @@ module Git
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def self.log_last_changes branch
|
71
|
-
execute {
|
71
|
+
execute {%{git log origin/#{branch}..HEAD --oneline --format="%ad - %B}}
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.pull branch
|
@@ -99,7 +99,7 @@ module Git
|
|
99
99
|
private
|
100
100
|
|
101
101
|
def self.execute
|
102
|
-
processs, stderr , stdout= Open3.popen3(yield) do |i, o, stderr, wait_thr|
|
102
|
+
processs, stderr , stdout= Open3.popen3(yield.encode('UTF-8')) do |i, o, stderr, wait_thr|
|
103
103
|
[wait_thr.value, stderr.read, o.read]
|
104
104
|
end
|
105
105
|
if processs.success?
|
data/lib/GitLab/gitlab.rb
CHANGED
data/lib/config.rb
CHANGED
@@ -4,14 +4,15 @@ begin
|
|
4
4
|
rescue LoadError
|
5
5
|
# Gem loads as it should
|
6
6
|
end
|
7
|
-
|
8
|
-
$
|
9
|
-
$
|
10
|
-
$
|
11
|
-
$
|
12
|
-
$
|
13
|
-
$
|
14
|
-
$
|
15
|
-
$
|
16
|
-
$
|
17
|
-
$
|
7
|
+
|
8
|
+
$GITLAB_PROJECT_ID = ENV['GITLAB_PROJECT_ID'].encode("UTF-8") rescue ''
|
9
|
+
$GITLAB_TOKEN = ENV['GITLAB_TOKEN'].encode("UTF-8") rescue ''
|
10
|
+
$GITLAB_URL_API = ENV['GITLAB_URL_API'].encode("UTF-8") rescue ''
|
11
|
+
$GITLAB_EMAIL = ENV['GITLAB_EMAIL'].to_s.empty? ? Open3.popen3("git config --local user.email") { |i, o| o.read }.chomp : ENV['GITLAB_EMAIL'].encode("UTF-8")
|
12
|
+
$GITLAB_LISTS = ENV['GITLAB_LISTS'].encode("UTF-8").split(',') rescue nil
|
13
|
+
$GITLAB_NEXT_RELEASE_LIST = ENV['GITLAB_NEXT_RELEASE_LIST'].encode("UTF-8") rescue ''
|
14
|
+
$GIT_BRANCH_MASTER= ENV["GIT_BRANCH_MASTER"].encode("UTF-8") rescue ''
|
15
|
+
$GIT_BRANCH_DEVELOP= ENV["GIT_BRANCH_DEVELOP"].encode("UTF-8") rescue ''
|
16
|
+
$GIT_BRANCHES_STAGING= ENV["GIT_BRANCHES_STAGING"].encode("UTF-8").split(',')rescue nil
|
17
|
+
$SFLOW_TEMPLATE_RELEASE= ENV["SFLOW_TEMPLATE_RELEASE"].to_s.empty? ? "Release version {version} - {date}" : ENV["SFLOW_TEMPLATE_RELEASE"].encode("UTF-8")
|
18
|
+
$SFLOW_TEMPLATE_RELEASE_DATE_FORMAT= ENV['SFLOW_TEMPLATE_RELEASE_DATE_FORMAT'].to_s.empty? ? 'Y/m/d': ENV['SFLOW_TEMPLATE_RELEASE_DATE_FORMAT'].encode("UTF-8")
|
data/lib/sflow.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
#!/usr/bin/ruby
|
2
3
|
begin
|
3
4
|
require 'pry'
|
@@ -18,12 +19,14 @@ load 'Git/git.rb'
|
|
18
19
|
# require './lib/gitlab/issue.rb'
|
19
20
|
# require './lib/gitlab/merge_request.rb'
|
20
21
|
class SFlow
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
Encoding.default_external = 'utf-8'
|
23
|
+
Encoding.default_internal = Encoding::UTF_8
|
24
|
+
VERSION = "0.7.4.alfa"
|
25
|
+
$TYPE = ARGV[0]&.encode("UTF-8")
|
26
|
+
$ACTION = ARGV[1]&.encode("UTF-8")
|
24
27
|
|
25
|
-
$PARAM1 = ARGV[2]
|
26
|
-
$PARAM2 = ARGV[3..-1]&.join(' ')
|
28
|
+
$PARAM1 = ARGV[2]&.encode("UTF-8")
|
29
|
+
$PARAM2 = ARGV[3..-1]&.join(' ')&.encode("UTF-8")
|
27
30
|
|
28
31
|
def self.call
|
29
32
|
begin
|
@@ -175,7 +178,7 @@ class SFlow
|
|
175
178
|
begin
|
176
179
|
|
177
180
|
Git.delete_branch(release_branch)
|
178
|
-
Git.checkout
|
181
|
+
Git.checkout $GIT_BRANCH_DEVELOP
|
179
182
|
Git.new_branch release_branch
|
180
183
|
|
181
184
|
print "Issue(s) title(s): \n".yellow
|
@@ -240,11 +243,12 @@ class SFlow
|
|
240
243
|
sleep 2
|
241
244
|
|
242
245
|
system('touch CHANGELOG')
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
+
|
247
|
+
line = version_header + " " + msgs_changelog.join('')
|
248
|
+
File.write("CHANGELOG",line + File.open('CHANGELOG').read.encode('UTF-8') , mode: "w")
|
249
|
+
|
246
250
|
system('git add CHANGELOG')
|
247
|
-
system(
|
251
|
+
system(%{git commit -m "update CHANGELOG version #{version}"})
|
248
252
|
Git.push release_branch
|
249
253
|
|
250
254
|
issue_release.description = "#{changelogs.join("")}\n"
|
@@ -304,8 +308,8 @@ class SFlow
|
|
304
308
|
release_branch = "-release/#{version}"
|
305
309
|
issue_release = GitLab::Issue.find_by_branch(release_branch)
|
306
310
|
|
307
|
-
Git.merge issue_release.branch,
|
308
|
-
Git.push
|
311
|
+
Git.merge issue_release.branch, $GIT_BRANCH_DEVELOP
|
312
|
+
Git.push $GIT_BRANCH_DEVELOP
|
309
313
|
|
310
314
|
type = issue_release.labels.include?('hotfix') ? 'hotfix' : nil
|
311
315
|
mr_master = GitLab::MergeRequest.new(
|
@@ -321,7 +325,7 @@ class SFlow
|
|
321
325
|
# end
|
322
326
|
# mr_develop = GitLab::MergeRequest.new(
|
323
327
|
# source_branch: issue_release.branch,
|
324
|
-
# target_branch:
|
328
|
+
# target_branch: $GIT_BRANCH_DEVELOP,
|
325
329
|
# issue_iid: issue_release.iid,
|
326
330
|
# title: "##{issue_release.iid} - #{version} - Reintegration #{issue_release.branch} into develop",
|
327
331
|
# type: 'hotfix'
|
@@ -362,7 +366,7 @@ class SFlow
|
|
362
366
|
print " (instaling...) \r".yellow
|
363
367
|
GitLab.create_labels
|
364
368
|
sleep 2
|
365
|
-
system(
|
369
|
+
system(%{git config --local alias.sflow \'!sh -c " sflow $1 $2 $3 $4" - \'})
|
366
370
|
print " \u{1F601}\ git sflow alias"
|
367
371
|
print " (instaled) \u{2714} ".green
|
368
372
|
print "\n\n"
|
@@ -521,7 +525,7 @@ class SFlow
|
|
521
525
|
# Setting Changelog
|
522
526
|
print "Title: #{issue.title}\n\n"
|
523
527
|
print "CHANGELOG message:\n--> ".yellow
|
524
|
-
message_changelog = STDIN.gets.chomp
|
528
|
+
message_changelog = STDIN.gets.chomp.to_s.encode('UTF-8')
|
525
529
|
print "\n ok!\n\n".green
|
526
530
|
new_labels = []
|
527
531
|
if (type == 'hotfix')
|
@@ -561,7 +565,7 @@ class SFlow
|
|
561
565
|
|
562
566
|
end
|
563
567
|
|
564
|
-
def self.start branch, issue, ref_branch =
|
568
|
+
def self.start branch, issue, ref_branch = $GIT_BRANCH_DEVELOP
|
565
569
|
Git.checkout ref_branch
|
566
570
|
description = "* ~default_branch #{branch}"
|
567
571
|
issue.description = description
|
@@ -574,13 +578,13 @@ class SFlow
|
|
574
578
|
end
|
575
579
|
|
576
580
|
def self.codereview
|
577
|
-
Git.checkout
|
581
|
+
Git.checkout $GIT_BRANCH_DEVELOP
|
578
582
|
source_branch = $PARAM1
|
579
583
|
issue = GitLab::Issue.find_by_branch(source_branch)
|
580
584
|
# issue.move
|
581
585
|
mr = GitLab::MergeRequest.new(
|
582
586
|
source_branch: source_branch,
|
583
|
-
target_branch:
|
587
|
+
target_branch: $GIT_BRANCH_DEVELOP,
|
584
588
|
issue_iid: issue.iid
|
585
589
|
)
|
586
590
|
mr.create_code_review
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitsflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.4.alfa
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Wherbet
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/GitLab/user.rb
|
121
121
|
- lib/config.rb
|
122
122
|
- lib/sflow.rb
|
123
|
+
- lib/sflow/version.rb
|
123
124
|
- lib/string.rb
|
124
125
|
- src/common/images/get_token.gif
|
125
126
|
homepage: https://github.com/carloswherbet/GitSFlow
|
@@ -138,9 +139,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
139
|
version: 2.3.0
|
139
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
141
|
requirements:
|
141
|
-
- - "
|
142
|
+
- - ">"
|
142
143
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
144
|
+
version: 1.3.1
|
144
145
|
requirements: []
|
145
146
|
rubygems_version: 3.1.4
|
146
147
|
signing_key:
|