concourse-github-status 0.6.6 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ef31815b454a72c7b9e97b8f69d059360dc7465083fc3b36f9763807f124bce
4
- data.tar.gz: b1d25207cdf1261fbcd97026b1fb50339734bdf3baf6972623ee1ed3be98696f
3
+ metadata.gz: a325b6b7fc630285e3adbf9197e4f1bbf7a2cb3a752c5ea5c0d401788998dbed
4
+ data.tar.gz: 0c9628d16215bc76ae986139f3bea7bab833cc23ebfc3f2d8c879988603e6fbb
5
5
  SHA512:
6
- metadata.gz: adab3b1d0168ffa8cbd645e9873751b218d22f30418c070cc6974a5804bb96cc12c6bb8fca1b2e5dd2380ae2e6c9256d5f41e73f789b6a6e3a95a73c6698a792
7
- data.tar.gz: 260c56f7397d0111daf4f54127d7fb05ca98ae55f007613d1a9839be358fa0fb8170a0fa5a6103bbc731bbf0ef4e452ac7d6923830d5b8bdd39ce4e8d19b18cb
6
+ metadata.gz: 05b9d1fb0f31297aad7fa9e03ad6890ca4ff92f1f546964e656495f1de4144286946429944bf869819cd87abac7fb525809d8f6683056bbacf8e33f42d5d66d2
7
+ data.tar.gz: 0b1021177d2d7e1ad0008d8cf25652ee864282b2dde5babd4cb341630bd91efaee0f4e2ca5b254ab2b34e17169b506ba1c9d3131b15c46c2fa7d946077ec88c8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.org CHANGED
@@ -20,12 +20,12 @@ Add the resource to your pipeline's ~resource_types~ (requires Concourse 0.74.0+
20
20
 
21
21
  * Source Configuration
22
22
 
23
- |--------------+----------+---------------------------------------------|
24
- | Name | Required | Description |
25
- |--------------+----------+---------------------------------------------|
26
- | repo | Yes | The GitHub repository in ~user/repo~ format |
27
- | access_token | Yes | The access token to use with the GitHub API |
28
- |--------------+----------+---------------------------------------------|
23
+ |--------------+----------+-------------------------------------------------------------|
24
+ | Name | Required | Description |
25
+ |--------------+----------+-------------------------------------------------------------|
26
+ | repo | Yes | The GitHub repository in ~user/repo~ format |
27
+ | access_token | Yes | The access token to use with the GitHub API |
28
+ |--------------+----------+-------------------------------------------------------------|
29
29
 
30
30
  * Behaviour
31
31
 
@@ -35,35 +35,37 @@ Add the resource to your pipeline's ~resource_types~ (requires Concourse 0.74.0+
35
35
 
36
36
  To set a single status for the current commit of the repository specify these parameters:
37
37
 
38
- |-------------+----------+-----------+--------------------------------------------|
39
- | Name | Required | Default | Description |
40
- |-------------+----------+-----------+--------------------------------------------|
41
- | path | Yes | | Relative path to the repository |
42
- | state | Yes | | One of ~pending~, ~success~, or ~failure~ |
43
- | context | No | concourse | The ~context~ for the status being updated |
44
- | description | No | | A description of the context. |
45
- |-------------+----------+-----------+--------------------------------------------|
38
+ |-------------+----------+-----------+--------------------------------------------------|
39
+ | Name | Required | Default | Description |
40
+ |-------------+----------+-----------+--------------------------------------------------|
41
+ | path | Yes | | Relative path to the repository |
42
+ | state | Yes | | One of ~pending~, ~success~, or ~failure~ |
43
+ | context | No | concourse | The ~context~ for the status being updated |
44
+ | description | No | | A description of the context. |
45
+ | target_url | No | build URL | URL or file containing URL for status target_url |
46
+ |-------------+----------+-----------+--------------------------------------------------|
46
47
 
47
48
  It is also possible to set multiple statuses at the same time. This is useful for adding multiple ~pending~ statuses
48
49
  initially which will be updated by later jobs to the corresponding state, for example.
49
50
  This can be done by specifying a ~statuses~ array:
50
51
 
51
- |-------------+----------+-----------+--------------------------------------------|
52
- | Name | Required | Default | Description |
53
- |-------------+----------+-----------+--------------------------------------------|
54
- | path | Yes | | Relative path to the repository |
55
- | statuses | Yes | | Array of status objects |
56
- |-------------+----------+-----------+--------------------------------------------|
52
+ |-------------+----------+-----------+--------------------------------------------------|
53
+ | Name | Required | Default | Description |
54
+ |-------------+----------+-----------+--------------------------------------------------|
55
+ | path | Yes | | Relative path to the repository |
56
+ | statuses | Yes | | Array of status objects |
57
+ |-------------+----------+-----------+--------------------------------------------------|
57
58
 
58
59
  Each of the status objects supports the following parameters:
59
60
 
60
- |-------------+----------+-----------+--------------------------------------------|
61
- | Name | Required | Default | Description |
62
- |-------------+----------+-----------+--------------------------------------------|
63
- | state | Yes | | One of ~pending~, ~success~, or ~failure~ |
64
- | context | No | concourse | The ~context~ for the status being updated |
65
- | description | No | | A description of the context. |
66
- |-------------+----------+-----------+--------------------------------------------|
61
+ |-------------+----------+-----------+--------------------------------------------------|
62
+ | Name | Required | Default | Description |
63
+ |-------------+----------+-----------+--------------------------------------------------|
64
+ | state | Yes | | One of ~pending~, ~success~, or ~failure~ |
65
+ | context | No | concourse | The ~context~ for the status being updated |
66
+ | description | No | | A description of the context. |
67
+ | target_url | No | build URL | URL or file containing URL for status target_url |
68
+ |-------------+----------+-----------+--------------------------------------------------|
67
69
 
68
70
  ** ~check~ Get a list of available statuses
69
71
 
@@ -78,12 +80,12 @@ Each of the status objects supports the following parameters:
78
80
  Fetches the state of ~context~ for the current commit of the repository at
79
81
  ~path~, and write it to ~{context}.state~
80
82
 
81
- |-------------+----------+-----------+--------------------------------------------|
82
- | Name | Required | Default | Description |
83
- |-------------+----------+-----------+--------------------------------------------|
84
- | path | Yes | | Relative path to the repository |
85
- | context | No | concourse | The ~context~ for the status being updated |
86
- |-------------+----------+-----------+--------------------------------------------|
83
+ |-------------+----------+-----------+--------------------------------------------------|
84
+ | Name | Required | Default | Description |
85
+ |-------------+----------+-----------+--------------------------------------------------|
86
+ | path | Yes | | Relative path to the repository |
87
+ | context | No | concourse | The ~context~ for the status being updated |
88
+ |-------------+----------+-----------+--------------------------------------------------|
87
89
 
88
90
  * License
89
91
 
@@ -22,8 +22,8 @@ module GitHubStatus
22
22
  statuses.map do |status|
23
23
  options = {
24
24
  context: status["context"] || "concourse",
25
- target_url: target_url,
26
- description: status["description"] || ""
25
+ description: status["description"] || "",
26
+ target_url: status["target_url"] || "#{atc_external_url}/builds/#{build_id}"
27
27
  }
28
28
  github.create_status repo, canonical_sha, status["state"], options
29
29
  end
@@ -38,11 +38,6 @@ module GitHubStatus
38
38
  { 'context@sha' => "#{context}@#{canonical_sha}" }
39
39
  end
40
40
 
41
- Contract None => String
42
- def target_url
43
- @target_url ||= "#{atc_external_url}/builds/#{build_id}"
44
- end
45
-
46
41
  Contract None => HashOf[Symbol, String]
47
42
  def options
48
43
  @options ||= {
@@ -36,6 +36,15 @@ module GitHubStatus
36
36
  def statuses
37
37
  @statuses ||= params.fetch 'statuses', []
38
38
  end
39
+
40
+ Contract None => String
41
+ def target_url
42
+ url = params.fetch 'target_url', "#{atc_external_url}/builds/#{build_id}"
43
+ if File.file?(url)
44
+ url = File.read(url).chomp
45
+ end
46
+ @target_url ||= url
47
+ end
39
48
  end
40
49
  end
41
50
  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.6.6
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom
@@ -34,7 +34,7 @@ cert_chain:
34
34
  APmVyMIj8BOONTIc1ZAHLsGH0+fQFhCPG9W2o8uyakRimIHxDPHpr7HT3s5+vlIR
35
35
  ++pdkR83HVNOuHEO3yPK2bf7NGJpNbcM
36
36
  -----END CERTIFICATE-----
37
- date: 2019-06-13 00:00:00.000000000 Z
37
+ date: 2019-07-18 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: concourse-fuselage
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.0.3
148
+ rubygems_version: 3.0.4
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: GitHub Status resource for Concourse
metadata.gz.sig CHANGED
Binary file