continuous_integration 0.0.11 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +61 -0
- data/README.md +47 -2
- data/bin/continuous_integration +2 -2
- data/lib/continuous_integration/server.rb +48 -47
- data/lib/continuous_integration/version.rb +1 -1
- data/lib/continuous_integration.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7f887e62539b001ed8a91792715575bf11eb611
|
4
|
+
data.tar.gz: de448300183180273b068b45c0ac5fe759d2c3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c49139bfa3d11fffdaec5780a900f39c214ff9591e8347f308aea3da730f0545359b9a84005d2e1f5b1b2f419c9c70fabeb3b2f8b322de92400706602a6439
|
7
|
+
data.tar.gz: 1dccc2de883ba08661d5fa997f9e470bc5067229338a7723949044e7ee94e27124c68ce25b3129a35990f274a395cf99280b1004ac887fed12dd55475a74a9d1
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.4.1-node-browsers
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- checkout
|
21
|
+
|
22
|
+
# Download and cache dependencies
|
23
|
+
- restore_cache:
|
24
|
+
keys:
|
25
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
26
|
+
# fallback to using the latest cache if no exact match is found
|
27
|
+
- v1-dependencies-
|
28
|
+
|
29
|
+
- run:
|
30
|
+
name: install dependencies
|
31
|
+
command: |
|
32
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
33
|
+
|
34
|
+
- save_cache:
|
35
|
+
paths:
|
36
|
+
- ./vendor/bundle
|
37
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
38
|
+
|
39
|
+
# Database setup
|
40
|
+
- run: bundle exec rake db:create
|
41
|
+
- run: bundle exec rake db:schema:load
|
42
|
+
|
43
|
+
# run tests!
|
44
|
+
- run:
|
45
|
+
name: run tests
|
46
|
+
command: |
|
47
|
+
mkdir /tmp/test-results
|
48
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
49
|
+
|
50
|
+
bundle exec rspec --format progress \
|
51
|
+
--format RspecJunitFormatter \
|
52
|
+
--out /tmp/test-results/rspec.xml \
|
53
|
+
--format progress \
|
54
|
+
"${TEST_FILES}"
|
55
|
+
|
56
|
+
# collect reports
|
57
|
+
- store_test_results:
|
58
|
+
path: /tmp/test-results
|
59
|
+
- store_artifacts:
|
60
|
+
path: /tmp/test-results
|
61
|
+
destination: test-results
|
data/README.md
CHANGED
@@ -58,8 +58,7 @@ Put the below contents in a ruby file say `ci_server.rb`
|
|
58
58
|
#ci_server.rb
|
59
59
|
|
60
60
|
require 'continuous_integration'
|
61
|
-
|
62
|
-
ContinuousIntegration::Server.start_server server
|
61
|
+
ContinuousIntegration::Server.start_server
|
63
62
|
```
|
64
63
|
|
65
64
|
and then run it like below to start the CI server
|
@@ -82,8 +81,18 @@ curl -d "@schemas/quay-success-completed.json" -H "Content-Type: application/jso
|
|
82
81
|
#### Stopping the server
|
83
82
|
```
|
84
83
|
Ctrl + C
|
84
|
+
|
85
|
+
OR
|
86
|
+
|
87
|
+
ContinuousIntegration::Server.shutdown_server
|
85
88
|
```
|
86
89
|
|
90
|
+
#### Results
|
91
|
+
|
92
|
+
Test results should be available in the `API_SPECS_PATH/logs` folder which can be accessed by the browser at http://localhost:8080/
|
93
|
+
|
94
|
+
Furthermore code can be added ini `slack_post` method [tasks.rb](lib/continuous_integration/tasks.rb)`tasks.rb` to send this test results link to your team on a slack channel
|
95
|
+
|
87
96
|
### Troubleshooting
|
88
97
|
|
89
98
|
For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
|
@@ -121,6 +130,42 @@ Everyone interacting in the CI project’s codebases, issue trackers, chat rooms
|
|
121
130
|
#### Customizations
|
122
131
|
Depending on the need and various third party services customizations, please feel free to write to me
|
123
132
|
|
133
|
+
#### Contributing
|
134
|
+
|
135
|
+
1. Fork it
|
136
|
+
2. Make sure you init the submodules (`git submodule init && git submodule update`)
|
137
|
+
3. Create your feature branch (`git checkout -b my-new-feature`)
|
138
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
139
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
140
|
+
6. Create new Pull Request
|
141
|
+
|
142
|
+
#### Release process
|
143
|
+
|
144
|
+
Check the `circle.yml` for the latest, but currently merging to master will build and deploy to the following Equinox channels:
|
145
|
+
|
146
|
+
Tag | Channels
|
147
|
+
--------------------------------|-------------
|
148
|
+
No tag | dev
|
149
|
+
vX.Y.Z-alpha.N or vX.Y.Z-beta.N | beta, dev
|
150
|
+
vX.Y.Z | stable, beta, dev
|
151
|
+
|
152
|
+
Development + release process is:
|
153
|
+
|
154
|
+
1. Branch from master
|
155
|
+
2. Do work
|
156
|
+
3. Open PR against master
|
157
|
+
4. Merge to master
|
158
|
+
5. Branch from master to update `CHANGELOG.md` to include the commit hashes and release date
|
159
|
+
6. Update the `version` constant in `rainforest-cli.go` following [semvar](http://semver.org/)
|
160
|
+
7. Merge to master
|
161
|
+
8. Tag the master branch with the release:
|
162
|
+
```bash
|
163
|
+
git tag vX.Y.Z or vX.Y.Z-alpha.N or vX.Y.Z-beta.N
|
164
|
+
git push origin vX.Y.Z
|
165
|
+
```
|
166
|
+
9. Merge to master to release to stable/beta/dev
|
167
|
+
10. Add release to Github [release page](https://github.com/rainforestapp/rainforest-cli/releases)
|
168
|
+
|
124
169
|
### Donations
|
125
170
|
|
126
171
|
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
|
data/bin/continuous_integration
CHANGED
@@ -9,62 +9,63 @@ require_relative 'version'
|
|
9
9
|
|
10
10
|
# Module to perform CI operations!
|
11
11
|
module ContinuousIntegration
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
23
|
|
24
|
-
|
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"
|
24
|
+
attr_accessor :server, :root
|
28
25
|
|
29
|
-
|
30
|
-
|
26
|
+
def self.start_server
|
27
|
+
self.setup_server
|
28
|
+
@server.start
|
29
|
+
end
|
31
30
|
|
32
|
-
|
33
|
-
|
31
|
+
# setup the CI server config
|
32
|
+
def self.setup_server
|
33
|
+
# path for the web server to serve the test results
|
34
|
+
@root = File.expand_path "#{API_SPECS_PATH}/logs"
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
shutdown_server server
|
38
|
-
end
|
36
|
+
# create the server
|
37
|
+
@server = self.create_server
|
39
38
|
|
40
|
-
|
41
|
-
|
39
|
+
# mount the dir
|
40
|
+
dir_mount
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
# shut server down on any interrupt
|
43
|
+
trap('INT') do
|
44
|
+
shutdown_server
|
45
|
+
end
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
def self.shutdown_server
|
49
|
+
dir_unmount
|
50
|
+
@server.shutdown
|
51
|
+
end
|
51
52
|
|
52
|
-
|
53
|
+
private_class_method
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
def self.create_server
|
56
|
+
WEBrick::HTTPServer.new(
|
57
|
+
Port: PORT_NUM,
|
58
|
+
DocumentRoot: @root,
|
59
|
+
DirectoryIndex: []
|
60
|
+
)
|
61
|
+
end
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
def self.dir_mount
|
64
|
+
@server.mount SUB_URI, DockerEndpoint
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
def self.dir_unmount
|
68
|
+
@server.unmount SUB_URI
|
69
|
+
end
|
70
|
+
end
|
70
71
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ragavendra Nagraj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -46,6 +46,7 @@ executables:
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- ".circleci/config.yml"
|
49
50
|
- ".gitignore"
|
50
51
|
- LICENSE.txt
|
51
52
|
- README.md
|