git-semaphore 0.0.7 → 0.0.9
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/bin/git-semaphore +82 -86
- data/lib/git-semaphore/version.rb +1 -1
- metadata +2 -3
- data/.pryrc +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b86473a790890b9ce221b9f1a41143a6b11c63ee
|
4
|
+
data.tar.gz: cf5a879705922db3a175eb1294df94fda33cde54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72be87873ee8f9ac9dc50780560bf04a086c2238f7aa73eb1ff8b83971a9e13f18ca2b466f813bdc00e15c14e062b76f01f41c95f18834d74f36d660bb590161
|
7
|
+
data.tar.gz: 1e9f18f4dd33f89ca2c895ea274ebee95f826b0706c1e968dfcaa3a0cc8e171510ad311f15a6e75dadbaffea31a0672af62a9ebefbc1910771008705175e96ff
|
data/bin/git-semaphore
CHANGED
@@ -4,116 +4,112 @@ $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib
|
|
4
4
|
|
5
5
|
require 'git-semaphore'
|
6
6
|
|
7
|
-
|
7
|
+
options = Trollop::options do
|
8
8
|
|
9
|
-
|
9
|
+
version Git::Semaphore::COPYRIGHT
|
10
|
+
banner Git::Semaphore::BANNER
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
opt :projects, 'List all semaphore.app projects', :short => nil, :default => false
|
13
|
+
opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
|
14
|
+
opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
|
15
|
+
opt :'commit-status', 'Check commit status', :default => false
|
16
|
+
opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
opt :'commit-status', 'Check commit status', :default => false
|
18
|
-
opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
|
18
|
+
opt :'working-dir', 'Print working dir', :short => 'w', :default => false
|
19
|
+
opt :'project-name', 'Print project name', :short => 'p', :default => false
|
20
|
+
opt :'branch-name', 'Print branch name', :short => 'b', :default => false
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
opt :'check-auth', 'Check auth token', :short => 'x', :default => false
|
23
|
+
opt :'check-project', 'Check project hash id', :short => 'y', :default => false
|
24
|
+
opt :'check-branch', 'Check branch id', :short => 'z', :default => false
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
opt :'check-branch', 'Check branch id', :short => 'z', :default => false
|
26
|
+
opt :'git-config', 'Print git settings', :short => 'g', :default => false
|
27
|
+
opt :'env-config', 'Print environment settings', :short => 'e', :default => false
|
27
28
|
|
28
|
-
|
29
|
-
opt :'env-config', 'Print environment settings', :short => 'e', :default => false
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
app = Git::Semaphore::App.new(Dir.pwd, ENV)
|
34
|
-
|
35
|
-
if !app.validate
|
36
|
-
r = app.git_repo rescue false
|
37
|
-
unless r
|
38
|
-
STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
|
39
|
-
exit 255
|
40
|
-
end
|
41
|
-
end
|
29
|
+
end
|
42
30
|
|
43
|
-
|
44
|
-
puts app.rebuild_last_revision
|
45
|
-
exit 0
|
46
|
-
end
|
31
|
+
app = Git::Semaphore::App.new(Dir.pwd, ENV)
|
47
32
|
|
48
|
-
|
49
|
-
|
50
|
-
|
33
|
+
if !app.validate
|
34
|
+
r = app.git_repo rescue false
|
35
|
+
unless r
|
36
|
+
STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
|
37
|
+
exit 255
|
51
38
|
end
|
39
|
+
end
|
52
40
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
41
|
+
if options[:'rebuild-last-revision']
|
42
|
+
puts app.rebuild_last_revision
|
43
|
+
exit 0
|
44
|
+
end
|
57
45
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
46
|
+
if options[:'commit-status']
|
47
|
+
puts app.commit_status
|
48
|
+
exit 0
|
49
|
+
end
|
62
50
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
51
|
+
if options[:projects]
|
52
|
+
puts app.projects
|
53
|
+
exit 0
|
54
|
+
end
|
67
55
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
56
|
+
if options[:branches]
|
57
|
+
puts app.branches
|
58
|
+
exit 0
|
59
|
+
end
|
72
60
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
61
|
+
if options[:status]
|
62
|
+
puts app.status
|
63
|
+
exit 0
|
64
|
+
end
|
77
65
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
66
|
+
if options[:'working-dir']
|
67
|
+
puts app.working_dir
|
68
|
+
exit 0
|
69
|
+
end
|
82
70
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
exit -1
|
88
|
-
else
|
89
|
-
exit 0
|
90
|
-
end
|
91
|
-
end
|
71
|
+
if options[:'project-name']
|
72
|
+
puts app.project_name
|
73
|
+
exit 0
|
74
|
+
end
|
92
75
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
exit -1
|
98
|
-
else
|
99
|
-
exit 0
|
100
|
-
end
|
101
|
-
end
|
76
|
+
if options[:'branch-name']
|
77
|
+
puts app.branch_name
|
78
|
+
exit 0
|
79
|
+
end
|
102
80
|
|
103
|
-
|
104
|
-
|
105
|
-
puts
|
81
|
+
if options[:'check-auth']
|
82
|
+
unless app.auth_token && !app.auth_token.empty?
|
83
|
+
STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
|
84
|
+
STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
|
85
|
+
exit -1
|
86
|
+
else
|
106
87
|
exit 0
|
107
88
|
end
|
89
|
+
end
|
108
90
|
|
109
|
-
|
110
|
-
|
111
|
-
puts
|
91
|
+
if options[:'check-project']
|
92
|
+
unless app.project_token && !app.project_token.empty?
|
93
|
+
STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
|
94
|
+
STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
|
95
|
+
exit -1
|
96
|
+
else
|
112
97
|
exit 0
|
113
98
|
end
|
99
|
+
end
|
114
100
|
|
115
|
-
|
101
|
+
if options[:'env-config']
|
102
|
+
puts "export SEMAPHORE_AUTH_TOKEN=\"#{app.env_auth_token}\""
|
103
|
+
puts "export SEMAPHORE_PROJECT_TOKEN=\"#{app.env_project_token}\""
|
104
|
+
exit 0
|
105
|
+
end
|
116
106
|
|
107
|
+
if options[:'git-config']
|
108
|
+
puts "git config --local --replace-all semaphore.authtoken \"#{app.git_auth_token}\""
|
109
|
+
puts "git config --local --replace-all semaphore.projecttoken \"#{app.git_project_token}\""
|
110
|
+
exit 0
|
117
111
|
end
|
118
112
|
|
119
|
-
|
113
|
+
fail "Coming soon!"
|
114
|
+
|
115
|
+
# That's all, Folks!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-semaphore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Vandenberk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grit
|
@@ -204,7 +204,6 @@ files:
|
|
204
204
|
- .gitconform
|
205
205
|
- .gitignore
|
206
206
|
- .irbrc
|
207
|
-
- .pryrc
|
208
207
|
- .ruby-version
|
209
208
|
- Gemfile
|
210
209
|
- Guardfile
|
data/.pryrc
DELETED