continuous_integration 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -21
- data/bin/continuous_integration +2 -2
- data/doc/CODE_OF_CONDUCT.md +0 -0
- data/doc/TROUBLESHOOTING.md +0 -0
- data/doc/contributing/ISSUES.md +0 -0
- data/lib/continuous_integration.rb +15 -7
- data/lib/continuous_integration/version.rb +1 -1
- data/test/test_continuous_integration.rb +40 -8
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f75d10fd59e010dda9a142a74190ee0c5f26c7f6
|
4
|
+
data.tar.gz: b87b23690db9f76e9cf8542feb65480310e4e4ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe3ca1c56ef73bc6b8c0714f1531d52ffbf936a48ccd6409df38b88a4ddef970958549786a2669a55677172d80bdd049ca9c957eff491669edf4a6608ef7e6c
|
7
|
+
data.tar.gz: 7f52043f6193d397ed84fb9a6520ebd4d5b2bc5ff17d03a5afe75349340727ee991b15b9616735d32a00119c6c6fcd32a4117c47cc4da36805952bc0571bbeb9
|
data/README.md
CHANGED
@@ -29,17 +29,23 @@ To install directly (without bundler), run
|
|
29
29
|
gem install continuous_integration
|
30
30
|
```
|
31
31
|
|
32
|
-
|
32
|
+
### Usage
|
33
33
|
|
34
|
+
#### Constants
|
35
|
+
Default paths have been defined in the [constants.rb](lib/continuous_integration/constants.rb) file. Update it aqccordingls as per your needs. It can also be overriden by passing them when running the server env var.
|
36
|
+
|
37
|
+
#### Running
|
34
38
|
Put the below contents in a ruby file say `ci_server.rb`
|
35
39
|
|
36
40
|
```
|
41
|
+
#ci_server.rb
|
42
|
+
|
37
43
|
require 'continuous_integration'
|
38
|
-
server = ContinuousIntegration.
|
39
|
-
server
|
44
|
+
server = ContinuousIntegration.setup_server
|
45
|
+
ContinuousIntegration.start_server server
|
40
46
|
```
|
41
47
|
|
42
|
-
and run it like below to start the CI server
|
48
|
+
and then run it like below to start the CI server
|
43
49
|
```
|
44
50
|
ruby ci_server.rb
|
45
51
|
```
|
@@ -48,21 +54,11 @@ You should be able to receive the POST requests on `http://localhost:8080` now
|
|
48
54
|
|
49
55
|
Also, if you access the above URL in a browser, it shows you the content of the `API_SPECS_PATH/logs` as a web server, which apparently happens to be the path of the api test tun logs generated by the aha tool
|
50
56
|
|
51
|
-
|
57
|
+
#### Stopping the server
|
52
58
|
```
|
53
59
|
Ctrl + C
|
54
60
|
```
|
55
61
|
|
56
|
-
## Paths
|
57
|
-
|
58
|
-
Default paths have been updated in the [constants.rb](lib/continuous_integration/constants.rb) file. It can be overriden by passing env vars when running the server.
|
59
|
-
|
60
|
-
## To - Do list
|
61
|
-
|
62
|
-
1. Create text file say PATHFILE when installing gem to easy fill in the constants rather than be in the code
|
63
|
-
2. Add more container hosting providers support and add tasks accordingly
|
64
|
-
3. Segregate individual tasks like tests run more seamlessly or even make them file based to give more flexibillity
|
65
|
-
|
66
62
|
### Troubleshooting
|
67
63
|
|
68
64
|
For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
|
@@ -71,21 +67,28 @@ Still stuck? Try [filing an issue](doc/contributing/ISSUES.md).
|
|
71
67
|
|
72
68
|
### Other questions
|
73
69
|
|
74
|
-
To see what has changed in recent versions of
|
70
|
+
To see what has changed in recent versions of CI, see the [CHANGELOG](CHANGELOG.md).
|
75
71
|
|
76
|
-
To get in touch with the ContinuousIntegration core team and other
|
72
|
+
To get in touch with the ContinuousIntegration core team and other CI users, please see [getting help](doc/contributing/GETTING_HELP.md).
|
77
73
|
|
78
74
|
### Contributing
|
79
75
|
|
80
76
|
If you'd like to contribute to ContinuousIntegration, that's awesome, and we <3 you. There's a guide to contributing to ContinuousIntegration (both code and general help) over in [our documentation section](doc/README.md).
|
81
77
|
|
78
|
+
#### To - Do list
|
82
79
|
|
83
|
-
|
80
|
+
1. Create text file say PATHFILE when installing gem to easy fill in the constants rather than be in the code
|
81
|
+
2. Add more container hosting providers support and add tasks accordingly
|
82
|
+
3. Segregate individual tasks like tests run more seamlessly or even make them file based to give more flexibillity
|
83
|
+
|
84
|
+
#### Code of Conduct
|
84
85
|
|
85
|
-
|
86
|
+
Everyone interacting in the CI project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [CI code of conduct](doc/CODE_OF_CONDUCT.md).
|
87
|
+
|
88
|
+
### Donations
|
89
|
+
|
90
|
+
If you are using CI for you organization, please help solicit to donate, as this work is made possible with donations like yours. It involves years of efforts with money spent to obtain the college degree and experience gained to write quality software. PM for customizations and implementations
|
86
91
|
|
87
92
|
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZKRHDCLG22EJA)
|
88
93
|
|
89
|
-
### Code of Conduct
|
90
94
|
|
91
|
-
Everyone interacting in the CI project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [CI code of conduct](doc/CODE_OF_CONDUCT.md).
|
data/bin/continuous_integration
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -8,12 +8,13 @@ require 'continuous_integration/version'
|
|
8
8
|
|
9
9
|
module ContinuousIntegration
|
10
10
|
|
11
|
-
|
11
|
+
#setup the CI server config
|
12
|
+
def self.setup_server
|
12
13
|
#path for the web server to serve the test results
|
13
14
|
root = File.expand_path "#{API_SPECS_PATH}/logs"
|
14
15
|
|
15
|
-
#
|
16
|
-
server =
|
16
|
+
#create the server
|
17
|
+
server = create_server root
|
17
18
|
|
18
19
|
#mount the dir
|
19
20
|
dir_mount server
|
@@ -25,14 +26,19 @@ module ContinuousIntegration
|
|
25
26
|
|
26
27
|
return server
|
27
28
|
end
|
28
|
-
|
29
|
+
|
30
|
+
def self.start_server server
|
31
|
+
server.start
|
32
|
+
end
|
33
|
+
|
29
34
|
def self.shutdown_server server
|
35
|
+
dir_unmount server
|
30
36
|
server.shutdown
|
31
37
|
end
|
32
|
-
|
38
|
+
|
33
39
|
private
|
34
40
|
|
35
|
-
def self.
|
41
|
+
def self.create_server root
|
36
42
|
WEBrick::HTTPServer.new :Port => PORT_NUM, :DocumentRoot => root, :DirectoryIndex => []
|
37
43
|
end
|
38
44
|
|
@@ -40,5 +46,7 @@ module ContinuousIntegration
|
|
40
46
|
server.mount SUB_URI, DockerEndpoint
|
41
47
|
end
|
42
48
|
|
43
|
-
|
49
|
+
def self.dir_unmount server
|
50
|
+
server.unmount SUB_URI
|
51
|
+
end
|
44
52
|
end
|
@@ -1,20 +1,52 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'continuous_integration'
|
3
3
|
|
4
|
-
class
|
5
|
-
def
|
6
|
-
|
4
|
+
class ContinuousIntegrationTest < Minitest::Test
|
5
|
+
def setup
|
6
|
+
#@server = ContinuousIntegration.setup_server
|
7
|
+
@root = File.expand_path "#{API_SPECS_PATH}/logs"
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
@server = nil
|
7
12
|
end
|
8
13
|
|
14
|
+
def test_order
|
15
|
+
:alpha
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_setup_server
|
19
|
+
#@server = ContinuousIntegration.setup_server
|
20
|
+
# assert_kind_of WEBrick::HTTPServer, @server, "Shutdown server did not return object"
|
21
|
+
# @server = ContinuousIntegration.shutdown_server @server
|
22
|
+
#assert_equal "hello world", Hola.hi("english")
|
23
|
+
#@server = ContinuousIntegration.dir_unmount @root
|
24
|
+
end
|
25
|
+
|
9
26
|
def test_shutdown_server
|
10
|
-
|
27
|
+
@server = ContinuousIntegration.setup_server
|
28
|
+
t1 = Thread.new { @server = ContinuousIntegration.start_server @server }
|
29
|
+
assert_kind_of WEBrick::HTTPServer, @server, "Shutdown server did not return object"
|
30
|
+
@server = ContinuousIntegration.shutdown_server @server
|
31
|
+
assert_nil @server, "Server class is not nil"
|
32
|
+
assert t1.status, "Thread is still running"
|
33
|
+
end
|
34
|
+
=begin
|
35
|
+
def test_start_server
|
36
|
+
#@server = ContinuousIntegration.start_server @server
|
37
|
+
assert_empty !@server, "Start server did not return object"
|
38
|
+
ContinuousIntegration.shutdown_server @server
|
11
39
|
end
|
12
40
|
|
13
|
-
def
|
14
|
-
|
41
|
+
def test_create_server
|
42
|
+
@server = ContinuousIntegration.create_server @root
|
43
|
+
assert_empty !@server, "Create server did not return object"
|
15
44
|
end
|
16
45
|
|
17
46
|
def test_dir_mount
|
18
|
-
|
19
|
-
|
47
|
+
@server = ContinuousIntegration.create_server @root
|
48
|
+
@server = ContinuousIntegration.dir_mount @server
|
49
|
+
assert_empty !@server, "Create server did not return object"
|
50
|
+
end
|
51
|
+
=end
|
20
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ragavendra Nagraj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -55,6 +55,9 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- bin/continuous_integration
|
57
57
|
- continuous_integration.gemspec
|
58
|
+
- doc/CODE_OF_CONDUCT.md
|
59
|
+
- doc/TROUBLESHOOTING.md
|
60
|
+
- doc/contributing/ISSUES.md
|
58
61
|
- lib/continuous_integration.rb
|
59
62
|
- lib/continuous_integration/constants.rb
|
60
63
|
- lib/continuous_integration/tasks.rb
|