cyclid 0.2.0

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.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +174 -0
  3. data/README.md +54 -0
  4. data/app/cyclid.rb +61 -0
  5. data/app/cyclid/config.rb +38 -0
  6. data/app/cyclid/controllers.rb +123 -0
  7. data/app/cyclid/controllers/auth.rb +34 -0
  8. data/app/cyclid/controllers/auth/token.rb +78 -0
  9. data/app/cyclid/controllers/health.rb +96 -0
  10. data/app/cyclid/controllers/organizations.rb +104 -0
  11. data/app/cyclid/controllers/organizations/collection.rb +134 -0
  12. data/app/cyclid/controllers/organizations/config.rb +128 -0
  13. data/app/cyclid/controllers/organizations/document.rb +135 -0
  14. data/app/cyclid/controllers/organizations/job.rb +266 -0
  15. data/app/cyclid/controllers/organizations/members.rb +145 -0
  16. data/app/cyclid/controllers/organizations/stages.rb +251 -0
  17. data/app/cyclid/controllers/users.rb +47 -0
  18. data/app/cyclid/controllers/users/collection.rb +131 -0
  19. data/app/cyclid/controllers/users/document.rb +133 -0
  20. data/app/cyclid/health_helpers.rb +40 -0
  21. data/app/cyclid/job.rb +3 -0
  22. data/app/cyclid/job/helpers.rb +67 -0
  23. data/app/cyclid/job/job.rb +164 -0
  24. data/app/cyclid/job/runner.rb +275 -0
  25. data/app/cyclid/job/stage.rb +67 -0
  26. data/app/cyclid/log_buffer.rb +104 -0
  27. data/app/cyclid/models.rb +3 -0
  28. data/app/cyclid/models/job_record.rb +25 -0
  29. data/app/cyclid/models/organization.rb +64 -0
  30. data/app/cyclid/models/plugin_config.rb +25 -0
  31. data/app/cyclid/models/stage.rb +42 -0
  32. data/app/cyclid/models/step.rb +29 -0
  33. data/app/cyclid/models/user.rb +60 -0
  34. data/app/cyclid/models/user_permissions.rb +28 -0
  35. data/app/cyclid/monkey_patches.rb +37 -0
  36. data/app/cyclid/plugin_registry.rb +75 -0
  37. data/app/cyclid/plugins.rb +125 -0
  38. data/app/cyclid/plugins/action.rb +48 -0
  39. data/app/cyclid/plugins/action/command.rb +89 -0
  40. data/app/cyclid/plugins/action/email.rb +207 -0
  41. data/app/cyclid/plugins/action/email/html.erb +58 -0
  42. data/app/cyclid/plugins/action/email/text.erb +13 -0
  43. data/app/cyclid/plugins/action/script.rb +90 -0
  44. data/app/cyclid/plugins/action/slack.rb +129 -0
  45. data/app/cyclid/plugins/action/slack/note.erb +5 -0
  46. data/app/cyclid/plugins/api.rb +195 -0
  47. data/app/cyclid/plugins/api/github.rb +111 -0
  48. data/app/cyclid/plugins/api/github/callback.rb +66 -0
  49. data/app/cyclid/plugins/api/github/methods.rb +201 -0
  50. data/app/cyclid/plugins/api/github/status.rb +67 -0
  51. data/app/cyclid/plugins/builder.rb +80 -0
  52. data/app/cyclid/plugins/builder/mist.rb +107 -0
  53. data/app/cyclid/plugins/dispatcher.rb +89 -0
  54. data/app/cyclid/plugins/dispatcher/local.rb +167 -0
  55. data/app/cyclid/plugins/provisioner.rb +40 -0
  56. data/app/cyclid/plugins/provisioner/debian.rb +90 -0
  57. data/app/cyclid/plugins/provisioner/ubuntu.rb +98 -0
  58. data/app/cyclid/plugins/source.rb +39 -0
  59. data/app/cyclid/plugins/source/git.rb +64 -0
  60. data/app/cyclid/plugins/transport.rb +63 -0
  61. data/app/cyclid/plugins/transport/ssh.rb +155 -0
  62. data/app/cyclid/sinatra/api_helpers.rb +66 -0
  63. data/app/cyclid/sinatra/auth_helpers.rb +127 -0
  64. data/app/cyclid/sinatra/warden/strategies/api_token.rb +62 -0
  65. data/app/cyclid/sinatra/warden/strategies/basic.rb +58 -0
  66. data/app/cyclid/sinatra/warden/strategies/hmac.rb +76 -0
  67. data/app/db.rb +51 -0
  68. data/bin/cyclid-db-init +107 -0
  69. data/db/schema.rb +92 -0
  70. data/lib/cyclid/app.rb +4 -0
  71. metadata +407 -0
@@ -0,0 +1,92 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20160715161156) do
15
+
16
+ create_table "job_records", force: :cascade do |t|
17
+ t.string "job_name"
18
+ t.string "job_version"
19
+ t.datetime "started"
20
+ t.datetime "ended"
21
+ t.integer "status"
22
+ t.text "log"
23
+ t.text "job"
24
+ t.integer "organization_id"
25
+ t.integer "user_id"
26
+ end
27
+
28
+ add_index "job_records", ["job_name"], name: "index_job_records_on_job_name"
29
+ add_index "job_records", ["organization_id"], name: "index_job_records_on_organization_id"
30
+ add_index "job_records", ["user_id"], name: "index_job_records_on_user_id"
31
+
32
+ create_table "organizations", force: :cascade do |t|
33
+ t.string "name", null: false
34
+ t.string "owner_email", null: false
35
+ t.binary "rsa_private_key", null: false
36
+ t.binary "rsa_public_key", null: false
37
+ t.string "salt", default: "0", null: false
38
+ end
39
+
40
+ create_table "organizations_users", id: false, force: :cascade do |t|
41
+ t.integer "organization_id"
42
+ t.integer "user_id"
43
+ end
44
+
45
+ add_index "organizations_users", ["organization_id"], name: "index_organizations_users_on_organization_id"
46
+ add_index "organizations_users", ["user_id"], name: "index_organizations_users_on_user_id"
47
+
48
+ create_table "plugin_configs", force: :cascade do |t|
49
+ t.string "plugin"
50
+ t.string "version"
51
+ t.text "config"
52
+ t.integer "organization_id"
53
+ end
54
+
55
+ add_index "plugin_configs", ["organization_id"], name: "index_plugin_configs_on_organization_id"
56
+
57
+ create_table "stages", force: :cascade do |t|
58
+ t.string "name", null: false
59
+ t.string "version", default: "0.0.1", null: false
60
+ t.integer "organization_id"
61
+ end
62
+
63
+ add_index "stages", ["organization_id"], name: "index_stages_on_organization_id"
64
+
65
+ create_table "steps", force: :cascade do |t|
66
+ t.integer "sequence", null: false
67
+ t.text "action"
68
+ t.integer "stage_id"
69
+ end
70
+
71
+ add_index "steps", ["stage_id"], name: "index_steps_on_stage_id"
72
+
73
+ create_table "userpermissions", force: :cascade do |t|
74
+ t.boolean "admin", default: false, null: false
75
+ t.boolean "write", default: false, null: false
76
+ t.boolean "read", default: false, null: false
77
+ t.integer "user_id"
78
+ t.integer "organization_id"
79
+ end
80
+
81
+ add_index "userpermissions", ["organization_id"], name: "index_userpermissions_on_organization_id"
82
+ add_index "userpermissions", ["user_id"], name: "index_userpermissions_on_user_id"
83
+
84
+ create_table "users", force: :cascade do |t|
85
+ t.string "username", null: false
86
+ t.string "email", null: false
87
+ t.string "password"
88
+ t.string "secret"
89
+ t.string "name"
90
+ end
91
+
92
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ $LOAD_PATH.push File.expand_path('../../../app', __FILE__)
3
+
4
+ require 'cyclid'
metadata ADDED
@@ -0,0 +1,407 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cyclid
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Kristian Van Der Vliet
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-08-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: oj
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.14'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: require_all
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sinatra
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.4'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra-contrib
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sinatra-cross_origin
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.3'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: warden
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.2'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activerecord
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sinatra-activerecord
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sinatra-health-check
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.2.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.2.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: bcrypt
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.1'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: net-ssh
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.1'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.1'
167
+ - !ruby/object:Gem::Dependency
168
+ name: net-scp
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.2'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.2'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sidekiq
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '4.1'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '4.1'
195
+ - !ruby/object:Gem::Dependency
196
+ name: mysql
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '2.9'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '2.9'
209
+ - !ruby/object:Gem::Dependency
210
+ name: slack-notifier
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '1.5'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '1.5'
223
+ - !ruby/object:Gem::Dependency
224
+ name: mail
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '2.6'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '2.6'
237
+ - !ruby/object:Gem::Dependency
238
+ name: premailer
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '1.8'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '1.8'
251
+ - !ruby/object:Gem::Dependency
252
+ name: nokogiri
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: '1.6'
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: '1.6'
265
+ - !ruby/object:Gem::Dependency
266
+ name: jwt
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '1.5'
272
+ type: :runtime
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '1.5'
279
+ - !ruby/object:Gem::Dependency
280
+ name: cyclid-core
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: mist-client
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
307
+ description: The Cyclid CI system
308
+ email: contact@cyclid.io
309
+ executables:
310
+ - cyclid-db-init
311
+ extensions: []
312
+ extra_rdoc_files: []
313
+ files:
314
+ - LICENSE
315
+ - README.md
316
+ - app/cyclid.rb
317
+ - app/cyclid/config.rb
318
+ - app/cyclid/controllers.rb
319
+ - app/cyclid/controllers/auth.rb
320
+ - app/cyclid/controllers/auth/token.rb
321
+ - app/cyclid/controllers/health.rb
322
+ - app/cyclid/controllers/organizations.rb
323
+ - app/cyclid/controllers/organizations/collection.rb
324
+ - app/cyclid/controllers/organizations/config.rb
325
+ - app/cyclid/controllers/organizations/document.rb
326
+ - app/cyclid/controllers/organizations/job.rb
327
+ - app/cyclid/controllers/organizations/members.rb
328
+ - app/cyclid/controllers/organizations/stages.rb
329
+ - app/cyclid/controllers/users.rb
330
+ - app/cyclid/controllers/users/collection.rb
331
+ - app/cyclid/controllers/users/document.rb
332
+ - app/cyclid/health_helpers.rb
333
+ - app/cyclid/job.rb
334
+ - app/cyclid/job/helpers.rb
335
+ - app/cyclid/job/job.rb
336
+ - app/cyclid/job/runner.rb
337
+ - app/cyclid/job/stage.rb
338
+ - app/cyclid/log_buffer.rb
339
+ - app/cyclid/models.rb
340
+ - app/cyclid/models/job_record.rb
341
+ - app/cyclid/models/organization.rb
342
+ - app/cyclid/models/plugin_config.rb
343
+ - app/cyclid/models/stage.rb
344
+ - app/cyclid/models/step.rb
345
+ - app/cyclid/models/user.rb
346
+ - app/cyclid/models/user_permissions.rb
347
+ - app/cyclid/monkey_patches.rb
348
+ - app/cyclid/plugin_registry.rb
349
+ - app/cyclid/plugins.rb
350
+ - app/cyclid/plugins/action.rb
351
+ - app/cyclid/plugins/action/command.rb
352
+ - app/cyclid/plugins/action/email.rb
353
+ - app/cyclid/plugins/action/email/html.erb
354
+ - app/cyclid/plugins/action/email/text.erb
355
+ - app/cyclid/plugins/action/script.rb
356
+ - app/cyclid/plugins/action/slack.rb
357
+ - app/cyclid/plugins/action/slack/note.erb
358
+ - app/cyclid/plugins/api.rb
359
+ - app/cyclid/plugins/api/github.rb
360
+ - app/cyclid/plugins/api/github/callback.rb
361
+ - app/cyclid/plugins/api/github/methods.rb
362
+ - app/cyclid/plugins/api/github/status.rb
363
+ - app/cyclid/plugins/builder.rb
364
+ - app/cyclid/plugins/builder/mist.rb
365
+ - app/cyclid/plugins/dispatcher.rb
366
+ - app/cyclid/plugins/dispatcher/local.rb
367
+ - app/cyclid/plugins/provisioner.rb
368
+ - app/cyclid/plugins/provisioner/debian.rb
369
+ - app/cyclid/plugins/provisioner/ubuntu.rb
370
+ - app/cyclid/plugins/source.rb
371
+ - app/cyclid/plugins/source/git.rb
372
+ - app/cyclid/plugins/transport.rb
373
+ - app/cyclid/plugins/transport/ssh.rb
374
+ - app/cyclid/sinatra/api_helpers.rb
375
+ - app/cyclid/sinatra/auth_helpers.rb
376
+ - app/cyclid/sinatra/warden/strategies/api_token.rb
377
+ - app/cyclid/sinatra/warden/strategies/basic.rb
378
+ - app/cyclid/sinatra/warden/strategies/hmac.rb
379
+ - app/db.rb
380
+ - bin/cyclid-db-init
381
+ - db/schema.rb
382
+ - lib/cyclid/app.rb
383
+ homepage: https://cyclid.io
384
+ licenses:
385
+ - Apache-2.0
386
+ metadata: {}
387
+ post_install_message:
388
+ rdoc_options: []
389
+ require_paths:
390
+ - lib
391
+ required_ruby_version: !ruby/object:Gem::Requirement
392
+ requirements:
393
+ - - ">="
394
+ - !ruby/object:Gem::Version
395
+ version: '0'
396
+ required_rubygems_version: !ruby/object:Gem::Requirement
397
+ requirements:
398
+ - - ">="
399
+ - !ruby/object:Gem::Version
400
+ version: '0'
401
+ requirements: []
402
+ rubyforge_project:
403
+ rubygems_version: 2.5.1
404
+ signing_key:
405
+ specification_version: 4
406
+ summary: Cyclid CI API
407
+ test_files: []