concourse-github-status 0.3.1 → 0.4.0
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/README.org +13 -1
- data/lib/github-status/in.rb +21 -0
- data/lib/github-status/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa35a8da151545bf51314248d70f3b7113892fe1
|
4
|
+
data.tar.gz: c56cc31c6774407924fda4e8a3af52e6981242e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e6c857237b928ce2bc43b47503f288d2c079d1bafb06195cbecda822ae136d577c48c13619b8ddd99814019deedfc6683be6c13140c86d072a61332acc2625e
|
7
|
+
data.tar.gz: 945a17338039877cfdfda5e72e78e933baf18cc93147d3dbbcda593f0f81a568bfbd06fa6cb060639e6e6539331e48c3a92617a239dfd85c6e684596c5b5b1e1
|
data/README.org
CHANGED
@@ -48,7 +48,19 @@ Add the resource to your pipeline's ~resource_types~ (requires Concourse 0.74.0+
|
|
48
48
|
|
49
49
|
- None
|
50
50
|
|
51
|
-
** ~in~
|
51
|
+
** ~in~ Fetch a status
|
52
|
+
|
53
|
+
*** Parameters
|
54
|
+
|
55
|
+
Fetches the state of ~context~ for the current commit of the repository at
|
56
|
+
~path~, and write it to ~{context}.state~
|
57
|
+
|
58
|
+
|-------------+----------+-----------+--------------------------------------------|
|
59
|
+
| Name | Required | Default | Description |
|
60
|
+
|-------------+----------+-----------+--------------------------------------------|
|
61
|
+
| path | Yes | | Relative path to the repository |
|
62
|
+
| context | No | concourse | The ~context~ for the status being updated |
|
63
|
+
|-------------+----------+-----------+--------------------------------------------|
|
52
64
|
|
53
65
|
* License
|
54
66
|
|
data/lib/github-status/in.rb
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
require 'concourse-fuselage'
|
2
|
+
require 'contracts'
|
3
|
+
require_relative 'core'
|
4
|
+
require_relative 'support/git'
|
5
|
+
require_relative 'support/github'
|
6
|
+
require_relative 'support/params'
|
2
7
|
|
3
8
|
module GitHubStatus
|
4
9
|
class In < Fuselage::In
|
10
|
+
include Core
|
11
|
+
include Support::Params
|
12
|
+
include Support::Git
|
13
|
+
include Support::GitHub
|
14
|
+
|
15
|
+
def status
|
16
|
+
github
|
17
|
+
.statuses(repo, sha)
|
18
|
+
.select { |status| status.context == context }
|
19
|
+
.map(&:state)
|
20
|
+
.first
|
21
|
+
end
|
22
|
+
|
23
|
+
def fetch!
|
24
|
+
File.write "#{workdir}/#{context}.state", state
|
25
|
+
end
|
5
26
|
end
|
6
27
|
end
|