continuous_integration 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/continuous_integration +2 -2
- data/lib/continuous_integration/server.rb +70 -0
- data/lib/continuous_integration/version.rb +1 -1
- data/lib/continuous_integration.rb +1 -66
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f11c4097237e0a2ed6734e5e2daf9053399a0d47
|
4
|
+
data.tar.gz: 824066de3782d99661b2be0d6fc96d1ce83c150a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b55a3b56eea9beb31ce003cdc9459e49b2c1b419b169c428ff1811208639fef775c511af632eb0018f6a18377ccf2cc571f5ddd2dfc672570b99d8bcabc4f54
|
7
|
+
data.tar.gz: 1ba831e78fb060e7364dff042ad72b827cb28099d3ac5dd8f7ef8083c8c6ec691e81a2952517cabc10e88f912abc17d6495f691712dac068821ae74cad8c39e3
|
data/bin/continuous_integration
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'webrick'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
require_relative 'constants'
|
7
|
+
require_relative 'tasks'
|
8
|
+
require_relative 'version'
|
9
|
+
|
10
|
+
# Module to perform CI operations!
|
11
|
+
module ContinuousIntegration
|
12
|
+
# class to perform the server operations
|
13
|
+
class Server
|
14
|
+
# Perform Continuous Integration operations!
|
15
|
+
#
|
16
|
+
# Example:
|
17
|
+
# >> server = ContinuousIntegration.setup_server
|
18
|
+
# >> ContinuousIntegration.start_server server
|
19
|
+
# => INFO WEBrick x.x.x
|
20
|
+
#
|
21
|
+
# Arguments:
|
22
|
+
# server: (Object)
|
23
|
+
|
24
|
+
# setup the CI server config
|
25
|
+
def self.setup_server
|
26
|
+
# path for the web server to serve the test results
|
27
|
+
root = File.expand_path "#{API_SPECS_PATH}/logs"
|
28
|
+
|
29
|
+
# create the server
|
30
|
+
server = create_server root
|
31
|
+
|
32
|
+
# mount the dir
|
33
|
+
dir_mount server
|
34
|
+
|
35
|
+
# shut server down on any interrupt
|
36
|
+
trap('INT') do
|
37
|
+
shutdown_server server
|
38
|
+
end
|
39
|
+
|
40
|
+
server
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.start_server(server)
|
44
|
+
server.start
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.shutdown_server(server)
|
48
|
+
dir_unmount server
|
49
|
+
server.shutdown
|
50
|
+
end
|
51
|
+
|
52
|
+
private_class_method
|
53
|
+
|
54
|
+
def self.create_server(root)
|
55
|
+
WEBrick::HTTPServer.new(
|
56
|
+
Port: PORT_NUM,
|
57
|
+
DocumentRoot: root,
|
58
|
+
DirectoryIndex: []
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.dir_mount(server)
|
63
|
+
server.mount SUB_URI, DockerEndpoint
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.dir_unmount(server)
|
67
|
+
server.unmount SUB_URI
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -1,68 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'json'
|
5
|
-
include WEBrick
|
6
|
-
|
7
|
-
require 'continuous_integration/constants'
|
8
|
-
require 'continuous_integration/tasks'
|
9
|
-
require 'continuous_integration/version'
|
10
|
-
|
11
|
-
# Module to perform CI operations!
|
12
|
-
module ContinuousIntegration
|
13
|
-
# Perform Continuous Integration operations!
|
14
|
-
#
|
15
|
-
# Example:
|
16
|
-
# >> server = ContinuousIntegration.setup_server
|
17
|
-
# >> ContinuousIntegration.start_server server
|
18
|
-
# => INFO WEBrick x.x.x
|
19
|
-
#
|
20
|
-
# Arguments:
|
21
|
-
# server: (Object)
|
22
|
-
|
23
|
-
# setup the CI server config
|
24
|
-
def self.setup_server
|
25
|
-
# path for the web server to serve the test results
|
26
|
-
root = File.expand_path "#{API_SPECS_PATH}/logs"
|
27
|
-
|
28
|
-
# create the server
|
29
|
-
server = create_server root
|
30
|
-
|
31
|
-
# mount the dir
|
32
|
-
dir_mount server
|
33
|
-
|
34
|
-
# shut server down on any interrupt
|
35
|
-
trap('INT') do
|
36
|
-
shutdown_server server
|
37
|
-
end
|
38
|
-
|
39
|
-
server
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.start_server(server)
|
43
|
-
server.start
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.shutdown_server(server)
|
47
|
-
dir_unmount server
|
48
|
-
server.shutdown
|
49
|
-
end
|
50
|
-
|
51
|
-
private_class_method
|
52
|
-
|
53
|
-
def self.create_server(root)
|
54
|
-
WEBrick::HTTPServer.new(
|
55
|
-
Port: PORT_NUM,
|
56
|
-
DocumentRoot: root,
|
57
|
-
DirectoryIndex: []
|
58
|
-
)
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.dir_mount(server)
|
62
|
-
server.mount SUB_URI, DockerEndpoint
|
63
|
-
end
|
64
|
-
|
65
|
-
def self.dir_unmount(server)
|
66
|
-
server.unmount SUB_URI
|
67
|
-
end
|
68
|
-
end
|
3
|
+
require_relative 'continuous_integration/server'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: continuous_integration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ragavendra Nagraj
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- doc/contributing/ISSUES.md
|
58
58
|
- lib/continuous_integration.rb
|
59
59
|
- lib/continuous_integration/constants.rb
|
60
|
+
- lib/continuous_integration/server.rb
|
60
61
|
- lib/continuous_integration/tasks.rb
|
61
62
|
- lib/continuous_integration/version.rb
|
62
63
|
homepage: https://rubygems.org/gems/continuous_integration
|