foreman_pipeline 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE +674 -0
- data/README.md +36 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/foreman_pipeline/foreman_pipeline-bootstrap.js +8 -0
- data/app/assets/javascripts/foreman_pipeline/foreman_pipeline.js +20 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/jenkins-instance-details-info.controller.js +46 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/jenkins-instance-details-users.controller.js +72 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/jenkins-instance-details.controller.js +40 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-info.html +36 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-users.html +107 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details.html +53 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/jenkins-instances.controller.js +34 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/jenkins-instances.factory.js +14 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/jenkins-instances.module.js +93 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/new/new-jenkins-instance.controller.js +40 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/new/views/new-jenkins-instance-form.html +50 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/new/views/new-jenkins-instance.html +16 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/views/jenkins-instances-table-collapsed.html +20 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/views/jenkins-instances-table-full.html +30 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-instances/views/jenkins-instances.html +17 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-project-params/jenkins-project-params.factory.js +11 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-project-params/jenkins-project-params.module.js +6 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-projects/jenkins-projects.factory.js +9 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-projects/jenkins-projects.module.js +10 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-requests/jenkins-requests.factory.js +11 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-requests/jenkins-requests.module.js +10 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/details/jenkins-user-info.controller.js +39 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/details/views/jenkins-user-info.html +37 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/jenkins-users.factory.js +10 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/jenkins-users.module.js +6 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/new/new-jenkins-user.controller.js +45 -0
- data/app/assets/javascripts/foreman_pipeline/jenkins-users/new/views/new-jenkins-user.html +32 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-add-paths.controller.js +63 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-content-views.controller.js +55 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-environments.controller.js +56 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-hostgroups.controller.js +59 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-info.controller.js +69 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-jenkins-projects.controller.js +49 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-jenkins.controller.js +56 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-resources.controller.js +60 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-to-environments.controller.js +157 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details.controller.js +34 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/job-projects-discovery.controller.js +96 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/job-projects-parameters.controller.js +54 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/views/job-jenkins-projects.html +1 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/views/job-projects-discovery.html +91 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/views/job-projects-parameters.html +77 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-content-views.html +83 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-environments.html +50 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-hostgroups.html +81 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-info.html +117 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-jenkins-projects.html +75 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-jenkins.html +88 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-paths-list.html +72 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-resources.html +86 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-to-environments.html +51 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details.html +80 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/jobs.controller.js +40 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/jobs.factory.js +54 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/jobs.module.js +142 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/new/new-job.controller.js +31 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/new/views/new-job-form.html +47 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/new/views/new-job.html +17 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/views/jobs-table-collapsed.html +20 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/views/jobs-table-full.html +66 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/views/jobs.html +19 -0
- data/app/assets/javascripts/foreman_pipeline/jobs/views/pln-path-selector.html +10 -0
- data/app/assets/stylesheets/foreman_pipeline/foreman_pipeline.css +13 -0
- data/app/controllers/foreman_pipeline/api/jenkins_instances_controller.rb +124 -0
- data/app/controllers/foreman_pipeline/api/jenkins_project_params_controller.rb +34 -0
- data/app/controllers/foreman_pipeline/api/jenkins_projects_controller.rb +29 -0
- data/app/controllers/foreman_pipeline/api/jenkins_requests_controller.rb +28 -0
- data/app/controllers/foreman_pipeline/api/jenkins_users_controller.rb +89 -0
- data/app/controllers/foreman_pipeline/api/jobs_controller.rb +271 -0
- data/app/controllers/foreman_pipeline/application_controller.rb +4 -0
- data/app/helpers/foreman_pipeline/application_helper.rb +4 -0
- data/app/lib/actions/foreman_pipeline/jenkins/abstract_jenkins_action.rb +20 -0
- data/app/lib/actions/foreman_pipeline/jenkins/build.rb +35 -0
- data/app/lib/actions/foreman_pipeline/jenkins/build_project.rb +31 -0
- data/app/lib/actions/foreman_pipeline/jenkins/bulk_build.rb +23 -0
- data/app/lib/actions/foreman_pipeline/jenkins/get_build_details.rb +11 -0
- data/app/lib/actions/foreman_pipeline/jenkins/get_build_params.rb +11 -0
- data/app/lib/actions/foreman_pipeline/jenkins/get_version.rb +17 -0
- data/app/lib/actions/foreman_pipeline/jenkins/list.rb +15 -0
- data/app/lib/actions/foreman_pipeline/jenkins/wait_and_poll.rb +33 -0
- data/app/lib/actions/foreman_pipeline/jenkins/wait_for_build.rb +42 -0
- data/app/lib/actions/foreman_pipeline/jenkins/wait_host_ready.rb +36 -0
- data/app/lib/actions/foreman_pipeline/jenkins_instance/abstract_jenkins_instance_action.rb +17 -0
- data/app/lib/actions/foreman_pipeline/jenkins_instance/create_jenkins_instance_keys.rb +45 -0
- data/app/lib/actions/foreman_pipeline/job/create_activation_key.rb +20 -0
- data/app/lib/actions/foreman_pipeline/job/create_host.rb +88 -0
- data/app/lib/actions/foreman_pipeline/job/cv_promote_job_hook.rb +22 -0
- data/app/lib/actions/foreman_pipeline/job/cv_publish_job_hook.rb +22 -0
- data/app/lib/actions/foreman_pipeline/job/deploy_new_host.rb +25 -0
- data/app/lib/actions/foreman_pipeline/job/find_packages_to_install.rb +16 -0
- data/app/lib/actions/foreman_pipeline/job/job_hook.rb +24 -0
- data/app/lib/actions/foreman_pipeline/job/multiple_promotions.rb +18 -0
- data/app/lib/actions/foreman_pipeline/job/promote.rb +38 -0
- data/app/lib/actions/foreman_pipeline/job/redeploy.rb +45 -0
- data/app/lib/actions/foreman_pipeline/job/repo_sync_job_hook.rb +33 -0
- data/app/lib/actions/foreman_pipeline/job/run_job_manually.rb +25 -0
- data/app/lib/actions/foreman_pipeline/job/suspend_until_provisioned.rb +13 -0
- data/app/lib/actions/foreman_pipeline/mixins/ssh_extension.rb +41 -0
- data/app/lib/actions/foreman_pipeline/mixins/uri_extension.rb +14 -0
- data/app/lib/foreman_pipeline/api/rendering.rb +18 -0
- data/app/models/foreman_pipeline/authorization/base_model.rb +31 -0
- data/app/models/foreman_pipeline/authorization/jenkins_instance.rb +8 -0
- data/app/models/foreman_pipeline/authorization/jenkins_project.rb +8 -0
- data/app/models/foreman_pipeline/authorization/jenkins_project_param.rb +8 -0
- data/app/models/foreman_pipeline/authorization/jenkins_user.rb +7 -0
- data/app/models/foreman_pipeline/authorization/job.rb +7 -0
- data/app/models/foreman_pipeline/concerns/compute_resource_extension.rb +11 -0
- data/app/models/foreman_pipeline/concerns/content_view_extension.rb +12 -0
- data/app/models/foreman_pipeline/concerns/content_view_repository_extension.rb +12 -0
- data/app/models/foreman_pipeline/concerns/hostgroup_extension.rb +12 -0
- data/app/models/foreman_pipeline/concerns/kt_environment_extension.rb +18 -0
- data/app/models/foreman_pipeline/concerns/repository_extension.rb +12 -0
- data/app/models/foreman_pipeline/glue/elastic_search/base_model.rb +21 -0
- data/app/models/foreman_pipeline/glue/elastic_search/jenkins_instance.rb +11 -0
- data/app/models/foreman_pipeline/glue/elastic_search/jenkins_project.rb +11 -0
- data/app/models/foreman_pipeline/glue/elastic_search/jenkins_user.rb +11 -0
- data/app/models/foreman_pipeline/glue/elastic_search/job.rb +11 -0
- data/app/models/foreman_pipeline/jenkins_instance.rb +51 -0
- data/app/models/foreman_pipeline/jenkins_project.rb +18 -0
- data/app/models/foreman_pipeline/jenkins_project_param.rb +21 -0
- data/app/models/foreman_pipeline/jenkins_user.rb +15 -0
- data/app/models/foreman_pipeline/job.rb +72 -0
- data/app/models/foreman_pipeline/job_jenkins_project.rb +25 -0
- data/app/models/foreman_pipeline/job_to_environment.rb +19 -0
- data/app/views/foreman/unattended/snippets/_jenkins_instance_pubkey.erb +10 -0
- data/app/views/foreman_pipeline/api/common/async.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/common/index.json.rabl +7 -0
- data/app/views/foreman_pipeline/api/compute_resources/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/compute_resources/show.json.rabl +5 -0
- data/app/views/foreman_pipeline/api/content_views/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/content_views/show.json.rabl +5 -0
- data/app/views/foreman_pipeline/api/environments/show.json.rabl +11 -0
- data/app/views/foreman_pipeline/api/hostgroups/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/hostgroups/show.json.rabl +5 -0
- data/app/views/foreman_pipeline/api/jenkins_instances/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jenkins_instances/show.json.rabl +7 -0
- data/app/views/foreman_pipeline/api/jenkins_project_params/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jenkins_project_params/show.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jenkins_projects/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jenkins_projects/show.json.rabl +7 -0
- data/app/views/foreman_pipeline/api/jenkins_users/index.json.rabl +2 -0
- data/app/views/foreman_pipeline/api/jenkins_users/show.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jobs/available_paths.json.rabl +9 -0
- data/app/views/foreman_pipeline/api/jobs/index.json.rabl +3 -0
- data/app/views/foreman_pipeline/api/jobs/show.json.rabl +32 -0
- data/config/mount_engine.rb +3 -0
- data/config/routes.rb +53 -0
- data/db/migrate/20141003121914_create_job_table.rb +13 -0
- data/db/migrate/20141003145152_add_organization_to_jobs_table.rb +9 -0
- data/db/migrate/20141014125836_make_content_view_and_hostgroup_optional_for_job.rb +11 -0
- data/db/migrate/20141029121444_create_test_table.rb +11 -0
- data/db/migrate/20141029125423_add_organization_to_test_table.rb +9 -0
- data/db/migrate/20141030154210_create_jobs_tests_table.rb +12 -0
- data/db/migrate/20141120130350_add_resource_to_job.rb +9 -0
- data/db/migrate/20150121134503_create_jenkins_instances_table.rb +13 -0
- data/db/migrate/20150121134748_add_jenkins_instances_to_job_table.rb +9 -0
- data/db/migrate/20150122155819_add_kt_environment_to_jobs_table.rb +9 -0
- data/db/migrate/20150127101153_add_trigger_options_to_jobs_table.rb +13 -0
- data/db/migrate/20150202180711_add_content_column_to_tests_table.rb +9 -0
- data/db/migrate/20150209145400_add_pubkey_to_jenkins_instance_table.rb +9 -0
- data/db/migrate/20150209160604_add_jenkins_home_to_jenkins_instance_table.rb +9 -0
- data/db/migrate/20150212115234_add_uniqueness_to_jenkins_instance_url.rb +9 -0
- data/db/migrate/20150212125901_add_uniqueness_to_test_name.rb +9 -0
- data/db/migrate/20150213095447_add_cert_path_to_jenkins_instances.rb +9 -0
- data/db/migrate/20150216170951_add_build_step_to_tests_table.rb +9 -0
- data/db/migrate/20150223142315_change_jenkins_instance_cert_path_column.rb +9 -0
- data/db/migrate/20150224090100_create_jenkins_projects_table.rb +19 -0
- data/db/migrate/20150226182211_add_org_to_jenkins_project.rb +9 -0
- data/db/migrate/20150301134121_create_jenkins_project_params_table.rb +16 -0
- data/db/migrate/20150303134951_change_jenkins_project_param_value_column.rb +9 -0
- data/db/migrate/20150304123529_change_jenkins_project_params_table.rb +9 -0
- data/db/migrate/20150305122212_drop_tests_table.rb +5 -0
- data/db/migrate/20150312153833_create_jenkins_users.rb +15 -0
- data/db/migrate/20150313093244_add_jenkins_user_to_jobs.rb +9 -0
- data/db/migrate/20150313115956_change_jenkins_user_owner.rb +9 -0
- data/db/migrate/20150318141859_rename_tables.rb +19 -0
- data/db/migrate/20150323153355_remove_owner_from_jenkins_user.rb +9 -0
- data/db/migrate/20150323165954_add_jenkins_user_to_instance.rb +9 -0
- data/db/migrate/20150323175436_remove_jenkins_user_from_job.rb +9 -0
- data/db/migrate/20150324082437_remove_jenkins_instance_from_user.rb +9 -0
- data/db/migrate/20150324093416_add_promote_to_jobs.rb +9 -0
- data/db/migrate/20150324124034_create_job_path.rb +13 -0
- data/db/migrate/20150408143011_remove_cv_promote_from_job.rb +9 -0
- data/db/migrate/20150408145022_rename_job_path.rb +11 -0
- data/db/migrate/20150923073033_drop_orphaned_table.rb +8 -0
- data/lib/foreman_pipeline.rb +5 -0
- data/lib/foreman_pipeline/engine.rb +67 -0
- data/lib/foreman_pipeline/permissions.rb +3 -0
- data/lib/foreman_pipeline/permissions/jenkins_instance_permissions.rb +25 -0
- data/lib/foreman_pipeline/permissions/jenkins_project_params_permissions.rb +9 -0
- data/lib/foreman_pipeline/permissions/jenkins_projects_permissions.rb +9 -0
- data/lib/foreman_pipeline/permissions/jenkins_request_permissions.rb +9 -0
- data/lib/foreman_pipeline/permissions/jenkins_user_permissions.rb +24 -0
- data/lib/foreman_pipeline/permissions/job_permissions.rb +27 -0
- data/lib/foreman_pipeline/plugin.rb +17 -0
- data/lib/foreman_pipeline/roles.rb +13 -0
- data/lib/foreman_pipeline/tasks/foreman_pipeline_seed.rake +18 -0
- data/lib/foreman_pipeline/tasks/foreman_pipeline_test.rake +34 -0
- data/lib/foreman_pipeline/version.rb +3 -0
- data/test/factories/hostgroup_factory.rb +6 -0
- data/test/factories/jenkins_instance_related_factory.rb +20 -0
- data/test/foreman_pipeline_plugin_test_helper.rb +28 -0
- data/test/unit/job_test.rb +26 -0
- data/test/unit/sanity_test.rb +12 -0
- metadata +327 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateJenkinsProjectParamsTable < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "integration_jenkins_project_params" do |t|
|
4
|
+
t.string "type", :null => false
|
5
|
+
t.string "name", :null => false
|
6
|
+
t.text "description"
|
7
|
+
t.string "value", :null => false
|
8
|
+
t.integer "organization_id", :null => false
|
9
|
+
t.integer "job_jenkins_project_id", :null => false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def down
|
14
|
+
drop_table :integration_jenkins_project_params
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class ChangeJenkinsProjectParamsTable < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
rename_column :integration_jenkins_project_params, :job_jenkins_project_id, :jenkins_project_id
|
4
|
+
end
|
5
|
+
|
6
|
+
def down
|
7
|
+
rename_column :integration_jenkins_project_params, :jenkins_project_id, :job_jenkins_project_id
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateJenkinsUsers < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "integration_jenkins_users" do |t|
|
4
|
+
t.string "name", :null => false
|
5
|
+
t.string "token", :null => false
|
6
|
+
t.integer "organization_id", :null => false
|
7
|
+
t.integer "jenkins_instance_id", :null => false
|
8
|
+
t.integer "user_id", :null => false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def down
|
13
|
+
drop_table "integration_jenkins_users"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class RenameTables < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
rename_table :integration_jobs, :foreman_pipeline_jobs
|
4
|
+
rename_table :integration_jenkins_users, :foreman_pipeline_jenkins_users
|
5
|
+
rename_table :integration_jenkins_instances, :foreman_pipeline_jenkins_instances
|
6
|
+
rename_table :integration_jenkins_project_params, :foreman_pipeline_jenkins_project_params
|
7
|
+
rename_table :integration_jenkins_projects, :foreman_pipeline_jenkins_projects
|
8
|
+
rename_table :integration_job_jenkins_projects, :foreman_pipeline_job_jenkins_projects
|
9
|
+
end
|
10
|
+
|
11
|
+
def down
|
12
|
+
rename_table :foreman_pipeline_jobs, :integration_jobs
|
13
|
+
rename_table :foreman_pipeline_jenkins_users, :integration_jenkins_users
|
14
|
+
rename_table :foreman_pipeline_jenkins_instances, :integration_jenkins_instances
|
15
|
+
rename_table :foreman_pipeline_jenkins_project_params, :integration_jenkins_project_params
|
16
|
+
rename_table :foreman_pipeline_jenkins_projects, :integration_jenkins_projects
|
17
|
+
rename_table :foreman_pipeline_job_jenkins_projects, :integration_job_jenkins_projects
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateJobPath < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :foreman_pipeline_job_paths do |t|
|
4
|
+
t.integer "job_id"
|
5
|
+
t.integer "path_id"
|
6
|
+
t.integer "organization_id"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
drop_table :foreman_pipeline_job_paths
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class RenameJobPath < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
rename_table :foreman_pipeline_job_paths, :foreman_pipeline_job_to_environments
|
4
|
+
rename_column :foreman_pipeline_job_to_environments, :path_id, :to_environment_id
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
rename_table :foreman_pipeline_job_to_environments, :foreman_pipeline_job_paths
|
9
|
+
rename_column :foreman_pipeline_job_paths, :to_environment_id , :path_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module ForemanPipeline
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace ForemanPipeline
|
4
|
+
require 'foreman_deployments'
|
5
|
+
|
6
|
+
initializer 'foreman_pipeline.mount_engine', :after => :build_middleware_stack do |app|
|
7
|
+
app.routes_reloader.paths << "#{ForemanPipeline::Engine.root}/config/mount_engine.rb"
|
8
|
+
end
|
9
|
+
|
10
|
+
initializer 'foreman_pipeline.load_app_instance_data' do |app|
|
11
|
+
app.config.paths['db/migrate'] += ForemanPipeline::Engine.paths['db/migrate'].existent
|
12
|
+
app.config.autoload_paths += Dir["#{config.root}/app/lib"]
|
13
|
+
app.config.autoload_paths += Dir["#{config.root}/app/views/foreman"]
|
14
|
+
end
|
15
|
+
|
16
|
+
initializer 'foreman_pipeline.register_plugin', :after => :finisher_hook do
|
17
|
+
require 'foreman_pipeline/plugin'
|
18
|
+
require 'foreman_pipeline/permissions'
|
19
|
+
require 'foreman_pipeline/roles'
|
20
|
+
end
|
21
|
+
|
22
|
+
initializer 'foreman_pipeline.assets', :group => :all do |app|
|
23
|
+
SETTINGS[:foreman_pipeline] = {
|
24
|
+
:assets => {
|
25
|
+
:precompile => [
|
26
|
+
'foreman_pipeline/foreman_pipeline.js'
|
27
|
+
]
|
28
|
+
}
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
initializer 'foreman_pipeline.register_actions', :before => 'foreman_tasks.initialize_dynflow' do |app|
|
33
|
+
ForemanTasks.dynflow.require!
|
34
|
+
|
35
|
+
action_paths = %W(#{ForemanPipeline::Engine.root}/app/lib/actions)
|
36
|
+
|
37
|
+
ForemanTasks.dynflow.config.eager_load_paths.concat(action_paths)
|
38
|
+
end
|
39
|
+
|
40
|
+
config.to_prepare do
|
41
|
+
|
42
|
+
Bastion.register_plugin({
|
43
|
+
:name => 'foreman_pipeline',
|
44
|
+
:javascript => 'foreman_pipeline/foreman_pipeline',
|
45
|
+
:stylesheet => 'foreman_pipeline/foreman_pipeline',
|
46
|
+
:pages => %w(
|
47
|
+
jobs
|
48
|
+
jenkins_instances
|
49
|
+
)
|
50
|
+
})
|
51
|
+
|
52
|
+
# extensions
|
53
|
+
::Katello::Repository.send :include, ForemanPipeline::Concerns::RepositoryExtension
|
54
|
+
::Katello::ContentViewRepository.send :include, ForemanPipeline::Concerns::ContentViewRepositoryExtension
|
55
|
+
::Katello::ContentView.send :include, ForemanPipeline::Concerns::ContentViewExtension
|
56
|
+
::Katello::KTEnvironment.send :include, ForemanPipeline::Concerns::KtEnvironmentExtension
|
57
|
+
::Hostgroup.send :include, ForemanPipeline::Concerns::HostgroupExtension
|
58
|
+
::ComputeResource.send :include, ForemanPipeline::Concerns::ComputeResourceExtension
|
59
|
+
end
|
60
|
+
|
61
|
+
rake_tasks do
|
62
|
+
load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_seed.rake"
|
63
|
+
load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_test.rake"
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jenkins_instances do
|
4
|
+
permission :view_jenkins_instances,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/jenkins_instances' => [:all, :index, :show],
|
7
|
+
'foreman_pipeline/api/jenkins_instances' => [:index, :show, :check_jenkins],
|
8
|
+
},
|
9
|
+
:resource_type => 'ForemanPipeline::JenkinsInstance'
|
10
|
+
permission :create_jenkins_instances,
|
11
|
+
{
|
12
|
+
'foreman_pipeline/api/jenkins_instances' => [:create],
|
13
|
+
},
|
14
|
+
:resource_type => 'ForemanPipeline::JenkinsInstance'
|
15
|
+
permission :edit_jenkins_instances,
|
16
|
+
{
|
17
|
+
'foreman_pipeline/api/jenkins_instances' => [:update, :set_jenkins_user],
|
18
|
+
},
|
19
|
+
:resource_type => 'ForemanPipeline::JenkinsInstance'
|
20
|
+
permission :destroy_jenkins_instances,
|
21
|
+
{
|
22
|
+
'foreman_pipeline/api/jenkins_instances' => [:destroy],
|
23
|
+
},
|
24
|
+
:resource_type => 'ForemanPipeline::JenkinsInstance'
|
25
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jenkins_project_params do
|
4
|
+
permission :edit_jenkins_project_params,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/api/jenkins_project_params' => [:update],
|
7
|
+
},
|
8
|
+
:resource_type => 'ForemanPipeline::JenkinsProjectParam'
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jenkins_projects do
|
4
|
+
permission :view_jenkins_projects,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/api/jenkins_projects' => [:show],
|
7
|
+
},
|
8
|
+
:resource_type => 'ForemanPipeline::JenkinsProject'
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jenkins_requests do
|
4
|
+
permission :view_jenkins_requests,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/api/jenkins_requests' => [:list],
|
7
|
+
},
|
8
|
+
:resource_type => 'ForemanPipeline::JenkinsProject'
|
9
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jenkins_users do
|
4
|
+
permission :view_jenkins_users,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/api/jenkins_users' => [:index, :show]
|
7
|
+
},
|
8
|
+
:resource_type => 'ForemanPipeline::JenkinsUser'
|
9
|
+
permission :create_jenkins_users,
|
10
|
+
{
|
11
|
+
'foreman_pipeline/api/jenkins_users' => [:create]
|
12
|
+
},
|
13
|
+
:resource_type => 'ForemanPipeline::JenkinsUser'
|
14
|
+
permission :edit_jenkins_users,
|
15
|
+
{
|
16
|
+
'foreman_pipeline/api/jenkins_users' => [:update]
|
17
|
+
},
|
18
|
+
:resource_type => 'ForemanPipeline::JenkinsUser'
|
19
|
+
permission :destroy_jenkins_users,
|
20
|
+
{
|
21
|
+
'foreman_pipeline/api/jenkins_users' => [:destroy]
|
22
|
+
},
|
23
|
+
:resource_type => 'ForemanPipeline::JenkinsUser'
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
Foreman::Plugin.find(:foreman_pipeline).security_block :jobs do
|
4
|
+
permission :view_jobs,
|
5
|
+
{
|
6
|
+
'foreman_pipeline/jobs' => [:all, :index, :show],
|
7
|
+
'foreman_pipeline/api/jobs' => [:index, :show, :available_paths, :available_resources],
|
8
|
+
},
|
9
|
+
:resource_type => 'ForemanPipeline::Job'
|
10
|
+
permission :create_jobs,
|
11
|
+
{
|
12
|
+
'foreman_pipeline/api/jobs' => [:create],
|
13
|
+
},
|
14
|
+
:resource_type => 'ForemanPipeline::Job'
|
15
|
+
permission :edit_jobs,
|
16
|
+
{
|
17
|
+
'foreman_pipeline/api/jobs' => [:update, :set_content_view, :set_hostgroup, :set_jenkins,
|
18
|
+
:set_environment, :set_resource, :set_to_environments, :run_job,
|
19
|
+
:add_projects, :remove_projects],
|
20
|
+
},
|
21
|
+
:resource_type => 'ForemanPipeline::Job'
|
22
|
+
permission :destroy_jobs,
|
23
|
+
{
|
24
|
+
'foreman_pipeline/api/jobs' => [:destroy],
|
25
|
+
},
|
26
|
+
:resource_type => 'ForemanPipeline::Job'
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Foreman::Plugin.register :foreman_pipeline do
|
2
|
+
|
3
|
+
sub_menu :top_menu, :foreman_pipeline_menu, :caption => N_('Pipeline') do
|
4
|
+
menu :top_menu,
|
5
|
+
:jobs,
|
6
|
+
:caption => N_("Jobs"),
|
7
|
+
:url => '/jobs',
|
8
|
+
:url_hash => {:controller => 'foreman_pipeline/api/jobs', :action => 'index'},
|
9
|
+
:engine => ForemanPipeline::Engine
|
10
|
+
menu :top_menu,
|
11
|
+
:jenkins_instances,
|
12
|
+
:caption => N_("Jenkins Instances"),
|
13
|
+
:url => '/jenkins_instances',
|
14
|
+
:url_hash => {:controller => 'foreman_pipeline/api/jenkins_instances', :action => 'index'},
|
15
|
+
:engine => ForemanPipeline::Engine
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'foreman_pipeline/plugin'
|
2
|
+
|
3
|
+
viewer_permissions = [:view_jobs, :view_jenkins_instances, :view_jenkins_users,
|
4
|
+
:view_jenkins_projects, :view_jenkins_requests]
|
5
|
+
manager_permissions = [:view_jobs, :edit_jobs, :destroy_jobs, :create_jobs,
|
6
|
+
:view_jenkins_instances, :edit_jenkins_instances, :destroy_jenkins_instances, :create_jenkins_instances,
|
7
|
+
:view_jenkins_users, :edit_jenkins_users, :destroy_jenkins_users, :create_jenkins_users,
|
8
|
+
:view_jenkins_projects,
|
9
|
+
:edit_jenkins_project_params,
|
10
|
+
:view_jenkins_requests]
|
11
|
+
|
12
|
+
Foreman::Plugin.find(:foreman_pipeline).send :role, "Pipeline viewer", viewer_permissions
|
13
|
+
Foreman::Plugin.find(:foreman_pipeline).send :role, "Pipeline manager", manager_permissions
|