integration_pal 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +81 -0
- data/Rakefile +36 -0
- data/app/assets/config/integration_pal_manifest.js +2 -0
- data/app/assets/javascripts/integration_pal/application.js +13 -0
- data/app/assets/stylesheets/integration_pal/application.css +27 -0
- data/app/controllers/integration_pal/api/v1/jobs_controller.rb +29 -0
- data/app/controllers/integration_pal/api_controller.rb +16 -0
- data/app/controllers/integration_pal/application_controller.rb +8 -0
- data/app/controllers/integration_pal/jobs_controller.rb +62 -0
- data/app/controllers/integration_pal/workers_controller.rb +62 -0
- data/app/helpers/integration_pal/application_helper.rb +4 -0
- data/app/jobs/integration_pal/application_job.rb +4 -0
- data/app/mailers/integration_pal/application_mailer.rb +6 -0
- data/app/models/integration_pal/application_record.rb +5 -0
- data/app/models/integration_pal/job.rb +22 -0
- data/app/models/integration_pal/worker.rb +29 -0
- data/app/views/integration_pal/jobs/_form.html.erb +32 -0
- data/app/views/integration_pal/jobs/edit.html.erb +6 -0
- data/app/views/integration_pal/jobs/index.html.erb +25 -0
- data/app/views/integration_pal/jobs/new.html.erb +5 -0
- data/app/views/integration_pal/jobs/show.html.erb +19 -0
- data/app/views/integration_pal/workers/_form.html.erb +48 -0
- data/app/views/integration_pal/workers/edit.html.erb +6 -0
- data/app/views/integration_pal/workers/index.html.erb +32 -0
- data/app/views/integration_pal/workers/new.html.erb +5 -0
- data/app/views/integration_pal/workers/show.html.erb +14 -0
- data/app/views/layouts/_navbar.html.erb +24 -0
- data/app/views/layouts/integration_pal/application.html.erb +15 -0
- data/config/initializers/encryption.rb +2 -0
- data/config/initializers/jobs.rb +4 -0
- data/config/routes.rb +11 -0
- data/db/migrate/20170524203831_create_integration_pal_workers.rb +14 -0
- data/db/migrate/20170525153603_create_integration_pal_jobs.rb +14 -0
- data/lib/integration_pal/engine.rb +25 -0
- data/lib/integration_pal/version.rb +3 -0
- data/lib/integration_pal.rb +5 -0
- data/lib/tasks/integration_pal_tasks.rake +4 -0
- data/spec/controllers/integration_pal/api/v1/jobs_controller_spec.rb +74 -0
- data/spec/controllers/integration_pal/jobs_controller_spec.rb +107 -0
- data/spec/controllers/integration_pal/workers_controller_spec.rb +107 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/jobs/test_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +18 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +18 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +91 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/db/schema.rb +40 -0
- data/spec/dummy/log/development.log +38 -0
- data/spec/dummy/log/test.log +7232 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/integration_pal_jobs.rb +8 -0
- data/spec/factories/integration_pal_workers.rb +9 -0
- data/spec/models/integration_pal/job_spec.rb +21 -0
- data/spec/models/integration_pal/worker_spec.rb +29 -0
- data/spec/rails_helper.rb +61 -0
- data/spec/spec_helper.rb +100 -0
- metadata +349 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# The following keys must be escaped otherwise they will not be retrieved by
|
20
|
+
# the default I18n backend:
|
21
|
+
#
|
22
|
+
# true, false, on, off, yes, no
|
23
|
+
#
|
24
|
+
# Instead, surround them with single quotes.
|
25
|
+
#
|
26
|
+
# en:
|
27
|
+
# 'true': 'foo'
|
28
|
+
#
|
29
|
+
# To learn more, please read the Rails Internationalization guide
|
30
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
31
|
+
|
32
|
+
en:
|
33
|
+
hello: "Hello world"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum; this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
8
|
+
threads threads_count, threads_count
|
9
|
+
|
10
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
11
|
+
#
|
12
|
+
port ENV.fetch("PORT") { 3000 }
|
13
|
+
|
14
|
+
# Specifies the `environment` that Puma will run in.
|
15
|
+
#
|
16
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
17
|
+
|
18
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
19
|
+
# Workers are forked webserver processes. If using threads and workers together
|
20
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
21
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
22
|
+
# processes).
|
23
|
+
#
|
24
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
25
|
+
|
26
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
27
|
+
# This directive tells Puma to first boot the application and load code
|
28
|
+
# before forking the application. This takes advantage of Copy On Write
|
29
|
+
# process behavior so workers use less memory. If you use this option
|
30
|
+
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
31
|
+
# block.
|
32
|
+
#
|
33
|
+
# preload_app!
|
34
|
+
|
35
|
+
# If you are preloading your application and using Active Record, it's
|
36
|
+
# recommended that you close any connections to the database before workers
|
37
|
+
# are forked to prevent connection leakage.
|
38
|
+
#
|
39
|
+
# before_fork do
|
40
|
+
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
|
41
|
+
# end
|
42
|
+
|
43
|
+
# The code in the `on_worker_boot` will be called if you are using
|
44
|
+
# clustered mode by specifying a number of `workers`. After each worker
|
45
|
+
# process is booted, this block will be run. If you are using the `preload_app!`
|
46
|
+
# option, you will want to use this block to reconnect to any threads
|
47
|
+
# or connections that may have been created at application boot, as Ruby
|
48
|
+
# cannot share connections between processes.
|
49
|
+
#
|
50
|
+
# on_worker_boot do
|
51
|
+
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
|
55
|
+
# Allow puma to be restarted by `rails restart` command.
|
56
|
+
plugin :tmp_restart
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rails secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
# Shared secrets are available across all environments.
|
14
|
+
|
15
|
+
# shared:
|
16
|
+
# api_key: a1B2c3D4e5F6
|
17
|
+
|
18
|
+
# Environmental secrets are only available for that specific environment.
|
19
|
+
|
20
|
+
development:
|
21
|
+
secret_key_base: 7c830920b703101394cf284d66b725156ffda401cee0601cddae20c575fb7c98623014a9e4a256418ab740d42c9a95dc45b02860d4940242d815b950b6aeb5ac
|
22
|
+
|
23
|
+
test:
|
24
|
+
secret_key_base: 591251335929df640bb9a05b6d9bcc1e4142870f10fb096c973da27c8110e639bf4212d64fc6177c0ebfee924bddf936a9a64cfe4616437c3e7fe986b9280a79
|
25
|
+
|
26
|
+
# Do not keep production secrets in the unencrypted secrets file.
|
27
|
+
# Instead, either read values from the environment.
|
28
|
+
# Or, use `bin/rails secrets:setup` to configure encrypted secrets
|
29
|
+
# and move the `production:` environment over there.
|
30
|
+
|
31
|
+
production:
|
32
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(version: 20170525153603) do
|
14
|
+
|
15
|
+
# These are extensions that must be enabled in order to support this database
|
16
|
+
enable_extension "plpgsql"
|
17
|
+
|
18
|
+
create_table "integration_pal_jobs", force: :cascade do |t|
|
19
|
+
t.text "job_params"
|
20
|
+
t.string "status"
|
21
|
+
t.datetime "started_at"
|
22
|
+
t.datetime "finished_at"
|
23
|
+
t.string "progress"
|
24
|
+
t.integer "worker_id"
|
25
|
+
t.datetime "created_at", null: false
|
26
|
+
t.datetime "updated_at", null: false
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table "integration_pal_workers", force: :cascade do |t|
|
30
|
+
t.string "name"
|
31
|
+
t.string "access_id"
|
32
|
+
t.string "secret_key"
|
33
|
+
t.string "job_type"
|
34
|
+
t.text "encrypted_settings"
|
35
|
+
t.string "encrypted_settings_iv"
|
36
|
+
t.datetime "created_at", null: false
|
37
|
+
t.datetime "updated_at", null: false
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
[1m[35m (21.9ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m
|
2
|
+
[1m[35m (4.3ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
3
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(3791006887383934680);[0m
|
4
|
+
[1m[35m (1.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
5
|
+
Migrating to CreateIntegrationPalWorkers (20170524203831)
|
6
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
7
|
+
[1m[35m (5.0ms)[0m [1m[35mCREATE TABLE "integration_pal_workers" ("id" bigserial primary key, "name" character varying, "access_id" character varying, "secret_key" character varying, "job_type" character varying, "encrypted_settings" text, "encrypted_settings_iv" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
8
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170524203831"]]
|
9
|
+
[1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
|
10
|
+
Migrating to CreateIntegrationPalJobs (20170525153603)
|
11
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
12
|
+
[1m[35m (6.3ms)[0m [1m[35mCREATE TABLE "integration_pal_jobs" ("id" bigserial primary key, "job_params" text, "status" character varying, "started_at" timestamp, "finished_at" timestamp, "progress" character varying, "worker_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
13
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170525153603"]]
|
14
|
+
[1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
|
15
|
+
[1m[36mActiveRecord::InternalMetadata Load (1.9ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
16
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
17
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2017-05-25 21:27:34.579475"], ["updated_at", "2017-05-25 21:27:34.579475"]]
|
18
|
+
[1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
|
19
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(3791006887383934680)[0m
|
20
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(3791006887383934680);[0m
|
21
|
+
[1m[35m (1.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
22
|
+
[1m[36mActiveRecord::InternalMetadata Load (1.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
23
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
24
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
25
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(3791006887383934680)[0m
|
26
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(3791006887383934680);[0m
|
27
|
+
[1m[35m (0.8ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
28
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.6ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
29
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
30
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
31
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(3791006887383934680)[0m
|
32
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(3791006887383934680);[0m
|
33
|
+
[1m[35m (1.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
34
|
+
[1m[36mActiveRecord::InternalMetadata Load (1.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
35
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
36
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
37
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(3791006887383934680)[0m
|
38
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|