pheme 4.0.2 → 4.0.8
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/.github/workflows/main.yml +34 -0
- data/.gitignore +0 -1
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +138 -0
- data/README.md +10 -1
- data/lib/pheme/queue_poller.rb +14 -20
- data/lib/pheme/version.rb +1 -1
- data/pheme.gemspec +1 -2
- data/spec/queue_poller_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -5
- data/spec/version_spec.rb +7 -6
- metadata +6 -19
- data/.circleci/config.yml +0 -153
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7cc67cd71113bbb6a3d299370e99da9cfac8a298db103cb70f7aa5a2f28eea34
|
|
4
|
+
data.tar.gz: 007d0ca65bb280a49d69a3ea0217b9df943b9e8b657b88de1621fcdb5ac42f23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fed1fa7b147ffaa5701c3eddcbe89c5324ada77e73932eed9c8559088a23a03b110e552fcc22d39f350328263796678e4dedf4734e1caa0720f93f132f08cad
|
|
7
|
+
data.tar.gz: 8fead635a7f32d0f6b3df929e6331e4533ab68ad0b3ecf37c0243d27c8de3d90ec94f26928fe4837e18e0362c907dcf1d2c264e32c01c4a1e86c4228527e3dfa
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Pipeline
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
name: Build
|
|
8
|
+
runs-on: ubuntu-20.04
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v2
|
|
11
|
+
with:
|
|
12
|
+
fetch-depth: 0
|
|
13
|
+
- uses: ruby/setup-ruby@v1
|
|
14
|
+
with:
|
|
15
|
+
bundler-cache: true
|
|
16
|
+
- name: Lint
|
|
17
|
+
run: bundle exec rubocop
|
|
18
|
+
- name: Test
|
|
19
|
+
run: bundle exec rspec
|
|
20
|
+
- name: Release the gem
|
|
21
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
|
22
|
+
run: |
|
|
23
|
+
mkdir -p ~/.gem
|
|
24
|
+
cat << EOF > ~/.gem/credentials
|
|
25
|
+
---
|
|
26
|
+
:github: Bearer ${GITHUB_TOKEN}
|
|
27
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
|
28
|
+
EOF
|
|
29
|
+
chmod 0600 ~/.gem/credentials
|
|
30
|
+
git config user.email "noreply@wealthsimple.com"
|
|
31
|
+
git config user.name "Wolfbot"
|
|
32
|
+
bundle exec rake release
|
|
33
|
+
env:
|
|
34
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.7.3
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## 4.0.8 - 2021-07-12
|
|
8
|
+
### Changed
|
|
9
|
+
- Update dependencies
|
|
10
|
+
|
|
11
|
+
## 4.0.7 - 2021-06-28
|
|
12
|
+
### Changed
|
|
13
|
+
- Update dependencies
|
|
14
|
+
|
|
15
|
+
## 4.0.6 - 2021-06-28
|
|
16
|
+
### Changed
|
|
17
|
+
- Update dependencies
|
|
18
|
+
|
|
19
|
+
## 4.0.5 - 2021-04-20
|
|
20
|
+
### Changed
|
|
21
|
+
- Update dependencies
|
|
22
|
+
|
|
23
|
+
## 4.0.4 - 2021-04-16
|
|
24
|
+
### Changed
|
|
25
|
+
- Migrate CI from CircleCI to GitHub Actions
|
|
26
|
+
|
|
27
|
+
## 4.0.3 - 2021-03-08
|
|
28
|
+
- Update documentation to include instructions on directly publishing to SQS
|
|
29
|
+
|
|
7
30
|
## 4.0.2 - 2020-12-17
|
|
8
31
|
- Bump local dev version, rubocop fixes, add backstage catalog file + sonarqube project settings
|
|
9
32
|
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
pheme (4.0.8)
|
|
5
|
+
activesupport (>= 4)
|
|
6
|
+
aws-sdk-sns (~> 1.1)
|
|
7
|
+
aws-sdk-sqs (~> 1.3)
|
|
8
|
+
recursive-open-struct (~> 1)
|
|
9
|
+
smarter_csv (~> 1)
|
|
10
|
+
|
|
11
|
+
GEM
|
|
12
|
+
remote: https://rubygems.org/
|
|
13
|
+
specs:
|
|
14
|
+
activesupport (6.1.4)
|
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
16
|
+
i18n (>= 1.6, < 2)
|
|
17
|
+
minitest (>= 5.1)
|
|
18
|
+
tzinfo (~> 2.0)
|
|
19
|
+
zeitwerk (~> 2.3)
|
|
20
|
+
ast (2.4.2)
|
|
21
|
+
aws-eventstream (1.1.1)
|
|
22
|
+
aws-partitions (1.477.0)
|
|
23
|
+
aws-sdk-core (3.117.0)
|
|
24
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
|
25
|
+
aws-partitions (~> 1, >= 1.239.0)
|
|
26
|
+
aws-sigv4 (~> 1.1)
|
|
27
|
+
jmespath (~> 1.0)
|
|
28
|
+
aws-sdk-sns (1.42.0)
|
|
29
|
+
aws-sdk-core (~> 3, >= 3.112.0)
|
|
30
|
+
aws-sigv4 (~> 1.1)
|
|
31
|
+
aws-sdk-sqs (1.40.0)
|
|
32
|
+
aws-sdk-core (~> 3, >= 3.112.0)
|
|
33
|
+
aws-sigv4 (~> 1.1)
|
|
34
|
+
aws-sigv4 (1.2.4)
|
|
35
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
|
36
|
+
bundler-audit (0.8.0)
|
|
37
|
+
bundler (>= 1.2.0, < 3)
|
|
38
|
+
thor (~> 1.0)
|
|
39
|
+
concurrent-ruby (1.1.9)
|
|
40
|
+
diff-lcs (1.4.4)
|
|
41
|
+
docile (1.4.0)
|
|
42
|
+
git (1.8.1)
|
|
43
|
+
rchardet (~> 1.8)
|
|
44
|
+
i18n (1.8.10)
|
|
45
|
+
concurrent-ruby (~> 1.0)
|
|
46
|
+
jmespath (1.4.0)
|
|
47
|
+
minitest (5.14.4)
|
|
48
|
+
parallel (1.20.1)
|
|
49
|
+
parser (3.0.1.1)
|
|
50
|
+
ast (~> 2.4.1)
|
|
51
|
+
rack (2.2.3)
|
|
52
|
+
rainbow (3.0.0)
|
|
53
|
+
rake (13.0.3)
|
|
54
|
+
rchardet (1.8.0)
|
|
55
|
+
recursive-open-struct (1.1.3)
|
|
56
|
+
regexp_parser (2.1.1)
|
|
57
|
+
rexml (3.2.5)
|
|
58
|
+
rspec (3.10.0)
|
|
59
|
+
rspec-core (~> 3.10.0)
|
|
60
|
+
rspec-expectations (~> 3.10.0)
|
|
61
|
+
rspec-mocks (~> 3.10.0)
|
|
62
|
+
rspec-collection_matchers (1.2.0)
|
|
63
|
+
rspec-expectations (>= 2.99.0.beta1)
|
|
64
|
+
rspec-core (3.10.1)
|
|
65
|
+
rspec-support (~> 3.10.0)
|
|
66
|
+
rspec-expectations (3.10.1)
|
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
68
|
+
rspec-support (~> 3.10.0)
|
|
69
|
+
rspec-its (1.3.0)
|
|
70
|
+
rspec-core (>= 3.0.0)
|
|
71
|
+
rspec-expectations (>= 3.0.0)
|
|
72
|
+
rspec-mocks (3.10.2)
|
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
74
|
+
rspec-support (~> 3.10.0)
|
|
75
|
+
rspec-support (3.10.2)
|
|
76
|
+
rspec_junit_formatter (0.4.1)
|
|
77
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
|
78
|
+
rubocop (1.18.2)
|
|
79
|
+
parallel (~> 1.10)
|
|
80
|
+
parser (>= 3.0.0.0)
|
|
81
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
82
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
83
|
+
rexml
|
|
84
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
|
85
|
+
ruby-progressbar (~> 1.7)
|
|
86
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
87
|
+
rubocop-ast (1.7.0)
|
|
88
|
+
parser (>= 3.0.1.1)
|
|
89
|
+
rubocop-performance (1.11.3)
|
|
90
|
+
rubocop (>= 1.7.0, < 2.0)
|
|
91
|
+
rubocop-ast (>= 0.4.0)
|
|
92
|
+
rubocop-rails (2.11.2)
|
|
93
|
+
activesupport (>= 4.2.0)
|
|
94
|
+
rack (>= 1.1)
|
|
95
|
+
rubocop (>= 1.7.0, < 2.0)
|
|
96
|
+
rubocop-rspec (2.4.0)
|
|
97
|
+
rubocop (~> 1.0)
|
|
98
|
+
rubocop-ast (>= 1.1.0)
|
|
99
|
+
rubocop-vendor (0.6.1)
|
|
100
|
+
rubocop (>= 0.53.0)
|
|
101
|
+
ruby-progressbar (1.11.0)
|
|
102
|
+
simplecov (0.21.2)
|
|
103
|
+
docile (~> 1.1)
|
|
104
|
+
simplecov-html (~> 0.11)
|
|
105
|
+
simplecov_json_formatter (~> 0.1)
|
|
106
|
+
simplecov-html (0.12.3)
|
|
107
|
+
simplecov_json_formatter (0.1.3)
|
|
108
|
+
smarter_csv (1.2.8)
|
|
109
|
+
thor (1.1.0)
|
|
110
|
+
tzinfo (2.0.4)
|
|
111
|
+
concurrent-ruby (~> 1.0)
|
|
112
|
+
unicode-display_width (2.0.0)
|
|
113
|
+
ws-style (6.9.2)
|
|
114
|
+
rubocop (>= 1.12.1)
|
|
115
|
+
rubocop-performance (>= 1.10.2)
|
|
116
|
+
rubocop-rails (>= 2.9.1)
|
|
117
|
+
rubocop-rspec (>= 2.2.0)
|
|
118
|
+
rubocop-vendor (>= 0.6.0)
|
|
119
|
+
zeitwerk (2.4.2)
|
|
120
|
+
|
|
121
|
+
PLATFORMS
|
|
122
|
+
ruby
|
|
123
|
+
|
|
124
|
+
DEPENDENCIES
|
|
125
|
+
bundler
|
|
126
|
+
bundler-audit
|
|
127
|
+
git
|
|
128
|
+
pheme!
|
|
129
|
+
rake
|
|
130
|
+
rspec
|
|
131
|
+
rspec-collection_matchers
|
|
132
|
+
rspec-its
|
|
133
|
+
rspec_junit_formatter (~> 0.2)
|
|
134
|
+
simplecov
|
|
135
|
+
ws-style
|
|
136
|
+
|
|
137
|
+
BUNDLED WITH
|
|
138
|
+
2.2.21
|
data/README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
# pheme
|
|
1
|
+
# pheme
|
|
2
|
+
[](https://github.com/wealthsimple/pheme/actions)
|
|
3
|
+
|
|
4
|
+
[](https://github.com/wealthsimple/pheme/actions)
|
|
2
5
|
|
|
3
6
|
Ruby SNS publisher + SQS poller & message handler
|
|
4
7
|
|
|
@@ -39,3 +42,9 @@ end
|
|
|
39
42
|
See https://github.com/wealthsimple/pheme/tree/master/spec/support for example implementations of each class.
|
|
40
43
|
|
|
41
44
|
TODO: write better usage instructions.
|
|
45
|
+
|
|
46
|
+
### Handling SQS messages
|
|
47
|
+
|
|
48
|
+
Pheme expects that the SQS messages it is handling will have first been published to an SNS topic
|
|
49
|
+
before being sent to the SQS queue. This means if the service publishing messages is publishing them
|
|
50
|
+
**directly** to the SQS queue, that service must nest the message payload underneath a `Message` property.
|
data/lib/pheme/queue_poller.rb
CHANGED
|
@@ -58,20 +58,18 @@ module Pheme
|
|
|
58
58
|
queue_poller.poll(poller_configuration) do |queue_message|
|
|
59
59
|
@messages_received += 1
|
|
60
60
|
Pheme.logger.tagged(queue_message.message_id) do
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
|
|
74
|
-
end
|
|
61
|
+
content = parse_body(queue_message)
|
|
62
|
+
metadata = parse_metadata(queue_message)
|
|
63
|
+
message_attributes = parse_message_attributes(queue_message)
|
|
64
|
+
with_optional_connection_pool_block { handle(content, metadata, message_attributes) }
|
|
65
|
+
queue_poller.delete_message(queue_message)
|
|
66
|
+
log_delete(queue_message)
|
|
67
|
+
@messages_processed += 1
|
|
68
|
+
rescue SignalException
|
|
69
|
+
throw :stop_polling
|
|
70
|
+
rescue StandardError => e
|
|
71
|
+
Pheme.logger.error(e)
|
|
72
|
+
Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
|
|
75
73
|
end
|
|
76
74
|
end
|
|
77
75
|
log_polling_end(time_start)
|
|
@@ -151,14 +149,10 @@ module Pheme
|
|
|
151
149
|
|
|
152
150
|
def coerce_message_attribute(value)
|
|
153
151
|
case value['Type']
|
|
154
|
-
when 'String'
|
|
152
|
+
when 'Binary', 'String'
|
|
155
153
|
value['Value']
|
|
156
|
-
when 'Number'
|
|
154
|
+
when 'Number', 'String.Array'
|
|
157
155
|
JSON.parse(value['Value'])
|
|
158
|
-
when 'String.Array'
|
|
159
|
-
JSON.parse(value['Value'])
|
|
160
|
-
when 'Binary'
|
|
161
|
-
value['Value']
|
|
162
156
|
else
|
|
163
157
|
Pheme.logger.info("Unsupported custom data type")
|
|
164
158
|
value["Value"]
|
data/lib/pheme/version.rb
CHANGED
data/pheme.gemspec
CHANGED
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
|
20
20
|
s.require_paths = ["lib"]
|
|
21
21
|
s.license = "MIT"
|
|
22
22
|
|
|
23
|
-
s.required_ruby_version = '>= 2.
|
|
23
|
+
s.required_ruby_version = '>= 2.7.3'
|
|
24
24
|
|
|
25
25
|
s.add_dependency "activesupport", ">= 4"
|
|
26
26
|
s.add_dependency "aws-sdk-sns", "~> 1.1"
|
|
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
|
|
|
29
29
|
s.add_dependency "smarter_csv", "~> 1"
|
|
30
30
|
|
|
31
31
|
s.add_development_dependency 'bundler'
|
|
32
|
-
s.add_development_dependency 'coveralls', "~> 0.8"
|
|
33
32
|
s.add_development_dependency 'git'
|
|
34
33
|
s.add_development_dependency 'rake'
|
|
35
34
|
s.add_development_dependency 'rspec'
|
data/spec/queue_poller_spec.rb
CHANGED
|
@@ -418,7 +418,7 @@ describe Pheme::QueuePoller do
|
|
|
418
418
|
|
|
419
419
|
let(:queue_message) { OpenStruct.new(body: { 'Records' => records }.to_json) }
|
|
420
420
|
let(:records) do
|
|
421
|
-
[{ 'eventVersion' => '2.0',
|
|
421
|
+
[{ 'eventVersion' => '2.0', eventSource: 'aws:s3' }]
|
|
422
422
|
end
|
|
423
423
|
|
|
424
424
|
before do
|
data/spec/spec_helper.rb
CHANGED
data/spec/version_spec.rb
CHANGED
|
@@ -4,7 +4,7 @@ describe Pheme do
|
|
|
4
4
|
def get_version(git, branch = 'HEAD')
|
|
5
5
|
git.grep('VERSION = ', 'lib/*/version.rb', { object: branch }).
|
|
6
6
|
map { |_sha, matches| matches.first[1] }.
|
|
7
|
-
map(
|
|
7
|
+
map { |version_string| parse_version(version_string) }.
|
|
8
8
|
reject(&:nil?).
|
|
9
9
|
first
|
|
10
10
|
end
|
|
@@ -21,14 +21,15 @@ describe Pheme do
|
|
|
21
21
|
|
|
22
22
|
it 'has a bumped version' do
|
|
23
23
|
git = Git.open('.')
|
|
24
|
-
|
|
24
|
+
main_version = get_version(git, 'origin/main')
|
|
25
|
+
skip('first time publishing, no need to compare versions') if main_version.nil?
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
is_main_branch = git.current_branch == 'main'
|
|
28
|
+
skip('already on main branch, no need to compare versions') if is_main_branch
|
|
28
29
|
|
|
30
|
+
head_version = get_version(git, 'HEAD')
|
|
29
31
|
raise 'no version.rb file found on the current branch' if head_version.nil?
|
|
30
|
-
raise 'no version.rb file found on the master branch' if master_version.nil?
|
|
31
32
|
|
|
32
|
-
expect(Gem::Version.new(head_version)).to be > Gem::Version.new(
|
|
33
|
+
expect(Gem::Version.new(head_version)).to be > Gem::Version.new(main_version)
|
|
33
34
|
end
|
|
34
35
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pheme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Graham
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -94,20 +94,6 @@ dependencies:
|
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: coveralls
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - "~>"
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0.8'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - "~>"
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0.8'
|
|
111
97
|
- !ruby/object:Gem::Dependency
|
|
112
98
|
name: git
|
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -227,9 +213,9 @@ executables: []
|
|
|
227
213
|
extensions: []
|
|
228
214
|
extra_rdoc_files: []
|
|
229
215
|
files:
|
|
230
|
-
- ".circleci/config.yml"
|
|
231
216
|
- ".github/CODEOWNERS"
|
|
232
217
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
218
|
+
- ".github/workflows/main.yml"
|
|
233
219
|
- ".gitignore"
|
|
234
220
|
- ".rspec"
|
|
235
221
|
- ".rubocop.yml"
|
|
@@ -237,6 +223,7 @@ files:
|
|
|
237
223
|
- ".ruby-version"
|
|
238
224
|
- CHANGELOG.md
|
|
239
225
|
- Gemfile
|
|
226
|
+
- Gemfile.lock
|
|
240
227
|
- LICENSE
|
|
241
228
|
- README.md
|
|
242
229
|
- Rakefile
|
|
@@ -283,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
283
270
|
requirements:
|
|
284
271
|
- - ">="
|
|
285
272
|
- !ruby/object:Gem::Version
|
|
286
|
-
version:
|
|
273
|
+
version: 2.7.3
|
|
287
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
275
|
requirements:
|
|
289
276
|
- - ">="
|
|
290
277
|
- !ruby/object:Gem::Version
|
|
291
278
|
version: '0'
|
|
292
279
|
requirements: []
|
|
293
|
-
rubygems_version: 3.
|
|
280
|
+
rubygems_version: 3.1.6
|
|
294
281
|
signing_key:
|
|
295
282
|
specification_version: 4
|
|
296
283
|
summary: Ruby SNS publisher + SQS poller & message handler
|
data/.circleci/config.yml
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
|
|
3
|
-
references:
|
|
4
|
-
defaults:
|
|
5
|
-
2_4_10: &defaults_2_4_10
|
|
6
|
-
working_directory: ~/wealthsimple
|
|
7
|
-
docker:
|
|
8
|
-
- image: circleci/ruby:2.4.10
|
|
9
|
-
environment:
|
|
10
|
-
RAILS_ENV: test
|
|
11
|
-
|
|
12
|
-
2_5_8: &defaults
|
|
13
|
-
working_directory: ~/wealthsimple
|
|
14
|
-
docker:
|
|
15
|
-
- image: circleci/ruby:2.5.8
|
|
16
|
-
environment:
|
|
17
|
-
RAILS_ENV: test
|
|
18
|
-
|
|
19
|
-
which_bundler: &which_bundler
|
|
20
|
-
run:
|
|
21
|
-
name: Which bundler?
|
|
22
|
-
command: bundle -v
|
|
23
|
-
|
|
24
|
-
bundle_install: &bundle_install
|
|
25
|
-
run:
|
|
26
|
-
name: Bundle Install
|
|
27
|
-
command: bundle install --jobs=4 --retry=3 --path vendor/bundle
|
|
28
|
-
|
|
29
|
-
attach_code_workspace: &attach_code_workspace
|
|
30
|
-
attach_workspace:
|
|
31
|
-
at: ~/wealthsimple
|
|
32
|
-
|
|
33
|
-
restore_bundle_dependencies: &restore_bundle_dependencies
|
|
34
|
-
run:
|
|
35
|
-
name: Restore bundle dependencies from workspace
|
|
36
|
-
command: bundle --path vendor/bundle
|
|
37
|
-
|
|
38
|
-
run_rspec: &run_rspec
|
|
39
|
-
run:
|
|
40
|
-
name: Run rspec
|
|
41
|
-
command: |
|
|
42
|
-
bundle exec rspec \
|
|
43
|
-
--require spec_helper \
|
|
44
|
-
--format RspecJunitFormatter \
|
|
45
|
-
--out test_results/rspec.xml \
|
|
46
|
-
--format documentation
|
|
47
|
-
|
|
48
|
-
jobs:
|
|
49
|
-
checkout_and_bundle_2_4_10:
|
|
50
|
-
<<: *defaults_2_4_10
|
|
51
|
-
environment:
|
|
52
|
-
COVERALLS_REPO_TOKEN: ''
|
|
53
|
-
steps:
|
|
54
|
-
- checkout
|
|
55
|
-
- *which_bundler
|
|
56
|
-
- *bundle_install
|
|
57
|
-
- *run_rspec
|
|
58
|
-
- store_test_results:
|
|
59
|
-
path: test_results
|
|
60
|
-
|
|
61
|
-
checkout_and_bundle:
|
|
62
|
-
<<: *defaults
|
|
63
|
-
steps:
|
|
64
|
-
- checkout
|
|
65
|
-
- *which_bundler
|
|
66
|
-
- *bundle_install
|
|
67
|
-
- persist_to_workspace:
|
|
68
|
-
root: .
|
|
69
|
-
paths: .
|
|
70
|
-
|
|
71
|
-
rspec:
|
|
72
|
-
<<: *defaults
|
|
73
|
-
steps:
|
|
74
|
-
- *attach_code_workspace
|
|
75
|
-
- *restore_bundle_dependencies
|
|
76
|
-
- *run_rspec
|
|
77
|
-
- store_test_results:
|
|
78
|
-
path: test_results
|
|
79
|
-
|
|
80
|
-
lint_check:
|
|
81
|
-
<<: *defaults
|
|
82
|
-
steps:
|
|
83
|
-
- *attach_code_workspace
|
|
84
|
-
- *restore_bundle_dependencies
|
|
85
|
-
- run: bundle exec rubocop
|
|
86
|
-
|
|
87
|
-
vulnerability_check:
|
|
88
|
-
<<: *defaults
|
|
89
|
-
steps:
|
|
90
|
-
- *attach_code_workspace
|
|
91
|
-
- *restore_bundle_dependencies
|
|
92
|
-
- run: bundle exec bundle-audit update && bundle exec bundle-audit check
|
|
93
|
-
|
|
94
|
-
release:
|
|
95
|
-
<<: *defaults
|
|
96
|
-
steps:
|
|
97
|
-
- checkout
|
|
98
|
-
- *attach_code_workspace
|
|
99
|
-
- *restore_bundle_dependencies
|
|
100
|
-
- run:
|
|
101
|
-
name: Release to rubygems.org
|
|
102
|
-
command: |
|
|
103
|
-
mkdir ~/.gem
|
|
104
|
-
echo ":rubygems_api_key: ${RUBYGEMS_API_KEY}" >> ~/.gem/credentials
|
|
105
|
-
chmod 600 ~/.gem/credentials
|
|
106
|
-
bundle exec rake release
|
|
107
|
-
|
|
108
|
-
workflows:
|
|
109
|
-
version: 2
|
|
110
|
-
build:
|
|
111
|
-
jobs:
|
|
112
|
-
- checkout_and_bundle_2_4_10:
|
|
113
|
-
context: wealthsimple
|
|
114
|
-
- checkout_and_bundle:
|
|
115
|
-
context: wealthsimple
|
|
116
|
-
- rspec:
|
|
117
|
-
context: wealthsimple
|
|
118
|
-
requires:
|
|
119
|
-
- checkout_and_bundle
|
|
120
|
-
- lint_check:
|
|
121
|
-
context: wealthsimple
|
|
122
|
-
requires:
|
|
123
|
-
- checkout_and_bundle
|
|
124
|
-
- vulnerability_check:
|
|
125
|
-
context: wealthsimple
|
|
126
|
-
requires:
|
|
127
|
-
- checkout_and_bundle
|
|
128
|
-
- release:
|
|
129
|
-
context: wealthsimple
|
|
130
|
-
filters:
|
|
131
|
-
branches:
|
|
132
|
-
only: master
|
|
133
|
-
requires:
|
|
134
|
-
- checkout_and_bundle_2_4_10
|
|
135
|
-
- rspec
|
|
136
|
-
- lint_check
|
|
137
|
-
- vulnerability_check
|
|
138
|
-
|
|
139
|
-
security-audit:
|
|
140
|
-
triggers:
|
|
141
|
-
- schedule:
|
|
142
|
-
# 11:05 am UTC: 6:05 am EST / 7:05 am EDT
|
|
143
|
-
cron: "5 11 * * *"
|
|
144
|
-
filters:
|
|
145
|
-
branches:
|
|
146
|
-
only: master
|
|
147
|
-
jobs:
|
|
148
|
-
- checkout_and_bundle:
|
|
149
|
-
context: wealthsimple
|
|
150
|
-
- vulnerability_check:
|
|
151
|
-
context: wealthsimple
|
|
152
|
-
requires:
|
|
153
|
-
- checkout_and_bundle
|