concourse-github-status 0.2.2 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad8b6e2ae07e6f80a8031f606b04f0cf98a7af4e
4
- data.tar.gz: 3829476d95766843f27aeaf4163882d1b6a4c970
3
+ metadata.gz: 892aa1f4770c7ad1279e6cd534f9027c8990cb9a
4
+ data.tar.gz: fee96e8be52180a4ced6a83f10ac0b1b6f86eb0f
5
5
  SHA512:
6
- metadata.gz: 7923d6eb6b476d9fcdaf4a624fc35620b7c55bdc531af5f38119a42854add7955d653faf6462cf476413f0f310009ac4e2866fd1ebadee8b64a1e1319e4d5abf
7
- data.tar.gz: 1dccc0c948087af4a8c3e07eb3c3b095529fde68f0c0a79365c08c8f6808f5a3d1efd71d97d270ad4e92baec667eb2d2b9c116409a9e300a601ba30792e9944f
6
+ metadata.gz: c39f6ea2fe317075f688928cfcc12e4aee79a58908dc3cbd8c9c4d458fd7072ebbfbee471811f9f3f6f8c3dfa585f2ccb9a0f4c40433e333b67aa789cdb3ce4d
7
+ data.tar.gz: 25380ea07127d3331921431c1ff27400045bf54d5d5128e53b11d50e23443e4654f3f64571d776c78c539e5486d97025223c274adf19756b3540a7d8f55d00a7
data/.gitignore CHANGED
@@ -1 +1,4 @@
1
+ .bundle/**
2
+ pkg/**
3
+ secrets.yaml
1
4
  vendor/**
data/Dockerfile CHANGED
@@ -1,6 +1,8 @@
1
1
  FROM gems/concourse-fuselage
2
2
 
3
- RUN apk-install git \
3
+ RUN apk-install git ca-certificates openssl-dev \
4
+ && update-ca-certificates \
5
+ && apk del openssl-dev \
4
6
  && gem-install concourse-github-status
5
7
 
6
8
  WORKDIR /opt/resource
data/bin/in CHANGED
@@ -1,3 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- STDERR.puts 'Not Implemented'
3
+ require 'github-status/in'
4
+
5
+ fetch = GitHubStatus::In.new
6
+
7
+ unless fetch.run
8
+ STDERR.puts "Failed to fetch status"
9
+ abort
10
+ end
@@ -1,10 +1,14 @@
1
+ require_relative 'lib/github-status'
2
+
1
3
  Gem::Specification.new do |gem|
2
4
  gem.name = 'concourse-github-status'
3
- gem.version = '0.2.2'
4
- gem.authors = ['Chris Olstrom']
5
+ gem.version = GitHubStatus::VERSION
5
6
  gem.license = 'Apache-2.0'
6
7
  gem.summary = 'GitHub Status resource for Concourse'
7
- gem.description = 'Concourse Resource for updating arbitrary GitHub statuses'
8
+
9
+ gem.author = 'Chris Olstrom'
10
+ gem.email = 'chris@olstrom.com'
11
+ gem.homepage = 'https://github.com/colstrom/concourse-github-status'
8
12
 
9
13
  gem.files = `git ls-files`.split("\n")
10
14
  gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -0,0 +1,4 @@
1
+
2
+ require_relative 'github-status/in'
3
+ require_relative 'github-status/out'
4
+ require_relative 'github-status/version'
@@ -0,0 +1,6 @@
1
+ require 'concourse-fuselage'
2
+
3
+ module GitHubStatus
4
+ class In < Fuselage::In
5
+ end
6
+ end
@@ -2,15 +2,17 @@
2
2
 
3
3
  require 'concourse-fuselage'
4
4
  require 'contracts'
5
- require 'git'
6
- require 'octokit'
7
5
  require_relative 'core'
8
6
  require_relative 'support/params'
7
+ require_relative 'support/git'
8
+ require_relative 'support/github'
9
9
 
10
10
  module GitHubStatus
11
11
  class Out < Fuselage::Out
12
12
  include Core
13
13
  include Support::Params
14
+ include Support::Git
15
+ include Support::GitHub
14
16
 
15
17
  Contract None => Sawyer::Resource
16
18
  def update!
@@ -38,23 +40,5 @@ module GitHubStatus
38
40
  description: description
39
41
  }
40
42
  end
41
-
42
- Contract None => Git::Base
43
- def git
44
- @git ||= Git.open "#{workdir}/#{path}"
45
- rescue ArgumentError
46
- STDERR.puts "#{path} is not a git repository"
47
- abort
48
- end
49
-
50
- Contract None => String
51
- def sha
52
- @sha ||= git.revparse 'HEAD'
53
- end
54
-
55
- Contract None => Octokit::Client
56
- def github
57
- @github ||= Octokit::Client.new access_token: access_token
58
- end
59
43
  end
60
44
  end
@@ -0,0 +1,24 @@
1
+ require 'contracts'
2
+ require 'git'
3
+
4
+ module GitHubStatus
5
+ module Support
6
+ module Git
7
+ include ::Contracts::Core
8
+ include ::Contracts::Builtin
9
+
10
+ Contract None => ::Git::Base
11
+ def git
12
+ @git ||= Git.open "#{workdir}/#{path}"
13
+ rescue ArgumentError
14
+ STDERR.puts "#{path} is not a git repository"
15
+ abort
16
+ end
17
+
18
+ Contract None => String
19
+ def sha
20
+ @sha ||= git.revparse 'HEAD'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ require 'contracts'
2
+ require 'octokit'
3
+
4
+ module GitHubStatus
5
+ module Support
6
+ module GitHub
7
+ include ::Contracts::Core
8
+ include ::Contracts::Builtin
9
+ include Source
10
+
11
+ Contract None => Octokit::Client
12
+ def github
13
+ @github ||= Octokit::Client.new access_token: access_token
14
+ end
15
+ end
16
+ end
17
+ end
@@ -14,7 +14,7 @@ module GitHubStatus
14
14
  abort
15
15
  end
16
16
 
17
- Contract None => String
17
+ Contract None => Enum['success', 'pending', 'failure']
18
18
  def state
19
19
  @state ||= params.fetch 'state'
20
20
  rescue KeyError
@@ -21,6 +21,11 @@ module GitHubStatus
21
21
  STDERR.puts 'Source is missing repo'
22
22
  abort
23
23
  end
24
+
25
+ Contract None => String
26
+ def branch
27
+ @branch ||= source.fetch('branch') { 'master' }
28
+ end
24
29
  end
25
30
  end
26
31
  end
@@ -0,0 +1,3 @@
1
+ module GitHubStatus
2
+ VERSION = '0.2.4'.freeze
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concourse-github-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concourse-fuselage
@@ -70,8 +70,8 @@ dependencies:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: 4.2.0
73
- description: Concourse Resource for updating arbitrary GitHub statuses
74
- email:
73
+ description:
74
+ email: chris@olstrom.com
75
75
  executables:
76
76
  - check
77
77
  - in
@@ -89,11 +89,16 @@ files:
89
89
  - bin/in
90
90
  - bin/out
91
91
  - concourse-github-status.gemspec
92
+ - lib/github-status.rb
92
93
  - lib/github-status/core.rb
94
+ - lib/github-status/in.rb
93
95
  - lib/github-status/out.rb
96
+ - lib/github-status/support/git.rb
97
+ - lib/github-status/support/github.rb
94
98
  - lib/github-status/support/params.rb
95
99
  - lib/github-status/support/source.rb
96
- homepage:
100
+ - lib/github-status/version.rb
101
+ homepage: https://github.com/colstrom/concourse-github-status
97
102
  licenses:
98
103
  - Apache-2.0
99
104
  metadata: {}