git-semaphore 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.pryrc +2 -0
- data/README.md +6 -4
- data/bin/git-semaphore +89 -92
- data/features/cassettes/cucumber_tags/api_branch_status.json +5 -5
- data/features/cassettes/cucumber_tags/api_projects.json +4 -4
- data/features/cassettes/cucumber_tags/vcr_api_branches.yml +1 -1
- data/features/cassettes/cucumber_tags/vcr_api_projects.yml +5 -5
- data/features/cassettes/cucumber_tags/vcr_api_rebuild_last_revision.yml +2 -2
- data/features/cassettes/cucumber_tags/vcr_api_status.yml +5 -5
- data/features/help_and_version.feature +15 -15
- data/features/semaphore_app_api.feature +4 -4
- data/features/step_definitions/git-semaphore_steps.rb +16 -16
- data/features/step_definitions/vcr_semaphore_steps.rb +1 -1
- data/features/support/env.rb +0 -1
- data/features/support/semaphoreapp.rb +2 -2
- data/git-semaphore.gemspec +27 -32
- data/lib/git-semaphore.rb +0 -2
- data/lib/git-semaphore/api.rb +2 -2
- data/lib/git-semaphore/copyright.rb +1 -1
- data/lib/git-semaphore/version.rb +1 -1
- metadata +9 -91
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 967b795337dc7bf2114afa2409f5f49cfe4d4d5a
|
4
|
+
data.tar.gz: dd2b015bad90a68e3d783de7ba2c495c8082ddb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b3c339ea8d617f7e8826cd24c301baad284836ee495223b61823d8736536c6f0e9487894c8c881cc5470fa0c92b900ddad2aa0e31a4380161dffb9995fbb471
|
7
|
+
data.tar.gz: 8e4355613495bf582b7ef3a567ff5b7a2157d925fe58c2fa6f4c540b89f23a66deac144552dc10fdefbe610bb829de52444d51633a209f0e3f24421477b20220
|
data/.pryrc
ADDED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Git::Semaphore
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://semaphoreci.com/api/v1/projects/03b2dffc7112138851166c86adb456484426a712/7753/badge.png)](https://semaphoreci.com/pvdb/git-semaphore)
|
4
4
|
|
5
|
-
|
5
|
+
[![Travis CI](https://travis-ci.org/pvdb/git-semaphore.svg?branch=v0.0.6)](https://travis-ci.org/pvdb/git-semaphore)
|
6
|
+
|
7
|
+
git integration with [semaphoreci.com][] (via their API)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -20,7 +22,7 @@ Or install it yourself as:
|
|
20
22
|
|
21
23
|
## Authentication
|
22
24
|
|
23
|
-
Log into [
|
25
|
+
Log into [semaphoreci.com][] and find your API `authentication token` in the `API` tab of one of your projects' `settings` page.
|
24
26
|
|
25
27
|
Next, choose one of the following mechanisms to make your API `authentication token` available to `Git::Semaphore`...
|
26
28
|
|
@@ -78,5 +80,5 @@ After installing the quite brilliant [jazor gem][jazor] (`gem install jazor`), t
|
|
78
80
|
4. Push to the branch (`git push origin my-new-feature`)
|
79
81
|
5. Create new Pull Request
|
80
82
|
|
81
|
-
[
|
83
|
+
[semaphoreci.com]: https://semaphoreci.com/
|
82
84
|
[jazor]: https://github.com/mconigliaro/jazor
|
data/bin/git-semaphore
CHANGED
@@ -1,122 +1,119 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'git-semaphore'
|
7
|
-
require 'bundler'
|
8
|
-
Bundler.setup
|
9
|
-
rescue LoadError
|
10
|
-
require 'rubygems'
|
11
|
-
require 'git-semaphore'
|
12
|
-
end
|
3
|
+
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
13
4
|
|
14
|
-
|
5
|
+
require 'git-semaphore'
|
15
6
|
|
16
|
-
|
17
|
-
banner Git::Semaphore::BANNER
|
7
|
+
if __FILE__ == $0
|
18
8
|
|
19
|
-
|
20
|
-
opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
|
21
|
-
opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
|
22
|
-
opt :'commit-status', 'Check commit status', :default => false
|
23
|
-
opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
|
9
|
+
options = Trollop::options do
|
24
10
|
|
25
|
-
|
26
|
-
|
27
|
-
opt :'branch-name', 'Print branch name', :short => 'b', :default => false
|
11
|
+
version Git::Semaphore::COPYRIGHT
|
12
|
+
banner Git::Semaphore::BANNER
|
28
13
|
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
opt :projects, 'List all semaphore.app projects', :short => nil, :default => false
|
15
|
+
opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
|
16
|
+
opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
|
17
|
+
opt :'commit-status', 'Check commit status', :default => false
|
18
|
+
opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
|
32
19
|
|
33
|
-
|
34
|
-
|
20
|
+
opt :'working-dir', 'Print working dir', :short => 'w', :default => false
|
21
|
+
opt :'project-name', 'Print project name', :short => 'p', :default => false
|
22
|
+
opt :'branch-name', 'Print branch name', :short => 'b', :default => false
|
35
23
|
|
36
|
-
|
24
|
+
opt :'check-auth', 'Check auth token', :short => 'x', :default => false
|
25
|
+
opt :'check-project', 'Check project hash id', :short => 'y', :default => false
|
26
|
+
opt :'check-branch', 'Check branch id', :short => 'z', :default => false
|
37
27
|
|
38
|
-
|
28
|
+
opt :'git-config', 'Print git settings', :short => 'g', :default => false
|
29
|
+
opt :'env-config', 'Print environment settings', :short => 'e', :default => false
|
39
30
|
|
40
|
-
if !app.validate
|
41
|
-
r = app.git_repo rescue false
|
42
|
-
unless r
|
43
|
-
STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
|
44
|
-
exit 255
|
45
31
|
end
|
46
|
-
end
|
47
32
|
|
48
|
-
|
49
|
-
puts app.rebuild_last_revision
|
50
|
-
exit 0
|
51
|
-
end
|
33
|
+
app = Git::Semaphore::App.new(Dir.pwd, ENV)
|
52
34
|
|
53
|
-
if
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
57
42
|
|
58
|
-
if options[:
|
59
|
-
|
60
|
-
|
61
|
-
end
|
43
|
+
if options[:'rebuild-last-revision']
|
44
|
+
puts app.rebuild_last_revision
|
45
|
+
exit 0
|
46
|
+
end
|
62
47
|
|
63
|
-
if options[:
|
64
|
-
|
65
|
-
|
66
|
-
end
|
48
|
+
if options[:'commit-status']
|
49
|
+
puts app.commit_status
|
50
|
+
exit 0
|
51
|
+
end
|
67
52
|
|
68
|
-
if options[:
|
69
|
-
|
70
|
-
|
71
|
-
end
|
53
|
+
if options[:projects]
|
54
|
+
puts app.projects
|
55
|
+
exit 0
|
56
|
+
end
|
72
57
|
|
73
|
-
if options[:
|
74
|
-
|
75
|
-
|
76
|
-
end
|
58
|
+
if options[:branches]
|
59
|
+
puts app.branches
|
60
|
+
exit 0
|
61
|
+
end
|
77
62
|
|
78
|
-
if options[:
|
79
|
-
|
80
|
-
|
81
|
-
end
|
63
|
+
if options[:status]
|
64
|
+
puts app.status
|
65
|
+
exit 0
|
66
|
+
end
|
82
67
|
|
83
|
-
if options[:'
|
84
|
-
|
85
|
-
|
86
|
-
end
|
68
|
+
if options[:'working-dir']
|
69
|
+
puts app.working_dir
|
70
|
+
exit 0
|
71
|
+
end
|
87
72
|
|
88
|
-
if options[:'
|
89
|
-
|
90
|
-
STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
|
91
|
-
STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
|
92
|
-
exit -1
|
93
|
-
else
|
73
|
+
if options[:'project-name']
|
74
|
+
puts app.project_name
|
94
75
|
exit 0
|
95
76
|
end
|
96
|
-
end
|
97
77
|
|
98
|
-
if options[:'
|
99
|
-
|
100
|
-
STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
|
101
|
-
STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
|
102
|
-
exit -1
|
103
|
-
else
|
78
|
+
if options[:'branch-name']
|
79
|
+
puts app.branch_name
|
104
80
|
exit 0
|
105
81
|
end
|
106
|
-
end
|
107
82
|
|
108
|
-
if options[:'
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
83
|
+
if options[:'check-auth']
|
84
|
+
unless app.auth_token && !app.auth_token.empty?
|
85
|
+
STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
|
86
|
+
STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
|
87
|
+
exit -1
|
88
|
+
else
|
89
|
+
exit 0
|
90
|
+
end
|
91
|
+
end
|
113
92
|
|
114
|
-
if options[:'
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
93
|
+
if options[:'check-project']
|
94
|
+
unless app.project_token && !app.project_token.empty?
|
95
|
+
STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
|
96
|
+
STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
|
97
|
+
exit -1
|
98
|
+
else
|
99
|
+
exit 0
|
100
|
+
end
|
101
|
+
end
|
119
102
|
|
120
|
-
|
103
|
+
if options[:'env-config']
|
104
|
+
puts "export SEMAPHORE_AUTH_TOKEN=\"#{app.env_auth_token}\""
|
105
|
+
puts "export SEMAPHORE_PROJECT_TOKEN=\"#{app.env_project_token}\""
|
106
|
+
exit 0
|
107
|
+
end
|
108
|
+
|
109
|
+
if options[:'git-config']
|
110
|
+
puts "git config --local --replace-all semaphore.authtoken \"#{app.git_auth_token}\""
|
111
|
+
puts "git config --local --replace-all semaphore.projecttoken \"#{app.git_project_token}\""
|
112
|
+
exit 0
|
113
|
+
end
|
114
|
+
|
115
|
+
fail "Coming soon!"
|
116
|
+
|
117
|
+
end
|
121
118
|
|
122
|
-
# That's all
|
119
|
+
# That's all Folks!
|
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"branch_name": "gem_updates",
|
3
|
-
"branch_url": "https://
|
4
|
-
"branch_status_url": "http://
|
5
|
-
"branch_history_url": "http://
|
3
|
+
"branch_url": "https://semaphoreci.com/projects/44/branches/50",
|
4
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
5
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
|
6
6
|
"project_name": "base-app",
|
7
|
-
"build_url": "https://
|
7
|
+
"build_url": "https://semaphoreci.com/projects/44/branches/50/builds/15",
|
8
8
|
"build_number": 15,
|
9
9
|
"result": "passed",
|
10
10
|
"started_at": "2012-07-09T15:23:53Z",
|
@@ -17,4 +17,4 @@
|
|
17
17
|
"message": "Update 'shoulda' gem.",
|
18
18
|
"timestamp": "2012-07-04T18:14:08Z"
|
19
19
|
}
|
20
|
-
}
|
20
|
+
}
|
@@ -10,8 +10,8 @@
|
|
10
10
|
{
|
11
11
|
"branch_name": "master",
|
12
12
|
"branch_url": "http://10.0.1.76:3000/projects/61/branches/85",
|
13
|
-
"branch_status_url": "http://
|
14
|
-
"branch_history_url": "http://
|
13
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
14
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
|
15
15
|
"project_name": "testapp-sphinx",
|
16
16
|
"build_url": "http://10.0.1.76:3000/projects/61/branches/85/builds/1",
|
17
17
|
"build_number": 1,
|
@@ -32,8 +32,8 @@
|
|
32
32
|
{
|
33
33
|
"branch_name": "mongoid3",
|
34
34
|
"branch_url": "http://10.0.1.76:3000/projects/63/branches/89",
|
35
|
-
"branch_status_url": "http://
|
36
|
-
"branch_history_url": "http://
|
35
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
36
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
|
37
37
|
"project_name": "testapp-mongodb",
|
38
38
|
"build_url": "http://10.0.1.76:3000/projects/63/branches/89/builds/3",
|
39
39
|
"build_number": 3,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/branches?auth_token=Yds3w6o26FLfJTnVK2y9
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://semaphoreci.com/api/v1/projects?auth_token=Yds3w6o26FLfJTnVK2y9
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -63,8 +63,8 @@ http_interactions:
|
|
63
63
|
{
|
64
64
|
"branch_name": "master",
|
65
65
|
"branch_url": "http://10.0.1.76:3000/projects/61/branches/85",
|
66
|
-
"branch_status_url": "http://
|
67
|
-
"branch_history_url": "http://
|
66
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
67
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
|
68
68
|
"project_name": "testapp-sphinx",
|
69
69
|
"build_url": "http://10.0.1.76:3000/projects/61/branches/85/builds/1",
|
70
70
|
"build_number": 1,
|
@@ -85,8 +85,8 @@ http_interactions:
|
|
85
85
|
{
|
86
86
|
"branch_name": "mongoid3",
|
87
87
|
"branch_url": "http://10.0.1.76:3000/projects/63/branches/89",
|
88
|
-
"branch_status_url": "http://
|
89
|
-
"branch_history_url": "http://
|
88
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
89
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
|
90
90
|
"project_name": "testapp-mongodb",
|
91
91
|
"build_url": "http://10.0.1.76:3000/projects/63/branches/89/builds/3",
|
92
92
|
"build_number": 3,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/build?auth_token=Yds3w6o26FLfJTnVK2y9
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: auth_token=Yds3w6o26FLfJTnVK2y9
|
@@ -49,7 +49,7 @@ http_interactions:
|
|
49
49
|
- nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
|
50
50
|
body:
|
51
51
|
encoding: UTF-8
|
52
|
-
string: ! '{"commits":[{"id":"dummy_commit","url":"https://github.com/company/dummy_project/commit/dummy_commit","author_name":"Dude","author_email":"dude@company.co.uk","message":"Spiky spike","timestamp":"2014-07-23T09:52:55Z"},{"id":"foobar","url":"https://github.com/company/dummy_project/commit/foobar","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-25T15:33:05Z"},{"id":"dummy_commit4","url":"https://github.com/company/dummy_project/commit/dummy_commit4","author_name":"Dude","author_email":"dude@company.co.uk","message":"Move letter-opener to production gem","timestamp":"2014-07-28T07:32:28Z"},{"id":"dummy_commit2","url":"https://github.com/company/dummy_project/commit/dummy_commit2","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-30T07:25:37Z"},{"id":"dummy_commit3","url":"https://github.com/company/dummy_project/commit/dummy_commit3","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-08-04T10:08:26Z"},{"id":"dummy_commit5","url":"https://github.com/company/dummy_project/commit/dummy_commit5","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch\n\nConflicts:\n\tGemfile","timestamp":"2014-12-18T09:05:53Z"}],"project_name":"dummy_project","branch_name":"dumy-branch","number":4,"result":null,"created_at":"2014-12-18T09:44:11Z","updated_at":"2014-12-18T09:44:11Z","started_at":null,"finished_at":null,"html_url":"https://
|
52
|
+
string: ! '{"commits":[{"id":"dummy_commit","url":"https://github.com/company/dummy_project/commit/dummy_commit","author_name":"Dude","author_email":"dude@company.co.uk","message":"Spiky spike","timestamp":"2014-07-23T09:52:55Z"},{"id":"foobar","url":"https://github.com/company/dummy_project/commit/foobar","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-25T15:33:05Z"},{"id":"dummy_commit4","url":"https://github.com/company/dummy_project/commit/dummy_commit4","author_name":"Dude","author_email":"dude@company.co.uk","message":"Move letter-opener to production gem","timestamp":"2014-07-28T07:32:28Z"},{"id":"dummy_commit2","url":"https://github.com/company/dummy_project/commit/dummy_commit2","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-30T07:25:37Z"},{"id":"dummy_commit3","url":"https://github.com/company/dummy_project/commit/dummy_commit3","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-08-04T10:08:26Z"},{"id":"dummy_commit5","url":"https://github.com/company/dummy_project/commit/dummy_commit5","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch\n\nConflicts:\n\tGemfile","timestamp":"2014-12-18T09:05:53Z"}],"project_name":"dummy_project","branch_name":"dumy-branch","number":4,"result":null,"created_at":"2014-12-18T09:44:11Z","updated_at":"2014-12-18T09:44:11Z","started_at":null,"finished_at":null,"html_url":"https://semaphoreci.com/company/dummy_project/branches/dumy-branch/builds/4","build_log_url":"https://semaphoreci.com/api/v1/projects/dummy_project/313010/builds/4/log?auth_token=Yds3w6o26FLfJTnVK2y9","build_info_url":"https://semaphoreci.com/api/v1/projects/dummy_project/313010/builds/4?auth_token=Yds3w6o26FLfJTnVK2y9"}'
|
53
53
|
http_version:
|
54
54
|
recorded_at: Thu, 18 Dec 2014 09:38:06 GMT
|
55
55
|
recorded_with: VCR 2.9.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -53,11 +53,11 @@ http_interactions:
|
|
53
53
|
encoding: US-ASCII
|
54
54
|
string: ! '{
|
55
55
|
"branch_name": "gem_updates",
|
56
|
-
"branch_url": "https://
|
57
|
-
"branch_status_url": "http://
|
58
|
-
"branch_history_url": "http://
|
56
|
+
"branch_url": "https://semaphoreci.com/projects/44/branches/50",
|
57
|
+
"branch_status_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
|
58
|
+
"branch_history_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
|
59
59
|
"project_name": "base-app",
|
60
|
-
"build_url": "https://
|
60
|
+
"build_url": "https://semaphoreci.com/projects/44/branches/50/builds/15",
|
61
61
|
"build_number": 15,
|
62
62
|
"result": "passed",
|
63
63
|
"started_at": "2012-07-09T15:23:53Z",
|
@@ -8,21 +8,21 @@ Feature: Help Me I've Got Versionitis
|
|
8
8
|
And the banner should include the version
|
9
9
|
And the banner should document that this app takes options
|
10
10
|
And the following trollop options should be documented:
|
11
|
-
| --version
|
12
|
-
| --help
|
13
|
-
| --working-dir
|
14
|
-
| --project-name
|
15
|
-
| --branch-name
|
16
|
-
| --check-auth
|
17
|
-
| --check-project
|
18
|
-
| --check-branch
|
19
|
-
| --env-config
|
20
|
-
| --git-config
|
21
|
-
| --projects
|
22
|
-
| --branches
|
23
|
-
| --status
|
24
|
-
| --commit-status
|
25
|
-
| --rebuild-last-revision
|
11
|
+
| -v, --version |
|
12
|
+
| -h, --help |
|
13
|
+
| -w, --working-dir |
|
14
|
+
| -p, --project-name |
|
15
|
+
| -b, --branch-name |
|
16
|
+
| -x, --check-auth |
|
17
|
+
| -y, --check-project |
|
18
|
+
| -z, --check-branch |
|
19
|
+
| -e, --env-config |
|
20
|
+
| -g, --git-config |
|
21
|
+
| -r, --projects |
|
22
|
+
| -a, --branches |
|
23
|
+
| -s, --status |
|
24
|
+
| -c, --commit-status |
|
25
|
+
| -u, --rebuild-last-revision |
|
26
26
|
|
27
27
|
Scenario: get the version of the main script
|
28
28
|
|
@@ -3,27 +3,27 @@ Feature: Show Me What You've Got
|
|
3
3
|
@vcr_api_projects
|
4
4
|
Scenario: user's projects
|
5
5
|
|
6
|
-
Given I am an authenticated user on
|
6
|
+
Given I am an authenticated user on semaphoreci.com
|
7
7
|
And get the list of all my projects via their API
|
8
8
|
Then the JSON should be an array
|
9
9
|
|
10
10
|
@vcr_api_branches
|
11
11
|
Scenario: project's branches
|
12
12
|
|
13
|
-
Given I am an authenticated user on
|
13
|
+
Given I am an authenticated user on semaphoreci.com
|
14
14
|
And get the list of all the branches for one of my projects via their API
|
15
15
|
Then the JSON should be an array
|
16
16
|
|
17
17
|
@vcr_api_status
|
18
18
|
Scenario: branch status
|
19
19
|
|
20
|
-
Given I am an authenticated user on
|
20
|
+
Given I am an authenticated user on semaphoreci.com
|
21
21
|
And get the build status of one of the branches for one of my projects via their API
|
22
22
|
Then the JSON should be a hash
|
23
23
|
|
24
24
|
@vcr_api_rebuild_last_revision
|
25
25
|
Scenario: Rebuild last revision
|
26
26
|
|
27
|
-
Given I am an authenticated user on
|
27
|
+
Given I am an authenticated user on semaphoreci.com
|
28
28
|
And request to rebuild the last revision of one of the branches for one of my projects via their API
|
29
29
|
Then the JSON should be a hash
|
@@ -1,10 +1,10 @@
|
|
1
1
|
#
|
2
|
-
# Steps that interact with ENV
|
2
|
+
# Steps that interact with ENV (via `aruba.environment`)
|
3
3
|
#
|
4
4
|
|
5
5
|
Before do
|
6
|
-
|
7
|
-
|
6
|
+
set_environment_variable('SEMAPHORE_AUTH_TOKEN', nil)
|
7
|
+
set_environment_variable('SEMAPHORE_PROJECT_TOKEN', nil)
|
8
8
|
end
|
9
9
|
|
10
10
|
After do
|
@@ -12,16 +12,16 @@ After do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
Given /^the "([A-Z_]+)" env variable is set(?: to "([^"]*)")?$/ do |key, value|
|
15
|
-
|
15
|
+
set_environment_variable(key, value || 'blegga')
|
16
16
|
end
|
17
17
|
|
18
18
|
Given /^the "([A-Z_]+)" env variable is not set$/ do |key|
|
19
|
-
|
19
|
+
set_environment_variable(key, nil)
|
20
20
|
end
|
21
21
|
|
22
22
|
Given /^a runtime environment with config:$/ do |config_table|
|
23
23
|
config_table.rows_hash.each do |key, value|
|
24
|
-
|
24
|
+
set_environment_variable(key, value)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ end
|
|
30
30
|
#
|
31
31
|
|
32
32
|
Given /^a git repo in directory "([^"]*)"$/ do |project_name|
|
33
|
-
@pwd = File.join(
|
33
|
+
@pwd = File.join(expand_path('.'), project_name)
|
34
34
|
@repo = Grit::Repo.init(@pwd)
|
35
35
|
end
|
36
36
|
|
@@ -81,7 +81,7 @@ Then /^the output should include the app name$/ do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
Then /^the output should include a copyright notice$/ do
|
84
|
-
step %(the output should match /Copyright \\(c\\) [\\d]{4} [[\\w]+]+/)
|
84
|
+
step %(the output should match /Copyright \\(c\\) [\\d]{4}-[\\d]{4} [[\\w]+]+/)
|
85
85
|
end
|
86
86
|
|
87
87
|
#
|
@@ -89,33 +89,33 @@ end
|
|
89
89
|
#
|
90
90
|
|
91
91
|
# Then /^the application uses "([^"]+)" as the git auth token$/ do |auth_token|
|
92
|
-
# (@app || Git::Semaphore::App.new(@repo,
|
92
|
+
# (@app || Git::Semaphore::App.new(@repo, aruba.environment)).git_auth_token.should eq auth_token
|
93
93
|
# end
|
94
94
|
|
95
95
|
# Then /^the application uses "([^"]+)" as the git project token$/ do |project_token|
|
96
|
-
# (@app || Git::Semaphore::App.new(@repo,
|
96
|
+
# (@app || Git::Semaphore::App.new(@repo, aruba.environment)).git_project_token.should eq project_token
|
97
97
|
# end
|
98
98
|
|
99
99
|
# Then /^the application uses "([^"]+)" as the env auth token$/ do |auth_token|
|
100
|
-
# (@app || Git::Semaphore::App.new(@repo,
|
100
|
+
# (@app || Git::Semaphore::App.new(@repo, aruba.environment)).env_auth_token.should eq auth_token
|
101
101
|
# end
|
102
102
|
|
103
103
|
# Then /^the application uses "([^"]+)" as the env project token$/ do |project_token|
|
104
|
-
# (@app || Git::Semaphore::App.new(@repo,
|
104
|
+
# (@app || Git::Semaphore::App.new(@repo, aruba.environment)).env_project_token.should eq project_token
|
105
105
|
# end
|
106
106
|
|
107
107
|
Then /^the application doesn't have an auth token$/ do
|
108
|
-
(@app || Git::Semaphore::App.new(@pwd,
|
108
|
+
(@app || Git::Semaphore::App.new(@pwd, aruba.environment)).auth_token.should be_empty
|
109
109
|
end
|
110
110
|
|
111
111
|
Then /^the application doesn't have a project token$/ do
|
112
|
-
(@app || Git::Semaphore::App.new(@pwd,
|
112
|
+
(@app || Git::Semaphore::App.new(@pwd, aruba.environment)).project_token.should be_empty
|
113
113
|
end
|
114
114
|
|
115
115
|
Then /^the application uses "([^"]+)" as the auth token$/ do |auth_token|
|
116
|
-
(@app || Git::Semaphore::App.new(@pwd,
|
116
|
+
(@app || Git::Semaphore::App.new(@pwd, aruba.environment)).auth_token.should eq auth_token
|
117
117
|
end
|
118
118
|
|
119
119
|
Then /^the application uses "([^"]+)" as the project token$/ do |project_token|
|
120
|
-
(@app || Git::Semaphore::App.new(@pwd,
|
120
|
+
(@app || Git::Semaphore::App.new(@pwd, aruba.environment)).project_token.should eq project_token
|
121
121
|
end
|
data/features/support/env.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
#
|
2
|
-
SEMAPHORE_TEST_TOKEN='Yds3w6o26FLfJTnVK2y9'
|
1
|
+
# https://semaphoreci.com/docs/
|
2
|
+
SEMAPHORE_TEST_TOKEN='Yds3w6o26FLfJTnVK2y9'
|
data/git-semaphore.gemspec
CHANGED
@@ -1,40 +1,35 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'git-semaphore/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "git-semaphore"
|
8
|
+
spec.version = Git::Semaphore::VERSION
|
9
|
+
spec.authors = ["Peter Vandenberk"]
|
10
|
+
spec.email = ["pvandenberk@mac.com"]
|
11
|
+
spec.summary = ["git integration with https://semaphoreci.com"]
|
12
|
+
spec.description = ["git integration with https://semaphoreci.com"]
|
13
|
+
spec.homepage = "https://github.com/pvdb/git-semaphore"
|
14
|
+
spec.license = "MIT"
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
spec.add_dependency('grit')
|
22
|
+
spec.add_dependency('trollop')
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
gem.add_development_dependency('rspec-pride')
|
35
|
-
gem.add_development_dependency('cucumber-pride')
|
36
|
-
gem.add_development_dependency('vcr')
|
37
|
-
gem.add_development_dependency('webmock')
|
38
|
-
gem.add_development_dependency('jazor')
|
39
|
-
gem.add_development_dependency('json_spec')
|
24
|
+
spec.add_development_dependency('pry')
|
25
|
+
spec.add_development_dependency('rake')
|
26
|
+
spec.add_development_dependency('bundler')
|
27
|
+
spec.add_development_dependency('cucumber')
|
28
|
+
spec.add_development_dependency('rspec')
|
29
|
+
spec.add_development_dependency('aruba')
|
30
|
+
spec.add_development_dependency('methadone')
|
31
|
+
spec.add_development_dependency('vcr')
|
32
|
+
spec.add_development_dependency('webmock')
|
33
|
+
spec.add_development_dependency('jazor')
|
34
|
+
spec.add_development_dependency('json_spec')
|
40
35
|
end
|
data/lib/git-semaphore.rb
CHANGED
data/lib/git-semaphore/api.rb
CHANGED
@@ -6,9 +6,9 @@ module Git
|
|
6
6
|
module Semaphore
|
7
7
|
class Api
|
8
8
|
|
9
|
-
#
|
9
|
+
# https://semaphoreci.com/docs/
|
10
10
|
|
11
|
-
SEMAPHORE_API_HOST = '
|
11
|
+
SEMAPHORE_API_HOST = 'semaphoreci.com'
|
12
12
|
SEMAPHORE_API_URI = '/api/v1'
|
13
13
|
|
14
14
|
def self.projects_uri auth_token
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Git
|
2
2
|
module Semaphore
|
3
3
|
# TODO replace hard-coded details with data retrieved from the gemspec
|
4
|
-
COPYRIGHT = "git-semaphore v#{Git::Semaphore::VERSION} Copyright (c) 2012 Peter Vandenberk"
|
4
|
+
COPYRIGHT = "git-semaphore v#{Git::Semaphore::VERSION} Copyright (c) 2012-2015 Peter Vandenberk"
|
5
5
|
end
|
6
6
|
end
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Vandenberk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grit
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '>='
|
@@ -136,90 +136,6 @@ dependencies:
|
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: guard-rspec
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - '>='
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - '>='
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: guard-cucumber
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '>='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '>='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: rb-fsevent
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - '>='
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: growl
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - '>='
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - '>='
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: rspec-pride
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - '>='
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '0'
|
202
|
-
type: :development
|
203
|
-
prerelease: false
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
205
|
-
requirements:
|
206
|
-
- - '>='
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: '0'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: cucumber-pride
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - '>='
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - '>='
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '0'
|
223
139
|
- !ruby/object:Gem::Dependency
|
224
140
|
name: vcr
|
225
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,7 +192,7 @@ dependencies:
|
|
276
192
|
- - '>='
|
277
193
|
- !ruby/object:Gem::Version
|
278
194
|
version: '0'
|
279
|
-
description: '["git integration with https://
|
195
|
+
description: '["git integration with https://semaphoreci.com"]'
|
280
196
|
email:
|
281
197
|
- pvandenberk@mac.com
|
282
198
|
executables:
|
@@ -288,6 +204,7 @@ files:
|
|
288
204
|
- .gitconform
|
289
205
|
- .gitignore
|
290
206
|
- .irbrc
|
207
|
+
- .pryrc
|
291
208
|
- .ruby-version
|
292
209
|
- Gemfile
|
293
210
|
- Guardfile
|
@@ -327,7 +244,8 @@ files:
|
|
327
244
|
- spec_helper.rb
|
328
245
|
- vendor/bundle/.gitignore
|
329
246
|
homepage: https://github.com/pvdb/git-semaphore
|
330
|
-
licenses:
|
247
|
+
licenses:
|
248
|
+
- MIT
|
331
249
|
metadata: {}
|
332
250
|
post_install_message:
|
333
251
|
rdoc_options: []
|
@@ -345,10 +263,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
263
|
version: '0'
|
346
264
|
requirements: []
|
347
265
|
rubyforge_project:
|
348
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.4.8
|
349
267
|
signing_key:
|
350
268
|
specification_version: 4
|
351
|
-
summary: '["git integration with https://
|
269
|
+
summary: '["git integration with https://semaphoreci.com"]'
|
352
270
|
test_files:
|
353
271
|
- features/cassettes/cucumber_tags/api_branch_status.json
|
354
272
|
- features/cassettes/cucumber_tags/api_project_branches.json
|