conjur-rack-heartbeat 2.0.0 → 2.2.1.pre.7

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
- SHA1:
3
- metadata.gz: 787168e29f4219e9b151d18ca6b9316b1c872ade
4
- data.tar.gz: a8cde571d1fb2b9873dd1b49bf872a41d8b3df79
2
+ SHA256:
3
+ metadata.gz: 78efefef913da2c11c5074a9444bd4d6aa4ea16484d6f3c0e896eef13025bfda
4
+ data.tar.gz: 16b0ea6dbf199bf11ddb05e88b6de92d56abdce5af1265fe08fdc745a57af4b5
5
5
  SHA512:
6
- metadata.gz: 4112db2d4e98f16d60dd52c8b3465a1ed0116d635cffaa8986c87a5eaf7798ae1a5b6bf7b9ae6b9a2a15eac6b546bd7724a08ffcba313e4fd6260317cd8837e1
7
- data.tar.gz: b780e23f6ed4d3a155b7e301de7e165e1dd1c54907bac1bf4c8c73fb58de61fbf4bd31d5d6a634d45c64a53ba2a115b2adb17dfeac1c7028b4612bf874c7e5da
6
+ metadata.gz: 72a08c1bffbc85b5f1b5336352cd0efc0479e7435481a98475b0f2cb4206b8c3921b852bf7de07d41d46f975089f9bfa39070c2ca23936f46de1c02581691521
7
+ data.tar.gz: 46bb0432eff5c4095674a666a3747a281513c8b4c379cba5239bbe1ff26de98baa2ad04ed8d340b3e6a69ba84691d7844643b58ed216633939cda488920df7bc
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
- report.xml
1
+ test/junit.xml
2
2
  *.gem
3
3
  *.rbc
4
4
  .bundle
@@ -7,7 +7,7 @@ report.xml
7
7
  Gemfile.lock
8
8
  InstalledFiles
9
9
  _yardoc
10
- coverage
10
+ coverage/
11
11
  doc/
12
12
  lib/bundler/man
13
13
  pkg
data/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+ ### Changed
9
+ - Nothing should go in this section, please add to the latest unreleased version
10
+ (and update the corresponding date), or add a new version.
11
+
12
+ ## [2.2.1] - 2022-01-19
13
+
14
+ ## [2.2.0] - 2018-04-24
15
+ ### Added
16
+ - Use a symbol when loading `Rack::Heartbeat` into the app's middleware. This
17
+ change means we can support Rails 5.2+. From upstream
18
+ https://github.com/imajes/rack-heartbeat/commit/cac635cd29a61afd23899128b674443176295ad5
19
+
20
+ ## [2.1.0] - 2016-04-07
21
+ ### Added
22
+ - Add Sinatra support [#1](https://github.com/conjurinc/rack-heartbeat/pull/1)
23
+
24
+ ## [2.0.0] - 2016-01-17
25
+ ### Added
26
+ - Adapted to provide `OPTIONS /` as a heartbeat URL, for Conjur
27
+
28
+ ## [1.0.1] - 2015-03-23
29
+ ### Changed
30
+ - Forked from https://github.com/imajes/rack-heartbeat
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM registry.tld/cyberark/ubuntu-ruby-fips:latest
2
+
3
+ RUN export DEBIAN_FRONTEND=noninteractive && \
4
+ apt-get update -y && \
5
+ apt-get dist-upgrade -y && \
6
+ apt-get install -y build-essential curl git tzdata
7
+
8
+ WORKDIR /usr/src/app
9
+
10
+ COPY Gemfile* ./
11
+ COPY *.gemspec ./
12
+ COPY VERSION ./
13
+ RUN bundle install
14
+
15
+ COPY . .
16
+
17
+ # CMD ["./your-daemon-or-script.rb"]
data/Gemfile CHANGED
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'coveralls', :group => :test, :require => false
6
+ gem 'rake', :group => :test
data/Jenkinsfile ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env groovy
2
+
3
+ // Automated release, promotion and dependencies
4
+ properties([
5
+ release.addParams()
6
+ ])
7
+
8
+ if (params.MODE == "PROMOTE") {
9
+ release.promote(params.VERSION_TO_PROMOTE) { sourceVersion, targetVersion, assetDirectory ->
10
+ sh './publish-rubygem.sh'
11
+ }
12
+ return
13
+ }
14
+
15
+ pipeline {
16
+ agent { label 'executor-v2' }
17
+
18
+ options {
19
+ timestamps()
20
+ buildDiscarder(logRotator(numToKeepStr: '30'))
21
+ }
22
+
23
+ triggers {
24
+ cron(getDailyCronString())
25
+ }
26
+
27
+ environment {
28
+ MODE = release.canonicalizeMode()
29
+ }
30
+
31
+ stages {
32
+
33
+ stage ("Skip build if triggering job didn't create a release") {
34
+ when {
35
+ expression {
36
+ MODE == "SKIP"
37
+ }
38
+ }
39
+ steps {
40
+ script {
41
+ currentBuild.result = 'ABORTED'
42
+ error("Aborting build because this build was triggered from upstream, but no release was built")
43
+ }
44
+ }
45
+ }
46
+
47
+ stage('Validate Changelog and set version') {
48
+ steps {
49
+ sh './bin/parse-a-changelog'
50
+ updateVersion("CHANGELOG.md", "${BUILD_NUMBER}")
51
+ }
52
+ }
53
+
54
+ stage('Test') {
55
+ steps {
56
+ sh './test.sh'
57
+ }
58
+ post { always {
59
+ junit 'test/junit.xml'
60
+ }}
61
+ }
62
+
63
+ stage('Release') {
64
+ when {
65
+ expression {
66
+ MODE == "RELEASE"
67
+ }
68
+ }
69
+
70
+ steps {
71
+ release { billOfMaterialsDirectory, assetDirectory ->
72
+ sh './publish-rubygem.sh'
73
+ sh 'cp conjur-rack-heartbeat-*.gem release-assets/.'
74
+ }
75
+ }
76
+ }
77
+
78
+ }
79
+
80
+ post {
81
+ always {
82
+ cleanupAndNotify(currentBuild.currentResult)
83
+ }
84
+ }
85
+ }
data/Rakefile CHANGED
@@ -11,6 +11,6 @@ end
11
11
  Rake::TestTask.new(:jenkins) do |t|
12
12
  t.libs << 'test'
13
13
  t.test_files = FileList['test/**/test*.rb']
14
- t.options = '--junit'
14
+ t.options = '--junit --junit-filename=test/junit.xml --junit-jenkins'
15
15
  t.verbose = true
16
16
  end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ set -ex
3
+
4
+ cd "$(dirname "$0")"
5
+ docker run --rm \
6
+ -v $PWD/..:/src/conjur-server \
7
+ -w /src/conjur-server \
8
+ ruby:2.5 bash -ec "
9
+ gem install -N parse_a_changelog
10
+ parse ./CHANGELOG.md
11
+ "
@@ -4,14 +4,14 @@ Gem::Specification.new do |gem|
4
4
  gem.authors = ["James Cox", "Kevin Gilpin"]
5
5
  gem.email = ["james@imaj.es", "kgilpin@gmail.com"]
6
6
  gem.summary = %q{Provides OPTIONS / as a heartbeat URL}
7
- gem.homepage = "https://github.com/conjurinc/rack-heartbeat"
7
+ gem.homepage = "https://rubygems.org/gems/conjur-rack-heartbeat"
8
8
 
9
9
  gem.files = `git ls-files`.split($\)
10
10
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.name = "conjur-rack-heartbeat"
13
13
  gem.require_paths = ["lib"]
14
- gem.version = '2.0.0'
14
+ gem.version = File.open('VERSION', &:readline)
15
15
 
16
16
  gem.add_development_dependency('minitest')
17
17
  gem.add_development_dependency('rack-test')
@@ -1,2 +1,8 @@
1
1
  require 'rack/heartbeat'
2
- require 'rack/heartbeat/railtie' if defined?(Rails)
2
+
3
+ if defined?(Rails)
4
+ require 'rack/heartbeat/railtie'
5
+ elsif defined?(Sinatra)
6
+ require 'rack/heartbeat/sinatra'
7
+ end
8
+
@@ -2,7 +2,7 @@ module Rack
2
2
 
3
3
  class Heartbeat::Railtie < Rails::Railtie
4
4
  initializer "rack.heartbeat.initializer" do |app|
5
- app.middleware.insert 0, 'Rack::Heartbeat'
5
+ app.middleware.insert 0, Rack::Heartbeat
6
6
  end
7
7
  end
8
8
 
@@ -0,0 +1,20 @@
1
+ require 'rack/heartbeat'
2
+
3
+ module Conjur
4
+ module Rack
5
+ module Heartbeat
6
+ module Sinatra
7
+
8
+ def self.extended cls
9
+ cls.module_eval do
10
+
11
+ configure do
12
+ use ::Rack::Heartbeat
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ summon --yaml "RUBYGEMS_API_KEY: !var rubygems/api-key" \
5
+ publish-rubygem conjur-rack-heartbeat
data/test.sh ADDED
@@ -0,0 +1,12 @@
1
+ #!/bin/bash -e
2
+
3
+ docker build -t rack-heartbeat .
4
+
5
+ docker run --rm \
6
+ -v $PWD/coverage:/usr/src/app/coverage \
7
+ -v $PWD/test:/usr/src/app/test \
8
+ rack-heartbeat \
9
+ bundle exec rake jenkins
10
+ # gem install -N bundler
11
+ # bundle
12
+ # bundle exec rake jenkins
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-rack-heartbeat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.1.pre.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Cox
@@ -9,87 +9,94 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-07 00:00:00.000000000 Z
12
+ date: 2022-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rack-test
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest-junit
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rack
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  description:
71
71
  email:
72
72
  - james@imaj.es
73
73
  - kgilpin@gmail.com
74
- executables: []
74
+ executables:
75
+ - parse-a-changelog
75
76
  extensions: []
76
77
  extra_rdoc_files: []
77
78
  files:
78
- - .gitignore
79
- - .project
79
+ - ".gitignore"
80
+ - ".project"
81
+ - CHANGELOG.md
82
+ - Dockerfile
80
83
  - Gemfile
84
+ - Jenkinsfile
81
85
  - LICENSE
82
86
  - README.md
83
87
  - Rakefile
88
+ - bin/parse-a-changelog
84
89
  - config.ru
85
- - jenkins.sh
90
+ - conjur-rack-heartbeat.gemspec
86
91
  - lib/conjur-rack-heartbeat.rb
87
92
  - lib/rack/heartbeat.rb
88
93
  - lib/rack/heartbeat/railtie.rb
89
- - rack-heartbeat.gemspec
94
+ - lib/rack/heartbeat/sinatra.rb
95
+ - publish-rubygem.sh
96
+ - test.sh
90
97
  - test/helper.rb
91
98
  - test/rack/test_heartbeat.rb
92
- homepage: https://github.com/conjurinc/rack-heartbeat
99
+ homepage: https://rubygems.org/gems/conjur-rack-heartbeat
93
100
  licenses: []
94
101
  metadata: {}
95
102
  post_install_message:
@@ -98,17 +105,17 @@ require_paths:
98
105
  - lib
99
106
  required_ruby_version: !ruby/object:Gem::Requirement
100
107
  requirements:
101
- - - '>='
108
+ - - ">="
102
109
  - !ruby/object:Gem::Version
103
110
  version: '0'
104
111
  required_rubygems_version: !ruby/object:Gem::Requirement
105
112
  requirements:
106
- - - '>='
113
+ - - ">"
107
114
  - !ruby/object:Gem::Version
108
- version: '0'
115
+ version: 1.3.1
109
116
  requirements: []
110
117
  rubyforge_project:
111
- rubygems_version: 2.4.3
118
+ rubygems_version: 2.7.6.2
112
119
  signing_key:
113
120
  specification_version: 4
114
121
  summary: Provides OPTIONS / as a heartbeat URL
data/jenkins.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash -e
2
-
3
- gem install -N bundler
4
- bundle
5
- bundle exec rake jenkins