concourse-github-status 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.org +6 -1
- data/bin/check +8 -1
- data/lib/github-status.rb +1 -0
- data/lib/github-status/check.rb +37 -0
- data/lib/github-status/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41979e18c541ff109e68893578deb65002b4e517
|
4
|
+
data.tar.gz: a0ddd866017a4149133ae550bcbff0debc28a77f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b18a21c6b3982cca268cbb42a074946145300841e1d9fc21b6b406b3a3d59ecb96091153b15babb46d142d141466f0111b19b84f2df6eead2cdca636589b0e61
|
7
|
+
data.tar.gz: 79c64de2b16e7d3678c884cc6bbb6b045109d467b67208432f88715ff70598f0b168d567bcf8531c79c1894f63518af40491609b09faee7f1392e97594244b2f
|
data/README.org
CHANGED
@@ -42,7 +42,12 @@ Add the resource to your pipeline's ~resource_types~ (requires Concourse 0.74.0+
|
|
42
42
|
| description | No | | A description of the context. |
|
43
43
|
|-------------+----------+-----------+--------------------------------------------|
|
44
44
|
|
45
|
-
** ~check~
|
45
|
+
** ~check~ Get a list of available statuses
|
46
|
+
|
47
|
+
*** Parameters
|
48
|
+
|
49
|
+
- None
|
50
|
+
|
46
51
|
** ~in~ Not Implemented
|
47
52
|
|
48
53
|
* License
|
data/bin/check
CHANGED
data/lib/github-status.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'concourse-fuselage'
|
2
|
+
require_relative 'core'
|
3
|
+
require_relative 'support/github'
|
4
|
+
|
5
|
+
module GitHubStatus
|
6
|
+
class Check < Fuselage::Check
|
7
|
+
include Core
|
8
|
+
include Support::GitHub
|
9
|
+
|
10
|
+
Contract HashOf[String, String] => String
|
11
|
+
def to_sha(version)
|
12
|
+
@sha ||= version.fetch('context@sha') { commit }.split('@').last
|
13
|
+
end
|
14
|
+
|
15
|
+
Contract None => Time
|
16
|
+
def date(sha)
|
17
|
+
@date ||= github.commit(repo, sha).commit.author.date
|
18
|
+
end
|
19
|
+
|
20
|
+
Contract None => String
|
21
|
+
def commit
|
22
|
+
@commit ||= github.branch(repo, branch).commit.sha
|
23
|
+
end
|
24
|
+
|
25
|
+
Contract None => HashOf[String, String]
|
26
|
+
def latest
|
27
|
+
{ 'context@sha' => "concourseci@#{sha}" }
|
28
|
+
end
|
29
|
+
|
30
|
+
Contract HashOf[String, String] => ArrayOf[HashOf[String, String]]
|
31
|
+
def since(version)
|
32
|
+
github
|
33
|
+
.commits_since(repo, date(to_sha(version)))
|
34
|
+
.map { |commit| { 'context@sha' => "concourseci@#{commit[:sha]}" } }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concourse-github-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Olstrom
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- bin/out
|
91
91
|
- concourse-github-status.gemspec
|
92
92
|
- lib/github-status.rb
|
93
|
+
- lib/github-status/check.rb
|
93
94
|
- lib/github-status/core.rb
|
94
95
|
- lib/github-status/in.rb
|
95
96
|
- lib/github-status/out.rb
|