quiz_api_client 2.9.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.dockerignore +3 -0
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +6 -5
- data/Dockerfile +4 -13
- data/Jenkinsfile +71 -0
- data/Rakefile +1 -1
- data/bin/contracts-generate +2 -2
- data/docker-compose.dev.override.yml +7 -15
- data/docker-compose.yml +2 -7
- data/lib/quiz_api_client/http_client.rb +3 -0
- data/lib/quiz_api_client/services/item_analyses_service.rb +2 -0
- data/lib/quiz_api_client/services/items_service.rb +1 -0
- data/lib/quiz_api_client/services/qti_imports_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_analyses_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_clone_job_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_entries_service.rb +3 -0
- data/lib/quiz_api_client/services/quiz_session_events_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_session_result_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_session_service.rb +1 -0
- data/lib/quiz_api_client/services/quiz_sessions_service.rb +2 -0
- data/lib/quiz_api_client/services/session_item_results_service.rb +1 -0
- data/lib/quiz_api_client/services/session_items_service.rb +1 -0
- data/lib/quiz_api_client/services/shared_banks.rb +3 -0
- data/lib/quiz_api_client/version.rb +1 -1
- data/quiz_api_client.gemspec +10 -10
- metadata +23 -30
- data/Dockerfile.contracts +0 -19
- data/build.sh +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0002646bbd669ca217b0ccaf7efb17c3c4cfd71c
|
4
|
+
data.tar.gz: 89fd9e51d2c4ef12392f8d8d6e726365133d20ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9046f4bd68c290d8131afcb57b9410812b3283d9a18190b59772c8cbf46a2da16ff0b6d66687a76df5321c832c1a9e6de495687a72852ba0c329f81dd115b9c
|
7
|
+
data.tar.gz: 93ffc9705ec2df78a76bbce0e66aebb3c1e1f2f28e662cf8de2839296ce2e81388a90a7863746cbc4b48ca587fb9d606ee9f79b65e650513026d9c011d3ff070
|
data/.dockerignore
CHANGED
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.4
|
3
3
|
|
4
4
|
Metrics/ClassLength:
|
5
5
|
Max: 200 # Default: 100
|
@@ -16,6 +16,9 @@ Metrics/BlockLength:
|
|
16
16
|
- quiz_api_client.gemspec
|
17
17
|
- spec/**/*.rb
|
18
18
|
|
19
|
+
Naming/MemoizedInstanceVariableName:
|
20
|
+
EnforcedStyleForLeadingUnderscores: required
|
21
|
+
|
19
22
|
Layout/AlignParameters:
|
20
23
|
# Alignment of parameters in multi-line method calls.
|
21
24
|
#
|
@@ -29,7 +32,7 @@ Layout/AlignParameters:
|
|
29
32
|
Layout/CaseIndentation:
|
30
33
|
EnforcedStyle: end
|
31
34
|
|
32
|
-
|
35
|
+
Layout/EndAlignment:
|
33
36
|
EnforcedStyleAlignWith: variable
|
34
37
|
|
35
38
|
Style/ClassAndModuleChildren:
|
@@ -59,13 +62,11 @@ Style/Documentation:
|
|
59
62
|
Enabled: false
|
60
63
|
|
61
64
|
Style/FrozenStringLiteralComment:
|
62
|
-
# `when_needed` will add the frozen string literal comment to files
|
63
|
-
# only when the `TargetRubyVersion` is set to 2.3+.
|
64
65
|
# `always` will always add the frozen string literal comment to a file
|
65
66
|
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
66
67
|
# string literal. If you run code against multiple versions of Ruby, it is
|
67
68
|
# possible that this will create errors in Ruby 2.3.0+.
|
68
69
|
#
|
69
70
|
# See: https://wyeworks.com/blog/2015/12/1/immutable-strings-in-ruby-2-dot-3
|
70
|
-
EnforcedStyle:
|
71
|
+
EnforcedStyle: always
|
71
72
|
Enabled: false
|
data/Dockerfile
CHANGED
@@ -1,20 +1,11 @@
|
|
1
1
|
FROM instructure/rvm
|
2
2
|
|
3
|
-
|
3
|
+
RUN mkdir -p coverage log pacts
|
4
4
|
|
5
|
-
COPY quiz_api_client.gemspec Gemfile
|
6
|
-
COPY lib/quiz_api_client/version.rb
|
7
|
-
|
8
|
-
USER root
|
9
|
-
RUN chown -R docker:docker /app
|
10
|
-
|
11
|
-
USER docker
|
5
|
+
COPY --chown=docker:docker quiz_api_client.gemspec Gemfile ./
|
6
|
+
COPY --chown=docker:docker lib/quiz_api_client/version.rb lib/quiz_api_client/version.rb
|
12
7
|
RUN /bin/bash -l -c "rvm-exec 2.4 bundle install --jobs 5"
|
13
|
-
COPY . /app
|
14
|
-
RUN rm -f Gemfile.lock
|
15
8
|
|
16
|
-
|
17
|
-
RUN chown -R docker:docker /app
|
18
|
-
USER docker
|
9
|
+
COPY --chown=docker:docker . .
|
19
10
|
|
20
11
|
CMD /bin/bash -l -c "rvm-exec 2.4 bundle exec rspec"
|
data/Jenkinsfile
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
pipeline {
|
2
|
+
agent {
|
3
|
+
label 'docker'
|
4
|
+
}
|
5
|
+
stages {
|
6
|
+
stage('Build') {
|
7
|
+
steps {
|
8
|
+
sh 'docker-compose build --pull'
|
9
|
+
}
|
10
|
+
}
|
11
|
+
stage('Lint') {
|
12
|
+
steps {
|
13
|
+
sh '''
|
14
|
+
docker-compose run --rm app /bin/bash -lc \
|
15
|
+
"rvm-exec 2.4 bundle exec rubocop --fail-level autocorrect"
|
16
|
+
'''
|
17
|
+
}
|
18
|
+
}
|
19
|
+
stage('Test') {
|
20
|
+
steps {
|
21
|
+
sh 'docker-compose run --name coverage app'
|
22
|
+
sh 'docker-compose run app /bin/bash -l -c "rvm-exec 2.4 bundle exec rspec -t pact"'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
stage ('Publish') {
|
26
|
+
when { environment name: "GERRIT_EVENT_TYPE", value: "change-merged"}
|
27
|
+
environment {
|
28
|
+
PACT_BROKER_PASSWORD = credentials('pact_broker_password')
|
29
|
+
JENKINS_URL = "${env.JENKINS_URL}"
|
30
|
+
PACT_CONSUMER_TAG = 'master'
|
31
|
+
PACT_BROKER_USERNAME = 'quizzes'
|
32
|
+
PACT_BROKER_HOST = 'inst-pact-broker.inseng.net'
|
33
|
+
}
|
34
|
+
steps {
|
35
|
+
script {
|
36
|
+
sh '''
|
37
|
+
sha="$(git rev-parse --short HEAD)"
|
38
|
+
|
39
|
+
docker-compose run --rm \
|
40
|
+
-e JENKINS_URL="${JENKINS_URL}" \
|
41
|
+
-e PACT_BROKER_HOST="${PACT_BROKER_HOST}" \
|
42
|
+
-e PACT_BROKER_USERNAME="${PACT_BROKER_USERNAME}" \
|
43
|
+
-e PACT_BROKER_PASSWORD="${PACT_BROKER_PASSWORD}" \
|
44
|
+
-e PACT_CONSUMER_TAG="${PACT_CONSUMER_TAG}" \
|
45
|
+
-e SHA="${sha}" \
|
46
|
+
app /bin/bash -l -c "rvm-exec 2.4 bundle exec rake broker:pact:publish:jenkins_post_merge"
|
47
|
+
'''
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
post {
|
54
|
+
success {
|
55
|
+
sh 'docker cp coverage:/usr/src/app/coverage .'
|
56
|
+
publishHTML target: [
|
57
|
+
allowMissing: false,
|
58
|
+
alwaysLinkToLastBuild: false,
|
59
|
+
keepAll: true,
|
60
|
+
reportDir: "coverage",
|
61
|
+
reportFiles: 'index.html',
|
62
|
+
reportName: 'Coverage Report'
|
63
|
+
]
|
64
|
+
}
|
65
|
+
cleanup { // Always runs after all other post conditions=
|
66
|
+
sh 'docker-compose kill'
|
67
|
+
sh 'docker-compose rm -f'
|
68
|
+
sh 'docker images -qf "dangling=true" | xargs docker rmi -f &>/dev/null'
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
data/Rakefile
CHANGED
data/bin/contracts-generate
CHANGED
@@ -14,7 +14,7 @@ function print_results() {
|
|
14
14
|
docker cp contracts:/usr/src/app/pacts . &> /dev/null
|
15
15
|
docker rm -f contracts &> /dev/null
|
16
16
|
|
17
|
-
docker-compose rm -fv
|
17
|
+
docker-compose rm -fv app &> /dev/null
|
18
18
|
}
|
19
19
|
trap print_results INT TERM EXIT
|
20
20
|
set -e
|
@@ -23,5 +23,5 @@ rm -rf pacts
|
|
23
23
|
sha="$(git rev-parse --short HEAD)"
|
24
24
|
|
25
25
|
|
26
|
-
docker-compose run --name contracts -e SHA="${sha}"
|
26
|
+
docker-compose run --name contracts -e SHA="${sha}" app bash -c \
|
27
27
|
"bundle && bundle exec rspec spec/contracts && bundle exec rake broker:pact:publish:local"
|
@@ -1,19 +1,11 @@
|
|
1
|
-
version: '
|
1
|
+
version: '3.5'
|
2
2
|
|
3
3
|
services:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#external_links: # linux
|
11
|
-
# - dory_dinghy_http_proxy:pact-broker.docker # linux
|
4
|
+
app:
|
5
|
+
# This port doesn't exist, but doing this tricks Dory proxy into hooking up
|
6
|
+
# the container so it can actually talk to the Pact Broker.
|
7
|
+
expose: [8080]
|
8
|
+
external_links:
|
9
|
+
- ${PROXY_CONTAINER:-dinghy_http_proxy}:pact-broker.docker
|
12
10
|
volumes:
|
13
11
|
- .:/usr/src/app
|
14
|
-
#- api-logs:/usr/src/app/log # linux:fs
|
15
|
-
- bundler-config:/home/docker/.rvm/gems/ruby-2.4.0
|
16
|
-
|
17
|
-
volumes:
|
18
|
-
bundler-config: {}
|
19
|
-
api-logs: {}
|
data/docker-compose.yml
CHANGED
@@ -23,6 +23,7 @@ module QuizApiClient
|
|
23
23
|
|
24
24
|
def get(path, all: false, query: {})
|
25
25
|
return make_request :get, url_for(path), query: query unless all
|
26
|
+
|
26
27
|
make_paginated_request :get, url_for(path), query: query
|
27
28
|
end
|
28
29
|
|
@@ -91,6 +92,7 @@ module QuizApiClient
|
|
91
92
|
until request_url.nil?
|
92
93
|
resp = make_request(method, request_url, request_options)
|
93
94
|
raise RequestFailed, "#{url} responded #{resp.body} (#{resp.code})" unless resp.code == 200
|
95
|
+
|
94
96
|
entities.concat(resp.parsed_response)
|
95
97
|
request_url, request_options = next_page(resp, url, options)
|
96
98
|
end
|
@@ -119,6 +121,7 @@ module QuizApiClient
|
|
119
121
|
|
120
122
|
def next_page_link(response, options)
|
121
123
|
return if response.headers['link'].blank?
|
124
|
+
|
122
125
|
links = LinkHeader.parse(response.headers['link']).links
|
123
126
|
next_link = links.find { |link| link['rel'] == 'next' }
|
124
127
|
[next_link.href, options] if next_link
|
@@ -2,6 +2,7 @@ module QuizApiClient::Services
|
|
2
2
|
class ItemAnalysesService < BaseApiService
|
3
3
|
def list(params:, token: nil, all: false)
|
4
4
|
raise 'Quiz Id Required' unless params.key?(:quiz_id)
|
5
|
+
|
5
6
|
client(token: token).get(
|
6
7
|
"/api/quizzes/#{params[:quiz_id]}/stats/item_analyses",
|
7
8
|
all: all
|
@@ -10,6 +11,7 @@ module QuizApiClient::Services
|
|
10
11
|
|
11
12
|
def get(params:, token: nil)
|
12
13
|
raise 'Quiz Id and Item Id are Required' unless params.key?(:id) && params.key?(:quiz_id)
|
14
|
+
|
13
15
|
client(token: token).get(
|
14
16
|
"/api/quizzes/#{params[:quiz_id]}/stats/item_analyses/#{params[:id]}"
|
15
17
|
)
|
@@ -2,17 +2,20 @@ module QuizApiClient::Services
|
|
2
2
|
class QuizEntriesService < BaseApiService
|
3
3
|
def create(params:, token: nil)
|
4
4
|
raise 'Quiz Id Required' unless params && params[:id]
|
5
|
+
|
5
6
|
post_to_quiz_api(params: params, token: token)
|
6
7
|
end
|
7
8
|
|
8
9
|
def list(params:, token: nil, all: false)
|
9
10
|
raise 'Quiz Id Required' unless params && params[:id]
|
11
|
+
|
10
12
|
get_from_quiz_api(params: params, token: token, all: all)
|
11
13
|
end
|
12
14
|
|
13
15
|
def destroy(params:, token: nil)
|
14
16
|
raise 'Quiz Id Required' unless params && params[:quiz_id]
|
15
17
|
raise 'Item Id Required' unless params && params[:id]
|
18
|
+
|
16
19
|
delete_from_quiz_api(params, token)
|
17
20
|
end
|
18
21
|
|
@@ -3,6 +3,7 @@ module QuizApiClient::Services
|
|
3
3
|
def list(params:, token: nil)
|
4
4
|
raise 'Quiz Id Required' unless params && params[:quiz_id]
|
5
5
|
raise 'Quiz Session Ids Required' unless params && params[:ids]
|
6
|
+
|
6
7
|
client(token: token).get(
|
7
8
|
"/api/quizzes/#{params[:quiz_id]}/quiz_sessions",
|
8
9
|
query: params[:ids].to_query('ids')
|
@@ -11,6 +12,7 @@ module QuizApiClient::Services
|
|
11
12
|
|
12
13
|
def create(params:, token: nil)
|
13
14
|
raise 'Quiz Id Required' unless params && params[:quiz_id]
|
15
|
+
|
14
16
|
post_to_quiz_api(params: params, token: token)
|
15
17
|
end
|
16
18
|
|
@@ -3,6 +3,7 @@ module QuizApiClient::Services
|
|
3
3
|
def list(params:, token: nil, all: false)
|
4
4
|
raise 'QuizSession Id Required' unless params && params[:quiz_session_id]
|
5
5
|
raise 'QuizSessionResult Id Required' unless params && params[:quiz_session_result_id]
|
6
|
+
|
6
7
|
get_from_quiz_api(params: params, token: token, all: all)
|
7
8
|
end
|
8
9
|
|
@@ -2,6 +2,7 @@ module QuizApiClient::Services
|
|
2
2
|
class SharedBanks < BaseApiService
|
3
3
|
def list(params:, token: nil, all: false)
|
4
4
|
raise 'Bank Id Required' unless params && params[:bank_id]
|
5
|
+
|
5
6
|
client(token: token).get(
|
6
7
|
"/api/banks/#{params[:bank_id]}/shared_banks",
|
7
8
|
all: all
|
@@ -10,6 +11,7 @@ module QuizApiClient::Services
|
|
10
11
|
|
11
12
|
def create(params:, token: nil)
|
12
13
|
raise 'Bank Id Required' unless params && params[:bank_id]
|
14
|
+
|
13
15
|
client(token: token).post(
|
14
16
|
"/api/banks/#{params[:bank_id]}/shared_banks",
|
15
17
|
params
|
@@ -19,6 +21,7 @@ module QuizApiClient::Services
|
|
19
21
|
def update(params:, token: nil)
|
20
22
|
raise 'Bank Id Required' unless params && params[:bank_id]
|
21
23
|
raise 'Shared Bank Id Required' unless params && params[:shared_bank_id]
|
24
|
+
|
22
25
|
shared_bank_id = params.delete(:shared_bank_id)
|
23
26
|
client(token: token).put(
|
24
27
|
"/api/banks/#{params[:bank_id]}/shared_banks/#{shared_bank_id}",
|
data/quiz_api_client.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'quiz_api_client/version'
|
4
4
|
|
@@ -40,18 +40,18 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
41
41
|
spec.require_paths = ['lib']
|
42
42
|
|
43
|
-
spec.required_ruby_version = '>= 2.
|
43
|
+
spec.required_ruby_version = '>= 2.4'
|
44
44
|
|
45
|
-
spec.add_dependency 'httparty', '~> 0.
|
46
|
-
spec.add_dependency 'jwt', '
|
45
|
+
spec.add_dependency 'httparty', '~> 0.17'
|
46
|
+
spec.add_dependency 'jwt', '~> 2.2'
|
47
47
|
spec.add_dependency 'link_header', '~> 0.0'
|
48
48
|
|
49
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
50
|
-
spec.add_development_dependency 'pact', '~> 1.
|
51
|
-
spec.add_development_dependency 'pact_broker-client', '~> 1.
|
52
|
-
spec.add_development_dependency 'rake', '~> 12.
|
53
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
54
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
49
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
50
|
+
spec.add_development_dependency 'pact', '~> 1.41'
|
51
|
+
spec.add_development_dependency 'pact_broker-client', '~> 1.19'
|
52
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
53
|
+
spec.add_development_dependency 'rspec', '~> 3.8'
|
54
|
+
spec.add_development_dependency 'rubocop', '~> 0.74.0'
|
55
55
|
spec.add_development_dependency 'simplecov'
|
56
56
|
spec.add_development_dependency 'webmock'
|
57
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quiz_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wang
|
@@ -19,7 +19,7 @@ authors:
|
|
19
19
|
autorequire:
|
20
20
|
bindir: exe
|
21
21
|
cert_chain: []
|
22
|
-
date: 2019-
|
22
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: httparty
|
@@ -27,34 +27,28 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.
|
30
|
+
version: '0.17'
|
31
31
|
type: :runtime
|
32
32
|
prerelease: false
|
33
33
|
version_requirements: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
37
|
+
version: '0.17'
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: jwt
|
40
40
|
requirement: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- - "
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version: '1.5'
|
45
|
-
- - "<"
|
42
|
+
- - "~>"
|
46
43
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
44
|
+
version: '2.2'
|
48
45
|
type: :runtime
|
49
46
|
prerelease: false
|
50
47
|
version_requirements: !ruby/object:Gem::Requirement
|
51
48
|
requirements:
|
52
|
-
- - "
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.5'
|
55
|
-
- - "<"
|
49
|
+
- - "~>"
|
56
50
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
51
|
+
version: '2.2'
|
58
52
|
- !ruby/object:Gem::Dependency
|
59
53
|
name: link_header
|
60
54
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,84 +69,84 @@ dependencies:
|
|
75
69
|
requirements:
|
76
70
|
- - "~>"
|
77
71
|
- !ruby/object:Gem::Version
|
78
|
-
version: '1.
|
72
|
+
version: '1.17'
|
79
73
|
type: :development
|
80
74
|
prerelease: false
|
81
75
|
version_requirements: !ruby/object:Gem::Requirement
|
82
76
|
requirements:
|
83
77
|
- - "~>"
|
84
78
|
- !ruby/object:Gem::Version
|
85
|
-
version: '1.
|
79
|
+
version: '1.17'
|
86
80
|
- !ruby/object:Gem::Dependency
|
87
81
|
name: pact
|
88
82
|
requirement: !ruby/object:Gem::Requirement
|
89
83
|
requirements:
|
90
84
|
- - "~>"
|
91
85
|
- !ruby/object:Gem::Version
|
92
|
-
version: 1.
|
86
|
+
version: '1.41'
|
93
87
|
type: :development
|
94
88
|
prerelease: false
|
95
89
|
version_requirements: !ruby/object:Gem::Requirement
|
96
90
|
requirements:
|
97
91
|
- - "~>"
|
98
92
|
- !ruby/object:Gem::Version
|
99
|
-
version: 1.
|
93
|
+
version: '1.41'
|
100
94
|
- !ruby/object:Gem::Dependency
|
101
95
|
name: pact_broker-client
|
102
96
|
requirement: !ruby/object:Gem::Requirement
|
103
97
|
requirements:
|
104
98
|
- - "~>"
|
105
99
|
- !ruby/object:Gem::Version
|
106
|
-
version: 1.
|
100
|
+
version: '1.19'
|
107
101
|
type: :development
|
108
102
|
prerelease: false
|
109
103
|
version_requirements: !ruby/object:Gem::Requirement
|
110
104
|
requirements:
|
111
105
|
- - "~>"
|
112
106
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
107
|
+
version: '1.19'
|
114
108
|
- !ruby/object:Gem::Dependency
|
115
109
|
name: rake
|
116
110
|
requirement: !ruby/object:Gem::Requirement
|
117
111
|
requirements:
|
118
112
|
- - "~>"
|
119
113
|
- !ruby/object:Gem::Version
|
120
|
-
version: '12.
|
114
|
+
version: '12.3'
|
121
115
|
type: :development
|
122
116
|
prerelease: false
|
123
117
|
version_requirements: !ruby/object:Gem::Requirement
|
124
118
|
requirements:
|
125
119
|
- - "~>"
|
126
120
|
- !ruby/object:Gem::Version
|
127
|
-
version: '12.
|
121
|
+
version: '12.3'
|
128
122
|
- !ruby/object:Gem::Dependency
|
129
123
|
name: rspec
|
130
124
|
requirement: !ruby/object:Gem::Requirement
|
131
125
|
requirements:
|
132
126
|
- - "~>"
|
133
127
|
- !ruby/object:Gem::Version
|
134
|
-
version: '3.
|
128
|
+
version: '3.8'
|
135
129
|
type: :development
|
136
130
|
prerelease: false
|
137
131
|
version_requirements: !ruby/object:Gem::Requirement
|
138
132
|
requirements:
|
139
133
|
- - "~>"
|
140
134
|
- !ruby/object:Gem::Version
|
141
|
-
version: '3.
|
135
|
+
version: '3.8'
|
142
136
|
- !ruby/object:Gem::Dependency
|
143
137
|
name: rubocop
|
144
138
|
requirement: !ruby/object:Gem::Requirement
|
145
139
|
requirements:
|
146
140
|
- - "~>"
|
147
141
|
- !ruby/object:Gem::Version
|
148
|
-
version: 0.
|
142
|
+
version: 0.74.0
|
149
143
|
type: :development
|
150
144
|
prerelease: false
|
151
145
|
version_requirements: !ruby/object:Gem::Requirement
|
152
146
|
requirements:
|
153
147
|
- - "~>"
|
154
148
|
- !ruby/object:Gem::Version
|
155
|
-
version: 0.
|
149
|
+
version: 0.74.0
|
156
150
|
- !ruby/object:Gem::Dependency
|
157
151
|
name: simplecov
|
158
152
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,14 +199,13 @@ files:
|
|
205
199
|
- ".rspec"
|
206
200
|
- ".rubocop.yml"
|
207
201
|
- Dockerfile
|
208
|
-
- Dockerfile.contracts
|
209
202
|
- Gemfile
|
203
|
+
- Jenkinsfile
|
210
204
|
- README.md
|
211
205
|
- Rakefile
|
212
206
|
- bin/console
|
213
207
|
- bin/contracts-generate
|
214
208
|
- bin/setup
|
215
|
-
- build.sh
|
216
209
|
- docker-compose.dev.override.yml
|
217
210
|
- docker-compose.yml
|
218
211
|
- lib/quiz_api_client.rb
|
@@ -250,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
243
|
requirements:
|
251
244
|
- - ">="
|
252
245
|
- !ruby/object:Gem::Version
|
253
|
-
version: '2.
|
246
|
+
version: '2.4'
|
254
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
248
|
requirements:
|
256
249
|
- - ">="
|
@@ -258,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
251
|
version: '0'
|
259
252
|
requirements: []
|
260
253
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
254
|
+
rubygems_version: 2.6.14.4
|
262
255
|
signing_key:
|
263
256
|
specification_version: 4
|
264
257
|
summary: Ruby client for quiz_api
|
data/Dockerfile.contracts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
FROM instructure/ruby:2.3
|
2
|
-
|
3
|
-
USER root
|
4
|
-
|
5
|
-
ENV APP_HOME /usr/src/app
|
6
|
-
RUN mkdir -p $APP_HOME/log
|
7
|
-
RUN mkdir -p $APP_HOME/pacts
|
8
|
-
|
9
|
-
COPY quiz_api_client.gemspec Gemfile $APP_HOME/
|
10
|
-
COPY lib/quiz_api_client/version.rb $APP_HOME/lib/quiz_api_client/version.rb
|
11
|
-
|
12
|
-
USER docker
|
13
|
-
RUN bundle install --quiet --jobs 8
|
14
|
-
|
15
|
-
USER root
|
16
|
-
COPY . $APP_HOME
|
17
|
-
RUN chown -R docker:docker $APP_HOME
|
18
|
-
|
19
|
-
USER docker
|
data/build.sh
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -ex
|
4
|
-
|
5
|
-
function publish_pact_file_to_pact_broker()
|
6
|
-
{
|
7
|
-
echo "Publishing pact file to Pact Broker..."
|
8
|
-
|
9
|
-
sha="$(git rev-parse --short HEAD)"
|
10
|
-
|
11
|
-
docker-compose run --rm \
|
12
|
-
-e JENKINS_URL="${JENKINS_URL}" \
|
13
|
-
-e PACT_BROKER_HOST="${PACT_BROKER_HOST}" \
|
14
|
-
-e PACT_BROKER_USERNAME="${PACT_BROKER_USERNAME}" \
|
15
|
-
-e PACT_BROKER_PASSWORD="${PACT_BROKER_PASSWORD}" \
|
16
|
-
-e PACT_CONSUMER_TAG="${PACT_CONSUMER_TAG}" \
|
17
|
-
-e SHA="${sha}" \
|
18
|
-
contracts-testrunner bundle exec rake broker:pact:publish:jenkins_post_merge
|
19
|
-
}
|
20
|
-
|
21
|
-
function cleanup() {
|
22
|
-
exit_code=$?
|
23
|
-
set +e
|
24
|
-
docker cp coverage:/app/coverage .
|
25
|
-
docker-compose kill
|
26
|
-
docker-compose rm -f
|
27
|
-
exit $exit_code
|
28
|
-
}
|
29
|
-
trap cleanup INT TERM EXIT
|
30
|
-
|
31
|
-
docker-compose build --pull
|
32
|
-
|
33
|
-
echo "Running Rubocop..."
|
34
|
-
docker-compose run --rm testrunner /bin/bash -lc \
|
35
|
-
"rvm-exec 2.4 bundle exec rubocop --fail-level autocorrect"
|
36
|
-
|
37
|
-
echo "Running test suite..."
|
38
|
-
docker-compose run --name coverage testrunner $@
|
39
|
-
|
40
|
-
echo
|
41
|
-
echo "Running contract tests..."
|
42
|
-
docker-compose run --name contracts -T contracts-testrunner bundle exec rspec spec/contracts
|
43
|
-
docker cp contracts:/usr/src/app/pacts .
|
44
|
-
docker cp contracts:/usr/src/app/log .
|
45
|
-
echo
|
46
|
-
|
47
|
-
if [[ "${GERRIT_EVENT_TYPE}" == "change-merged" ]]; then
|
48
|
-
publish_pact_file_to_pact_broker
|
49
|
-
fi
|