foreman_acd 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +619 -0
- data/README.md +87 -0
- data/Rakefile +49 -0
- data/app/assets/javascripts/foreman_acd/acd_dummy.js +3 -0
- data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +55 -0
- data/app/controllers/foreman_acd/api/v2/base_controller.rb +16 -0
- data/app/controllers/foreman_acd/app_definitions_controller.rb +53 -0
- data/app/controllers/foreman_acd/app_instances_controller.rb +158 -0
- data/app/controllers/foreman_acd/application_controller.rb +10 -0
- data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +23 -0
- data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +23 -0
- data/app/controllers/ui_acd_controller.rb +30 -0
- data/app/models/foreman_acd/app_definition.rb +23 -0
- data/app/models/foreman_acd/app_instance.rb +21 -0
- data/app/views/foreman_acd/app_definitions/_form.html.erb +40 -0
- data/app/views/foreman_acd/app_definitions/edit.html.erb +11 -0
- data/app/views/foreman_acd/app_definitions/index.html.erb +27 -0
- data/app/views/foreman_acd/app_definitions/new.html.erb +10 -0
- data/app/views/foreman_acd/app_instances/_form.html.erb +46 -0
- data/app/views/foreman_acd/app_instances/edit.html.erb +11 -0
- data/app/views/foreman_acd/app_instances/index.html.erb +30 -0
- data/app/views/foreman_acd/app_instances/new.html.erb +11 -0
- data/app/views/ui_acd/app.json.rabl +9 -0
- data/app/views/ui_acd/app_definition.json.rabl +5 -0
- data/app/views/ui_acd/computeprofile.json.rabl +4 -0
- data/app/views/ui_acd/domain.json.rabl +4 -0
- data/app/views/ui_acd/environment.json.rabl +4 -0
- data/app/views/ui_acd/fdata.json.rabl +24 -0
- data/app/views/ui_acd/lifecycle_environment.json.rabl +4 -0
- data/app/views/ui_acd/ptable.json.rabl +4 -0
- data/config/routes.rb +24 -0
- data/db/migrate/20190610202252_create_app_definitions.rb +19 -0
- data/db/migrate/20190625140305_create_app_instances.rb +19 -0
- data/lib/foreman_acd/engine.rb +43 -0
- data/lib/foreman_acd/plugin.rb +80 -0
- data/lib/foreman_acd/version.rb +5 -0
- data/lib/foreman_acd.rb +7 -0
- data/lib/tasks/foreman_acd_tasks.rake +47 -0
- data/locale/Makefile +60 -0
- data/locale/en/foreman_acd.po +19 -0
- data/locale/foreman_acd.pot +19 -0
- data/locale/gemspec.rb +2 -0
- data/package.json +121 -0
- data/test/controllers/app_definitions_controller_test.rb +24 -0
- data/test/controllers/app_instances_controller_test.rb +24 -0
- data/test/controllers/ui_acd_controller_test.rb +26 -0
- data/test/factories/foreman_acd_factories.rb +17 -0
- data/test/models/app_definition_test.rb +11 -0
- data/test/models/app_instance_test.rb +8 -0
- data/test/test_plugin_helper.rb +8 -0
- data/webpack/__mocks__/foremanReact/components/common/forms/Select.js +2 -0
- data/webpack/components/ParameterSelection/ParameterSelection.js +468 -0
- data/webpack/components/ParameterSelection/ParameterSelection.scss +3 -0
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +294 -0
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +31 -0
- data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +52 -0
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +175 -0
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +15 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +162 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +194 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +127 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +48 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +150 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +47 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +454 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +2265 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +209 -0
- data/webpack/components/ParameterSelection/index.js +39 -0
- data/webpack/index.js +8 -0
- data/webpack/reducer.js +7 -0
- data/webpack/test_setup.js +11 -0
- metadata +206 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
<%
|
2
|
+
if @app_instance.app_definition_id.blank?
|
3
|
+
json = {
|
4
|
+
"mode": "newInstance",
|
5
|
+
"organization": current_organization,
|
6
|
+
"location": current_location,
|
7
|
+
"applications": @applications,
|
8
|
+
"loadParameterSelectionUrl": ui_acd_app_path("__id__"),
|
9
|
+
"loadForemanDataUrl": ui_acd_fdata_path("__id__"),
|
10
|
+
}
|
11
|
+
else
|
12
|
+
json = {
|
13
|
+
"mode": "editInstance",
|
14
|
+
"organization": current_organization,
|
15
|
+
"location": current_location,
|
16
|
+
"loadForemanDataUrl": ui_acd_fdata_path("__id__"),
|
17
|
+
"appDefinition": {
|
18
|
+
"id": @app_instance.app_definition.id,
|
19
|
+
"name": @app_instance.app_definition.name,
|
20
|
+
"hostgroup_id": @app_instance.app_definition.hostgroup_id,
|
21
|
+
},
|
22
|
+
"parameters": JSON.parse(@app_instance.parameters),
|
23
|
+
}
|
24
|
+
end
|
25
|
+
%>
|
26
|
+
|
27
|
+
<%= form_for @app_instance, :url => (@app_instance.new_record? ? app_instances_path : app_instance_path(:id => @app_instance.id)) do |f| %>
|
28
|
+
<%= base_errors_for @app_instance %>
|
29
|
+
<ul class="nav nav-tabs" data-tabs="tabs">
|
30
|
+
<li class="active"><a href="#primary" data-toggle="tab"><%= _('Application Instances') %></a></li>
|
31
|
+
</ul>
|
32
|
+
|
33
|
+
<div class="tab-content">
|
34
|
+
<div class="tab-pane active" id="primary">
|
35
|
+
<%= text_f f, :name %>
|
36
|
+
<%= text_f f, :description %>
|
37
|
+
|
38
|
+
<div id='param-selection'></div>
|
39
|
+
<%= mount_react_component('ParameterSelection', "#param-selection", json.to_json) %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<%= submit_or_cancel f %>
|
45
|
+
<% end %>
|
46
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% title(_('Edit Application Instance %s') % @app_instance) %>
|
2
|
+
|
3
|
+
<% content_for(:javascripts) do %>
|
4
|
+
<%= webpacked_plugins_js_for :foreman_acd %>
|
5
|
+
<% end %>
|
6
|
+
<% content_for(:stylesheets) do %>
|
7
|
+
<%= webpacked_plugins_css_for :foreman_acd %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= render :partial => 'form' %>
|
11
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<% title _('Application Instances') %>
|
2
|
+
|
3
|
+
<% title_actions button_group(new_link(_('New Application Instance'))) %>
|
4
|
+
|
5
|
+
<table class="table table-bordered table-striped">
|
6
|
+
<tr>
|
7
|
+
<th><%= sort :name, :as => s_('AppInstance|Name') %></th>
|
8
|
+
<th><%= sort :application, :as => _('Application'), :default => 'DESC' %></th>
|
9
|
+
<th><%= _('Description') %></th>
|
10
|
+
<th></th>
|
11
|
+
</tr>
|
12
|
+
<% for app_instance in @app_instances %>
|
13
|
+
<tr>
|
14
|
+
<td><%=link_to_if_authorized h(app_instance.name), hash_for_edit_app_instance_path(:id => app_instance).merge(:auth_object => app_instance, :authorizer => authorizer) %></td>
|
15
|
+
<td><%= app_instance.app_definition %></td>
|
16
|
+
<td><%= app_instance.description %></td>
|
17
|
+
<td>
|
18
|
+
<%= action_buttons(display_delete_if_authorized(hash_for_app_instance_path(:id => app_instance).merge(:auth_object => app_instance, :authorizer => authorizer),
|
19
|
+
:data => { 'confirm': _('Delete %s?') % app_instance.name }),
|
20
|
+
display_link_if_authorized(_("Deploy"), hash_for_deploy_app_instance_path(:id => app_instance), :method => :post,
|
21
|
+
:title => _("Deploy the application #{app_instance}"))
|
22
|
+
) %>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</table>
|
27
|
+
|
28
|
+
<%= page_entries_info @app_instances %>
|
29
|
+
<%= will_paginate @app_instances %>
|
30
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% title _('New Application Instance') %>
|
2
|
+
|
3
|
+
<% content_for(:javascripts) do %>
|
4
|
+
<%= webpacked_plugins_js_for :foreman_acd %>
|
5
|
+
<% end %>
|
6
|
+
<% content_for(:stylesheets) do %>
|
7
|
+
<%= webpacked_plugins_css_for :foreman_acd %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= render :partial => 'form' %>
|
11
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
object @fdata
|
4
|
+
attribute :hostgroup_id
|
5
|
+
|
6
|
+
child :environments => :environments do
|
7
|
+
extends 'ui_acd/environment'
|
8
|
+
end
|
9
|
+
|
10
|
+
child :lifecycle_environments => :lifecycle_environments do
|
11
|
+
extends 'ui_acd/lifecycle_environment'
|
12
|
+
end
|
13
|
+
|
14
|
+
child :domains => :domains do
|
15
|
+
extends 'ui_acd/domain'
|
16
|
+
end
|
17
|
+
|
18
|
+
child :computeprofiles => :computeprofiles do
|
19
|
+
extends 'ui_acd/computeprofile'
|
20
|
+
end
|
21
|
+
|
22
|
+
child :ptables => :ptables do
|
23
|
+
extends 'ui_acd/ptable'
|
24
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.routes.draw do
|
4
|
+
scope :acd, :path => '/acd' do
|
5
|
+
resources :app_definitions, :controller => 'foreman_acd/app_definitions' do
|
6
|
+
collection do
|
7
|
+
get 'auto_complete_search'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
resources :app_instances, :controller => 'foreman_acd/app_instances' do
|
12
|
+
collection do
|
13
|
+
get 'auto_complete_search'
|
14
|
+
end
|
15
|
+
|
16
|
+
member do
|
17
|
+
post 'deploy'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
get 'ui_acd_app/:id', :to => 'ui_acd#app', :constraints => { :id => /[\w\.-]+/ }, :as => :ui_acd_app
|
22
|
+
get 'ui_acd_fdata/:id', :to => 'ui_acd#fdata', :constraints => { :id => /[\w\.-]+/ }, :as => :ui_acd_fdata
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Adding app_definitions db table
|
4
|
+
class CreateAppDefinitions < ActiveRecord::Migration[5.2]
|
5
|
+
def up
|
6
|
+
create_table :app_definitions do |t|
|
7
|
+
t.string :name, :default => '', :null => false, :limit => 255, :unique => true
|
8
|
+
t.text :description
|
9
|
+
t.column :hostgroup_id, :integer
|
10
|
+
t.text :parameters
|
11
|
+
t.timestamps :null => true
|
12
|
+
end
|
13
|
+
add_foreign_key :app_definitions, :hostgroups
|
14
|
+
end
|
15
|
+
|
16
|
+
def down
|
17
|
+
drop_table :app_definitions
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Adding app_definitions db table
|
4
|
+
class CreateAppInstances < ActiveRecord::Migration[5.2]
|
5
|
+
def up
|
6
|
+
create_table :app_instances do |t|
|
7
|
+
t.string :name, :default => '', :null => false, :limit => 255, :unique => true
|
8
|
+
t.column :app_definition_id, :integer, :null => false
|
9
|
+
t.text :description
|
10
|
+
t.text :parameters
|
11
|
+
t.timestamps :null => true
|
12
|
+
end
|
13
|
+
add_foreign_key :app_instances, :app_definitions
|
14
|
+
end
|
15
|
+
|
16
|
+
def down
|
17
|
+
drop_table :app_instances
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ForemanAcd
|
4
|
+
# This engine connects ForemanAcd with Foreman core
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
engine_name 'foreman_acd'
|
7
|
+
|
8
|
+
config.autoload_paths += Dir["#{config.root}/app/controllers/foreman_acd/concerns"]
|
9
|
+
config.autoload_paths += Dir["#{config.root}/app/helpers"]
|
10
|
+
config.autoload_paths += Dir["#{config.root}/app/models/foreman_acd/concerns"]
|
11
|
+
config.autoload_paths += Dir["#{config.root}/app/models/parameters"]
|
12
|
+
config.autoload_paths += Dir["#{config.root}/app/overrides"]
|
13
|
+
config.autoload_paths += Dir["#{config.root}/app/services"]
|
14
|
+
config.autoload_paths += Dir["#{config.root}/app/lib"]
|
15
|
+
|
16
|
+
# Add any db migrations
|
17
|
+
initializer 'foreman_acd.load_app_instance_data' do |app|
|
18
|
+
ForemanAcd::Engine.paths['db/migrate'].existent.each do |path|
|
19
|
+
app.config.paths['db/migrate'] << path
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
initializer 'foreman_acd.apipie' do
|
24
|
+
Apipie.configuration.checksum_path += ['/acd/api/']
|
25
|
+
end
|
26
|
+
|
27
|
+
rake_tasks do
|
28
|
+
Rake::Task['db:seed'].enhance do
|
29
|
+
ForemanAcd::Engine.load_seed
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
initializer 'foreman_acd.register_gettext', :after => :load_config_initializers do
|
34
|
+
locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
|
35
|
+
locale_domain = 'foreman_acd'
|
36
|
+
Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
|
37
|
+
end
|
38
|
+
|
39
|
+
initializer 'foreman_acd.register_plugin', :before => :finisher_hook do
|
40
|
+
require 'foreman_acd/plugin'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Foreman::Plugin.register :foreman_acd do
|
4
|
+
requires_foreman '>= 1.19'
|
5
|
+
|
6
|
+
apipie_documented_controllers ["#{ForemanAcd::Engine.root}/app/controllers/foreman_acd/api/v2/*.rb"]
|
7
|
+
|
8
|
+
# Menus
|
9
|
+
divider :top_menu, :parent => :configure_menu, :caption => 'Applications'
|
10
|
+
menu :top_menu, :app_definitions,
|
11
|
+
:url_hash => { :controller => :'foreman_acd/app_definitions', :action => :index },
|
12
|
+
:caption => 'App Definitions',
|
13
|
+
:parent => :configure_menu
|
14
|
+
|
15
|
+
menu :top_menu, :app_instances,
|
16
|
+
:url_hash => { :controller => :'foreman_acd/app_instances', :action => :index },
|
17
|
+
:caption => 'App Instances',
|
18
|
+
:parent => :configure_menu
|
19
|
+
|
20
|
+
# Add permissions
|
21
|
+
security_block :foreman_acd do
|
22
|
+
permission :create_app_definitions,
|
23
|
+
{ :'foreman_acd/app_definitions' => [:new, :create],
|
24
|
+
:'foreman_acd/api/v2/app_definitions' => [:create] },
|
25
|
+
:resource_type => 'ForemanAcd::AppDefinition'
|
26
|
+
|
27
|
+
permission :view_app_definitions,
|
28
|
+
{ :'foreman_acd/app_definitions' => [:index, :show, :auto_complete_search],
|
29
|
+
:'foreman_acd/api/v2/app_definitions' => [:index, :show] },
|
30
|
+
:resource_type => 'ForemanAcd::AppDefinition'
|
31
|
+
|
32
|
+
permission :edit_app_definitions,
|
33
|
+
{ :'foreman_acd/app_definitions' => [:update, :edit],
|
34
|
+
:'foreman_acd/api/v2/app_definitions' => [:update] },
|
35
|
+
:resource_type => 'ForemanAcd::AppDefinition'
|
36
|
+
|
37
|
+
permission :destroy_app_definitions,
|
38
|
+
{ :'foreman_acd/app_definitions' => [:destroy],
|
39
|
+
:'foreman_acd/api/v2/app_definitions' => [:destroy] },
|
40
|
+
:resource_type => 'ForemanAcd::AppDefinition'
|
41
|
+
|
42
|
+
permission :create_app_instances,
|
43
|
+
{ :'foreman_acd/app_instances' => [:new, :create],
|
44
|
+
:'foreman_acd/api/v2/app_instances' => [:create] },
|
45
|
+
:resource_type => 'ForemanAcd::AppInstance'
|
46
|
+
|
47
|
+
permission :view_app_instances,
|
48
|
+
{ :'foreman_acd/app_instances' => [:index, :show, :auto_complete_search],
|
49
|
+
:'foreman_acd/api/v2/app_instances' => [:index, :show] },
|
50
|
+
:resource_type => 'ForemanAcd::AppInstance'
|
51
|
+
|
52
|
+
permission :edit_app_instances,
|
53
|
+
{ :'foreman_acd/app_instances' => [:update, :edit],
|
54
|
+
:'foreman_acd/api/v2/app_instances' => [:update] },
|
55
|
+
:resource_type => 'ForemanAcd::AppInstance'
|
56
|
+
|
57
|
+
permission :destroy_app_instances,
|
58
|
+
{ :'foreman_acd/app_instances' => [:destroy],
|
59
|
+
:'foreman_acd/api/v2/app_instances' => [:destroy] },
|
60
|
+
:resource_type => 'ForemanAcd::AppInstance'
|
61
|
+
|
62
|
+
permission :deploy_app_instances,
|
63
|
+
{ :'foreman_acd/app_instances' => [:deploy],
|
64
|
+
:'foreman_acd/api/v2/app_instances' => [:deploy] },
|
65
|
+
:resource_type => 'ForemanAcd::AppInstance'
|
66
|
+
end
|
67
|
+
|
68
|
+
# Manager Role
|
69
|
+
role 'Application Centric Deployment Manager', [:create_app_definitions,
|
70
|
+
:view_app_definitions,
|
71
|
+
:edit_app_definitions,
|
72
|
+
:destroy_app_definitions]
|
73
|
+
|
74
|
+
# User Role
|
75
|
+
role 'Application Centric Deployment User', [:create_app_instances,
|
76
|
+
:view_app_instances,
|
77
|
+
:edit_app_instances,
|
78
|
+
:destroy_app_instances,
|
79
|
+
:deploy_app_instances]
|
80
|
+
end
|
data/lib/foreman_acd.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
# Tasks
|
6
|
+
namespace :foreman_acd do
|
7
|
+
namespace :example do
|
8
|
+
desc 'Example Task'
|
9
|
+
task :task => :environment do
|
10
|
+
# Task goes here
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# Tests
|
16
|
+
namespace :test do
|
17
|
+
desc 'Test ForemanAcd'
|
18
|
+
Rake::TestTask.new(:foreman_acd) do |t|
|
19
|
+
test_dir = File.join(File.dirname(__FILE__), '../..', 'test')
|
20
|
+
t.libs << ['test', test_dir]
|
21
|
+
t.pattern = "#{test_dir}/**/*_test.rb"
|
22
|
+
t.verbose = true
|
23
|
+
t.warning = false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
namespace :foreman_acd do
|
28
|
+
task :rubocop do
|
29
|
+
begin
|
30
|
+
require 'rubocop/rake_task'
|
31
|
+
RuboCop::RakeTask.new(:rubocop_foreman_acd) do |task|
|
32
|
+
task.patterns = ["#{ForemanAcd::Engine.root}/app/**/*.rb",
|
33
|
+
"#{ForemanAcd::Engine.root}/lib/**/*.rb",
|
34
|
+
"#{ForemanAcd::Engine.root}/test/**/*.rb"]
|
35
|
+
end
|
36
|
+
rescue StandardError
|
37
|
+
puts 'Rubocop not loaded.'
|
38
|
+
end
|
39
|
+
|
40
|
+
Rake::Task['rubocop_foreman_acd'].invoke
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
Rake::Task[:test].enhance ['test:foreman_acd']
|
45
|
+
|
46
|
+
load 'tasks/jenkins.rake'
|
47
|
+
Rake::Task['jenkins:unit'].enhance ['test:foreman_acd', 'foreman_acd:rubocop'] if Rake::Task.task_defined?(:'jenkins:unit')
|
data/locale/Makefile
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#
|
2
|
+
# Makefile for PO merging and MO generation. More info in the README.
|
3
|
+
#
|
4
|
+
# make all-mo (default) - generate MO files
|
5
|
+
# make check - check translations using translate-tool
|
6
|
+
# make tx-update - download and merge translations from Transifex
|
7
|
+
# make clean - clean everything
|
8
|
+
#
|
9
|
+
DOMAIN = foreman_acd
|
10
|
+
VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load(Dir.glob("../*.gemspec")[0]);puts spec.version')
|
11
|
+
POTFILE = $(DOMAIN).pot
|
12
|
+
MOFILE = $(DOMAIN).mo
|
13
|
+
POFILES = $(shell find . -name '$(DOMAIN).po')
|
14
|
+
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
|
15
|
+
POXFILES = $(patsubst %.po,%.pox,$(POFILES))
|
16
|
+
EDITFILES = $(patsubst %.po,%.edit.po,$(POFILES))
|
17
|
+
|
18
|
+
%.mo: %.po
|
19
|
+
mkdir -p $(shell dirname $@)/LC_MESSAGES
|
20
|
+
msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
|
21
|
+
|
22
|
+
# Generate MO files from PO files
|
23
|
+
all-mo: $(MOFILES)
|
24
|
+
|
25
|
+
# Check for malformed strings
|
26
|
+
%.pox: %.po
|
27
|
+
msgfmt -c $<
|
28
|
+
pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \
|
29
|
+
-t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@
|
30
|
+
cat $@
|
31
|
+
! grep -q msgid $@
|
32
|
+
|
33
|
+
%.edit.po:
|
34
|
+
touch $@
|
35
|
+
|
36
|
+
check: $(POXFILES)
|
37
|
+
|
38
|
+
# Unify duplicate translations
|
39
|
+
uniq-po:
|
40
|
+
for f in $(shell find ./ -name "*.po") ; do \
|
41
|
+
msguniq $$f -o $$f ; \
|
42
|
+
done
|
43
|
+
|
44
|
+
tx-pull: $(EDITFILES)
|
45
|
+
tx pull -f
|
46
|
+
for f in $(EDITFILES) ; do \
|
47
|
+
sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
|
48
|
+
done
|
49
|
+
|
50
|
+
tx-update: tx-pull
|
51
|
+
@echo
|
52
|
+
@echo Run rake plugin:gettext[$(DOMAIN)] from the Foreman installation, then make -C locale mo-files to finish
|
53
|
+
@echo
|
54
|
+
|
55
|
+
mo-files: $(MOFILES)
|
56
|
+
git add $(POFILES) $(POTFILE) ../locale/*/LC_MESSAGES
|
57
|
+
git commit -m "i18n - pulling from tx"
|
58
|
+
@echo
|
59
|
+
@echo Changes commited!
|
60
|
+
@echo
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# foreman_acd
|
2
|
+
#
|
3
|
+
# This file is distributed under the same license as foreman_acd.
|
4
|
+
#
|
5
|
+
#, fuzzy
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: version 0.0.1\n"
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
10
|
+
"POT-Creation-Date: 2014-08-20 08:46+0100\n"
|
11
|
+
"PO-Revision-Date: 2014-08-20 08:54+0100\n"
|
12
|
+
"Last-Translator: Foreman Team <foreman-dev@googlegroups.com>\n"
|
13
|
+
"Language-Team: Foreman Team <foreman-dev@googlegroups.com>\n"
|
14
|
+
"Language: \n"
|
15
|
+
"MIME-Version: 1.0\n"
|
16
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
17
|
+
"Content-Transfer-Encoding: 8bit\n"
|
18
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# foreman_acd
|
2
|
+
#
|
3
|
+
# This file is distributed under the same license as foreman_acd.
|
4
|
+
#
|
5
|
+
#, fuzzy
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: version 0.0.1\n"
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
10
|
+
"POT-Creation-Date: 2014-08-20 08:46+0100\n"
|
11
|
+
"PO-Revision-Date: 2014-08-20 08:46+0100\n"
|
12
|
+
"Last-Translator: Foreman Team <foreman-dev@googlegroups.com>\n"
|
13
|
+
"Language-Team: Foreman Team <foreman-dev@googlegroups.com>\n"
|
14
|
+
"Language: \n"
|
15
|
+
"MIME-Version: 1.0\n"
|
16
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
17
|
+
"Content-Transfer-Encoding: 8bit\n"
|
18
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
19
|
+
|
data/locale/gemspec.rb
ADDED
data/package.json
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
{
|
2
|
+
"name": "foreman_acd",
|
3
|
+
"version": "0.5.0",
|
4
|
+
"description": "foreman application centric deployment",
|
5
|
+
"main": "index.js",
|
6
|
+
"directories": {
|
7
|
+
"test": "test"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"jquery": "~2.2.4",
|
11
|
+
"c3": "^0.4.11",
|
12
|
+
"humanize-duration": "^3.20.1",
|
13
|
+
"react-intl": "^2.8.0"
|
14
|
+
},
|
15
|
+
"devDependencies": {
|
16
|
+
"@storybook/addon-actions": "^5.0.1",
|
17
|
+
"@storybook/addon-knobs": "^5.0.1",
|
18
|
+
"@storybook/react": "^5.0.1",
|
19
|
+
"@theforeman/vendor-dev": "^1.4.0",
|
20
|
+
"classnames": "^2.2.5",
|
21
|
+
"babel-eslint": "^8.2.1",
|
22
|
+
"babel-jest": "^23.6.0",
|
23
|
+
"babel-loader": "^7.1.1",
|
24
|
+
"babel-plugin-dynamic-import-node": "^2.0.0",
|
25
|
+
"babel-plugin-module-resolver": "^3.2.0",
|
26
|
+
"babel-plugin-lodash": "^3.3.2",
|
27
|
+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
28
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
29
|
+
"babel-plugin-transform-object-assign": "^6.22.0",
|
30
|
+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
31
|
+
"babel-polyfill": "^6.26.0",
|
32
|
+
"babel-preset-env": "^1.6.0",
|
33
|
+
"babel-preset-react": "^6.5.0",
|
34
|
+
"enzyme": "^3.7.0",
|
35
|
+
"enzyme-adapter-react-16": "^1.4.0",
|
36
|
+
"enzyme-to-json": "^3.2.1",
|
37
|
+
"eslint": "^4.18.1",
|
38
|
+
"eslint-config-airbnb": "^16.0.0",
|
39
|
+
"eslint-plugin-import": "^2.8.0",
|
40
|
+
"eslint-plugin-jest": "^21.2.0",
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.0.2",
|
42
|
+
"eslint-plugin-patternfly-react": "^0.2.1",
|
43
|
+
"eslint-plugin-react": "^7.4.0",
|
44
|
+
"identity-obj-proxy": "^3.0.0",
|
45
|
+
"lodash": "^4.17.11",
|
46
|
+
"jest-cli": "^23.6.0",
|
47
|
+
"jest-prop-type-error": "^1.1.0",
|
48
|
+
"patternfly": "^3.58.0",
|
49
|
+
"patternfly-react": "^2.31.0",
|
50
|
+
"prettier": "^1.16.4",
|
51
|
+
"prop-types": "^15.6.2",
|
52
|
+
"react": "^16.8.1",
|
53
|
+
"react-redux": "^5.0.7",
|
54
|
+
"react-redux-test-utils": "^0.1.1",
|
55
|
+
"react-bootstrap": "^0.32.1",
|
56
|
+
"react-dom": "^16.6.3",
|
57
|
+
"react-json-tree": "^0.11.0",
|
58
|
+
"redux": "^3.7.2",
|
59
|
+
"redux-thunk": "^2.3.0",
|
60
|
+
"reselect": "^3.0.1",
|
61
|
+
"seamless-immutable": "^7.1.3",
|
62
|
+
"sortabular": "~1.5.1",
|
63
|
+
"table-resolver": "~3.3.0"
|
64
|
+
},
|
65
|
+
"scripts": {
|
66
|
+
"test": "node node_modules/.bin/jest --no-cache"
|
67
|
+
},
|
68
|
+
"repository": {
|
69
|
+
"type": "git",
|
70
|
+
"url": "git+https://github.com/ATIX-AG/foreman_acd.git"
|
71
|
+
},
|
72
|
+
"author": "",
|
73
|
+
"license": "ISC",
|
74
|
+
"bugs": {
|
75
|
+
"url": "https://atix.de"
|
76
|
+
},
|
77
|
+
"homepage": "https://atix.de",
|
78
|
+
"jest": {
|
79
|
+
"verbose": true,
|
80
|
+
"testMatch": [
|
81
|
+
"**/*.test.js"
|
82
|
+
],
|
83
|
+
"testPathIgnorePatterns": [
|
84
|
+
".local",
|
85
|
+
".bundle",
|
86
|
+
"/node_modules/",
|
87
|
+
"<rootDir>/foreman/"
|
88
|
+
],
|
89
|
+
"moduleDirectories": [
|
90
|
+
"node_modules",
|
91
|
+
"webpack"
|
92
|
+
],
|
93
|
+
"testURL": "http://localhost/",
|
94
|
+
"collectCoverage": true,
|
95
|
+
"collectCoverageFrom": [
|
96
|
+
"webpack/**/*.js",
|
97
|
+
"!webpack/index.js",
|
98
|
+
"!webpack/test_setup.js",
|
99
|
+
"!webpack/**/bundle*",
|
100
|
+
"!webpack/stories/**",
|
101
|
+
"!webpack/**/*stories.js"
|
102
|
+
],
|
103
|
+
"coverageReporters": [
|
104
|
+
"lcov"
|
105
|
+
],
|
106
|
+
"moduleNameMapper": {
|
107
|
+
"^.+\\.(png|gif|css|scss)$": "identity-obj-proxy"
|
108
|
+
},
|
109
|
+
"globals": {
|
110
|
+
"__testing__": true
|
111
|
+
},
|
112
|
+
"transform": {
|
113
|
+
"^.+\\.js$": "babel-jest"
|
114
|
+
},
|
115
|
+
"setupFiles": [
|
116
|
+
"raf/polyfill",
|
117
|
+
"jest-prop-type-error",
|
118
|
+
"./webpack/test_setup.js"
|
119
|
+
]
|
120
|
+
}
|
121
|
+
}
|