uffizzi_core 0.1.3 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/clients/uffizzi_core/docker_hub_client.rb +2 -0
- data/app/clients/uffizzi_core/github_container_registry_client/request_result.rb +7 -0
- data/app/clients/uffizzi_core/github_container_registry_client.rb +52 -0
- data/app/controllers/concerns/uffizzi_core/dependency_injection_concern.rb +2 -2
- data/app/controllers/uffizzi_core/api/cli/v1/account/credentials_controller.rb +45 -9
- data/app/controllers/uffizzi_core/api/cli/v1/projects/compose_files_controller.rb +2 -2
- data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/application_controller.rb +1 -1
- data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb +41 -10
- data/app/controllers/uffizzi_core/api/cli/v1/projects/secrets_controller.rb +18 -26
- data/app/controllers/uffizzi_core/application_controller.rb +9 -3
- data/app/errors/uffizzi_core/deployment/image_pull_error.rb +10 -0
- data/app/forms/uffizzi_core/api/cli/v1/account/credential/check_credential_form.rb +16 -0
- data/app/forms/uffizzi_core/api/cli/v1/account/credential/create_form.rb +1 -1
- data/app/forms/uffizzi_core/api/cli/v1/compose_file/check_credentials_form.rb +2 -2
- data/app/forms/uffizzi_core/api/cli/v1/compose_file/cli_form.rb +1 -18
- data/app/forms/uffizzi_core/api/cli/v1/compose_file/template_form.rb +1 -1
- data/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb +90 -0
- data/app/forms/uffizzi_core/api/cli/v1/project/update_form.rb +1 -31
- data/app/forms/uffizzi_core/api/cli/v1/secret/bulk_assign_form.rb +39 -0
- data/app/jobs/uffizzi_core/deployment/manage_deploy_activity_item_job.rb +22 -3
- data/app/lib/uffizzi_core/rbac/user_access_service.rb +12 -14
- data/app/models/uffizzi_core/account.rb +1 -19
- data/app/models/uffizzi_core/activity_item.rb +1 -6
- data/app/models/uffizzi_core/build.rb +1 -1
- data/app/models/uffizzi_core/comment.rb +1 -1
- data/app/models/uffizzi_core/compose_file.rb +1 -1
- data/app/models/uffizzi_core/config_file.rb +1 -1
- data/app/models/uffizzi_core/container.rb +1 -1
- data/app/models/uffizzi_core/container_config_file.rb +1 -1
- data/app/models/uffizzi_core/coupon.rb +1 -1
- data/app/models/uffizzi_core/credential/github_container_registry.rb +4 -0
- data/app/models/uffizzi_core/credential.rb +3 -6
- data/app/models/uffizzi_core/deployment.rb +11 -2
- data/app/models/uffizzi_core/event.rb +1 -1
- data/app/models/uffizzi_core/invitation.rb +1 -1
- data/app/models/uffizzi_core/membership.rb +1 -1
- data/app/models/uffizzi_core/payment.rb +1 -1
- data/app/models/uffizzi_core/price.rb +1 -1
- data/app/models/uffizzi_core/product.rb +1 -1
- data/app/models/uffizzi_core/project.rb +5 -11
- data/app/models/uffizzi_core/rating.rb +1 -1
- data/app/models/uffizzi_core/repo/github_container_registry.rb +4 -0
- data/app/models/uffizzi_core/repo.rb +1 -11
- data/app/models/uffizzi_core/role.rb +2 -2
- data/app/models/uffizzi_core/secret.rb +9 -0
- data/app/models/uffizzi_core/template.rb +1 -1
- data/app/models/uffizzi_core/user.rb +1 -1
- data/app/models/uffizzi_core/user_project.rb +1 -1
- data/app/policies/uffizzi_core/api/cli/v1/account/credentials_policy.rb +8 -0
- data/app/policies/uffizzi_core/api/cli/v1/projects/deployments_policy.rb +4 -0
- data/app/repositories/uffizzi_core/credential_repo.rb +17 -22
- data/app/repositories/uffizzi_core/deployment_repo.rb +1 -0
- data/app/serializers/uffizzi_core/api/cli/v1/projects/deployment_serializer/container_serializer.rb +8 -0
- data/app/serializers/uffizzi_core/api/cli/v1/projects/secret_serializer.rb +5 -0
- data/app/serializers/uffizzi_core/controller/apply_config_file/config_file_serializer.rb +5 -0
- data/app/serializers/uffizzi_core/controller/create_credential/credential_serializer.rb +7 -3
- data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer/container_config_file_serializer/config_file_serializer.rb +8 -0
- data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer/container_config_file_serializer.rb +7 -0
- data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer.rb +4 -3
- data/app/services/uffizzi_core/activity_item_service.rb +16 -26
- data/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb +11 -18
- data/app/services/uffizzi_core/compose_file/container_service.rb +13 -9
- data/app/services/uffizzi_core/compose_file/dependencies_service.rb +1 -0
- data/app/services/uffizzi_core/compose_file/services_options_service.rb +2 -2
- data/app/services/uffizzi_core/compose_file_service.rb +148 -0
- data/app/services/uffizzi_core/container_service.rb +1 -16
- data/app/services/uffizzi_core/controller_service.rb +7 -1
- data/app/services/uffizzi_core/credential_service.rb +2 -2
- data/app/services/uffizzi_core/deployment_service.rb +28 -7
- data/app/services/uffizzi_core/github_container_registry/credential_service.rb +24 -0
- data/app/services/uffizzi_core/manage_activity_items_service.rb +4 -19
- data/app/services/uffizzi_core/repo_service.rb +2 -137
- data/app/services/uffizzi_core/user_generator_service.rb +78 -0
- data/config/locales/en.activerecord.yml +5 -0
- data/config/locales/en.yml +4 -1
- data/config/routes.rb +6 -2
- data/db/migrate/20220309110201_remove_secrets_from_projects.rb +7 -0
- data/db/migrate/20220310110150_create_project_secrets.rb +14 -0
- data/db/migrate/20220329123323_rename_project_secrets_to_secrets.rb +7 -0
- data/db/migrate/20220329124542_add_resource_to_secrets.rb +7 -0
- data/db/migrate/20220329143241_remove_project_ref_from_secrets.rb +7 -0
- data/lib/tasks/uffizzi_core_tasks.rake +5 -0
- data/lib/uffizzi_core/engine.rb +35 -0
- data/lib/uffizzi_core/version.rb +1 -1
- data/lib/uffizzi_core.rb +1 -30
- data/swagger/v1/swagger.json +220 -11
- metadata +40 -21
- data/app/clients/uffizzi_core/github/app_client.rb +0 -19
- data/app/clients/uffizzi_core/github/installation_client.rb +0 -11
- data/app/clients/uffizzi_core/github/user_client.rb +0 -51
- data/app/errors/uffizzi_core/compose_file/not_found_error.rb +0 -4
- data/app/forms/uffizzi_core/api/cli/v1/project/delete_secret_form.rb +0 -27
- data/app/jobs/uffizzi_core/deployment/send_github_preview_message_job.rb +0 -13
- data/app/services/uffizzi_core/cli/compose_file_service.rb +0 -203
- data/app/services/uffizzi_core/compose_file/builders/github_repo_builder_service.rb +0 -59
- data/app/services/uffizzi_core/compose_file/services_options/build_service.rb +0 -93
- data/app/services/uffizzi_core/compose_file/update_service.rb +0 -29
- data/app/services/uffizzi_core/github/app_service.rb +0 -51
- data/app/services/uffizzi_core/github/credential_service.rb +0 -124
- data/app/services/uffizzi_core/github/message_service.rb +0 -20
- data/app/services/uffizzi_core/github_service.rb +0 -28
- data/app/services/uffizzi_core/user_access_service.rb +0 -14
@@ -1,58 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module UffizziCore::RepoService
|
4
|
-
AVAILABLE_KINDS = [
|
5
|
-
{
|
6
|
-
name: :buildpacks18,
|
7
|
-
detect: proc { |**_args| { available: true, args: [] } },
|
8
|
-
},
|
9
|
-
{
|
10
|
-
name: :dockerfile,
|
11
|
-
detect: proc { |**args|
|
12
|
-
has_dockerfiles = args[:dockerfiles].is_a?(Array) && !args[:dockerfiles].empty?
|
13
|
-
multiple_dockerfiles = has_dockerfiles && args[:dockerfiles].length > 1
|
14
|
-
|
15
|
-
{
|
16
|
-
available: has_dockerfiles,
|
17
|
-
args: multiple_dockerfiles ? { name: :dockerfile, type: :select, options: args[:dockerfiles] } : [],
|
18
|
-
}
|
19
|
-
},
|
20
|
-
},
|
21
|
-
{
|
22
|
-
name: :dotnet,
|
23
|
-
detect: proc { |**args|
|
24
|
-
has_app_runtimes = args[:dotnetruntimes].is_a?(Array) && !args[:dotnetruntimes].empty?
|
25
|
-
multiple_app_runtimes = has_app_runtimes && args[:dotnetruntimes].length > 1
|
26
|
-
has_csproj = args[:csproj].present?
|
27
|
-
|
28
|
-
{
|
29
|
-
available: has_app_runtimes || has_csproj,
|
30
|
-
args: multiple_app_runtimes ? { name: :dotnetruntimes, type: :select, options: args[:dotnetruntimes] } : [],
|
31
|
-
}
|
32
|
-
},
|
33
|
-
},
|
34
|
-
{
|
35
|
-
name: :gatsby,
|
36
|
-
detect: proc { |**args| { available: args[:gatsbyconfig].present?, args: [] } },
|
37
|
-
}, {
|
38
|
-
name: :barestatic,
|
39
|
-
detect: proc { |**args|
|
40
|
-
{ available: args[:barestatic].present? && args.filter_map do |k, v|
|
41
|
-
![:barestatic, :dockerfiles].include?(k) && v.present?
|
42
|
-
end.blank?, args: [] }
|
43
|
-
},
|
44
|
-
}
|
45
|
-
].freeze
|
46
|
-
|
47
4
|
class << self
|
48
|
-
def nodejs_static?(repo)
|
49
|
-
repo.gatsby? || repo.barestatic?
|
50
|
-
end
|
51
|
-
|
52
|
-
def cnb?(repo)
|
53
|
-
repo.buildpacks18? || repo.dotnet? || nodejs_static?(repo)
|
54
|
-
end
|
55
|
-
|
56
5
|
def needs_target_port?(repo)
|
57
6
|
return false if repo.nil?
|
58
7
|
|
@@ -63,8 +12,8 @@ module UffizziCore::RepoService
|
|
63
12
|
credentials = repo.project.account.credentials
|
64
13
|
|
65
14
|
case repo.type
|
66
|
-
when UffizziCore::Repo::
|
67
|
-
credentials.
|
15
|
+
when UffizziCore::Repo::GithubContainerRegistry.name
|
16
|
+
credentials.github_container_registry.first
|
68
17
|
when UffizziCore::Repo::DockerHub.name
|
69
18
|
credentials.docker_hub.first
|
70
19
|
when UffizziCore::Repo::Azure.name
|
@@ -90,89 +39,5 @@ module UffizziCore::RepoService
|
|
90
39
|
|
91
40
|
"#{repo_credential.registry_url}/#{image_name(repo)}"
|
92
41
|
end
|
93
|
-
|
94
|
-
def select_default_from(meta)
|
95
|
-
return :gatsby if meta[:gatsby][:available]
|
96
|
-
return :dotnet if meta[:dotnet][:available]
|
97
|
-
return :barestatic if meta[:barestatic][:available]
|
98
|
-
|
99
|
-
:buildpacks18
|
100
|
-
end
|
101
|
-
|
102
|
-
def available_repo_kinds(repository_id:, branch:, credential:)
|
103
|
-
detections = {
|
104
|
-
dotnetruntimes: [],
|
105
|
-
gatsbyconfig: false,
|
106
|
-
csproj: false,
|
107
|
-
|
108
|
-
go: false,
|
109
|
-
ruby: false,
|
110
|
-
node: false,
|
111
|
-
python: false,
|
112
|
-
java: false,
|
113
|
-
php: false,
|
114
|
-
barestatic: false,
|
115
|
-
}
|
116
|
-
contents = fetch_contents(credential, repository_id, branch)
|
117
|
-
repo_contents = contents[:repo_contents]
|
118
|
-
detections[:dotnetruntimes] = repo_contents.filter_map do |f|
|
119
|
-
(f.name =~ /^(.+\.)?runtime\.json/ || f.name == 'runtime.template.json') && f.name
|
120
|
-
end
|
121
|
-
detections[:csproj] = repo_contents.filter_map do |f|
|
122
|
-
f.name =~ /^.+\.csproj/ && f.name
|
123
|
-
end
|
124
|
-
detections[:go] = has_go_files?(contents)
|
125
|
-
|
126
|
-
[[:ruby, ['Gemfile']],
|
127
|
-
[:node, ['package.json']],
|
128
|
-
[:python, ['requirements.txt', 'setup.py', 'Pipfile']],
|
129
|
-
[:java, ['pom.xml', 'pom.atom', 'pom.clj', 'pom.groovy', 'pom.rb', 'pom.scala', 'pom.yaml', 'pom.yml']],
|
130
|
-
[:php, ['composer.json', 'index.php']],
|
131
|
-
[:gatsbyconfig, ['gatsby-config.js']],
|
132
|
-
[:barestatic, ['index.html', 'index.htm', 'Default.htm']]].each do |lang|
|
133
|
-
detections[lang[0]] = repo_contents.filter_map do |f|
|
134
|
-
lang[1].include?(f.name)
|
135
|
-
end.present?
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def filter_available_repo_kinds
|
140
|
-
kinds = AVAILABLE_KINDS.filter_map do |kind|
|
141
|
-
detection = kind[:detect].call(detections)
|
142
|
-
|
143
|
-
kind.merge(detection).except(:detect)
|
144
|
-
end.map { |kind| [kind[:name], kind.except(:name)] }.to_h
|
145
|
-
|
146
|
-
kinds.merge({ default: select_default_from(kinds) })
|
147
|
-
end
|
148
|
-
|
149
|
-
def fetch_contents(credential, repository_id, branch)
|
150
|
-
repo_contents = UffizziCore::Github::CredentialService.contents(credential, repository_id, ref: branch)
|
151
|
-
return filter_available_repo_kinds if repo_contents.empty?
|
152
|
-
|
153
|
-
if repo_contents.filter_map { |f| f.name == 'Godeps' }.present?
|
154
|
-
godeps_contents = UffizziCore::Github::CredentialService.contents(credential, repository_id, path: 'Godeps/', ref: branch)
|
155
|
-
end
|
156
|
-
|
157
|
-
if repo_contents.filter_map { |f| f.name == 'vendor' }.present? && godeps_contents.nil?
|
158
|
-
govendor_contents = UffizziCore::Github::CredentialService.contents(credential, repository_id, path: 'vendor/', ref: branch)
|
159
|
-
end
|
160
|
-
|
161
|
-
{
|
162
|
-
repo_contents: repo_contents,
|
163
|
-
godeps_contents: godeps_contents,
|
164
|
-
govendor_contents: govendor_contents,
|
165
|
-
}
|
166
|
-
end
|
167
|
-
|
168
|
-
def go(contents)
|
169
|
-
contents[:repo_contents].filter_map do |f|
|
170
|
-
['go.mod', 'Gopkg.lock', 'glide.yaml'].include?(f.name)
|
171
|
-
end.present? || contents[:godeps_contents]&.filter_map do |f|
|
172
|
-
f.name == 'Godeps.json'
|
173
|
-
end.present? || contents[:govendor_contents]&.filter_map do |f|
|
174
|
-
f.name == 'vendor.json'
|
175
|
-
end.present?
|
176
|
-
end
|
177
42
|
end
|
178
43
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class UffizziCore::UserGeneratorService
|
4
|
+
DEFAULT_USER_EMAIL = 'user@example.com'
|
5
|
+
DEFAULT_PROJECT_NAME = 'default'
|
6
|
+
DEFAULT_ACCOUNT_NAME = 'default'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def generate(email, password, project_name)
|
10
|
+
user_attributes = build_user_attributes(email, password)
|
11
|
+
project_attributes = build_project_attributes(project_name)
|
12
|
+
|
13
|
+
ActiveRecord::Base.transaction do
|
14
|
+
user = UffizziCore::User.create!(user_attributes)
|
15
|
+
|
16
|
+
account_attributes = build_account_attributes(user)
|
17
|
+
account = UffizziCore::Account.create!(account_attributes)
|
18
|
+
user.memberships.create!(account: account, role: UffizziCore::Membership.role.admin)
|
19
|
+
project = account.projects.create!(project_attributes)
|
20
|
+
project.user_projects.create!(user: user, role: UffizziCore::UserProject.role.admin)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def build_user_attributes(email, password)
|
27
|
+
user_attributes = {
|
28
|
+
state: UffizziCore::User::STATE_ACTIVE,
|
29
|
+
creation_source: UffizziCore::User.creation_source.system,
|
30
|
+
}
|
31
|
+
|
32
|
+
if email.present?
|
33
|
+
user_attributes[:email] = email
|
34
|
+
else
|
35
|
+
IO::console.write("Enter User Email (default: #{DEFAULT_USER_EMAIL}): ")
|
36
|
+
user_attributes[:email] = IO::console.gets.strip.presence || DEFAULT_USER_EMAIL
|
37
|
+
end
|
38
|
+
|
39
|
+
user_attributes[:password] = if password.present?
|
40
|
+
password
|
41
|
+
else
|
42
|
+
IO::console.getpass('Enter Password: ')
|
43
|
+
end
|
44
|
+
|
45
|
+
abort('password can\'t be blank') if user_attributes[:password].blank?
|
46
|
+
|
47
|
+
user_attributes
|
48
|
+
end
|
49
|
+
|
50
|
+
def build_project_attributes(project_name)
|
51
|
+
project_attributes = {
|
52
|
+
state: UffizziCore::Project::STATE_ACTIVE,
|
53
|
+
}
|
54
|
+
if project_name.present?
|
55
|
+
project_attributes[:name] = project_name
|
56
|
+
else
|
57
|
+
IO::console.write("Enter Project Name (default: #{DEFAULT_PROJECT_NAME}): ")
|
58
|
+
project_attributes[:name] = IO::console.gets.strip.presence || DEFAULT_PROJECT_NAME
|
59
|
+
end
|
60
|
+
|
61
|
+
project_attributes[:slug] = prepare_project_slug(project_attributes[:name])
|
62
|
+
project_attributes
|
63
|
+
end
|
64
|
+
|
65
|
+
def build_account_attributes(user)
|
66
|
+
{
|
67
|
+
owner: user,
|
68
|
+
name: DEFAULT_ACCOUNT_NAME,
|
69
|
+
state: UffizziCore::Account::STATE_ACTIVE,
|
70
|
+
kind: UffizziCore::Account.kind.organizational,
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
def prepare_project_slug(project_name)
|
75
|
+
project_name.downcase.gsub(/[^A-Za-z0-9]/, '-')
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -16,3 +16,8 @@ en:
|
|
16
16
|
incorrect: We were unable to log you in to docker registry. Please verify that your username and password are correct.
|
17
17
|
type:
|
18
18
|
exist: Credential of that type already exist.
|
19
|
+
uffizzi_core/deployment:
|
20
|
+
attributes:
|
21
|
+
containers:
|
22
|
+
max_memory_limit_error: 'Memory limit of containers must be less than %{max}'
|
23
|
+
max_memory_request_error: 'Memory request of containers must be less than %{max}'
|
data/config/locales/en.yml
CHANGED
@@ -55,7 +55,10 @@ en:
|
|
55
55
|
global_secret_not_found: undefined secret '%{secret}'
|
56
56
|
project_secret_not_found: Project secret '%{secret}' not found
|
57
57
|
continuous_preview_in_service_level: The option '%{option}' is not supported for service-level. Use 'x-uffizzi-continuous-preview' instead
|
58
|
-
file_already_exists: A compose file already exists for this project. Run 'uffizzi compose update' to update this file or 'uffizzi compose rm' to remove it. For more options, see 'uffizzi compose --help'
|
58
|
+
file_already_exists: A compose file already exists for this project. Run 'uffizzi compose update' to update this file or 'uffizzi compose rm' to remove it. For more options, see 'uffizzi compose --help'
|
59
|
+
invalid_healthcheck_command: "Service '%{name}' defines an invalid healthcheck: when 'test' is a list the first item must be either NONE, CMD or CMD-SHELL"
|
60
|
+
string_or_array_error: "'%{option}' contains an invalid type, it should be a string, or an array"
|
61
|
+
not_implemented: "'%{option}' option is not implemented"
|
59
62
|
secrets:
|
60
63
|
duplicates_exists: Secret with key %{secrets} already exist.
|
61
64
|
invalid_key_length: A secret key must be no longer than 256 characters.
|
data/config/routes.rb
CHANGED
@@ -18,7 +18,7 @@ UffizziCore::Engine.routes.draw do
|
|
18
18
|
resources :projects, only: ['index'], param: :slug do
|
19
19
|
scope module: :projects do
|
20
20
|
resource :compose_file, only: ['show', 'create', 'destroy']
|
21
|
-
resources :deployments, only: ['index', 'show', 'create', 'destroy'] do
|
21
|
+
resources :deployments, only: ['index', 'show', 'create', 'destroy', 'update'] do
|
22
22
|
post :deploy_containers, on: :member
|
23
23
|
scope module: :deployments do
|
24
24
|
resources :activity_items, only: ['index']
|
@@ -46,7 +46,11 @@ UffizziCore::Engine.routes.draw do
|
|
46
46
|
|
47
47
|
resource :account, only: [] do
|
48
48
|
scope module: :account do
|
49
|
-
resources :credentials, only: ['create', 'destroy'], param: :type
|
49
|
+
resources :credentials, only: ['index', 'create', 'destroy'], param: :type do
|
50
|
+
member do
|
51
|
+
get :check_credential
|
52
|
+
end
|
53
|
+
end
|
50
54
|
end
|
51
55
|
end
|
52
56
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateProjectSecrets < ActiveRecord::Migration[6.1]
|
4
|
+
def change
|
5
|
+
create_table('uffizzi_core_project_secrets', force: :cascade) do |t|
|
6
|
+
t.bigint('project_id', null: false)
|
7
|
+
t.string('name')
|
8
|
+
t.string('value')
|
9
|
+
t.datetime('created_at', precision: 6, null: false)
|
10
|
+
t.datetime('updated_at', precision: 6, null: false)
|
11
|
+
t.index(['project_id'], name: 'index_project_secrets_on_project_id')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -11,4 +11,9 @@ namespace :uffizzi_core do
|
|
11
11
|
Rake::Task['app:uffizzi_core:install:migrations'].invoke
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
desc 'Create a new user'
|
16
|
+
task create_user: :environment do
|
17
|
+
UffizziCore::UserGeneratorService.generate(ENV['UFFIZZI_USER_EMAIL'], ENV['UFFIZZI_USER_PASSWORD'], ENV['UFFIZZI_PROJECT_NAME'])
|
18
|
+
end
|
14
19
|
end
|
data/lib/uffizzi_core/engine.rb
CHANGED
@@ -10,6 +10,41 @@ module UffizziCore
|
|
10
10
|
config.i18n.load_path += Dir["#{config.root}/config/locales/**/*.yml"]
|
11
11
|
end
|
12
12
|
|
13
|
+
config.uffizzi_core = ActiveSupport::OrderedOptions.new
|
14
|
+
|
15
|
+
config.uffizzi_core.dependencies = {
|
16
|
+
rbac: 'UffizziCore::Rbac::UserAccessService',
|
17
|
+
}
|
18
|
+
|
19
|
+
config.uffizzi_core.table_names = {
|
20
|
+
accounts: :uffizzi_core_accounts,
|
21
|
+
activity_items: :uffizzi_core_activity_items,
|
22
|
+
builds: :uffizzi_core_builds,
|
23
|
+
comments: :uffizzi_core_comments,
|
24
|
+
compose_files: :uffizzi_core_compose_files,
|
25
|
+
config_files: :uffizzi_core_config_files,
|
26
|
+
container_config_files: :uffizzi_core_container_config_files,
|
27
|
+
containers: :uffizzi_core_containers,
|
28
|
+
coupons: :uffizzi_core_coupons,
|
29
|
+
credentials: :uffizzi_core_credentials,
|
30
|
+
deployments: :uffizzi_core_deployments,
|
31
|
+
events: :uffizzi_core_events,
|
32
|
+
invitations: :uffizzi_core_invitations,
|
33
|
+
memberships: :uffizzi_core_memberships,
|
34
|
+
payments: :uffizzi_core_payments,
|
35
|
+
prices: :uffizzi_core_prices,
|
36
|
+
products: :uffizzi_core_products,
|
37
|
+
projects: :uffizzi_core_projects,
|
38
|
+
ratings: :uffizzi_core_ratings,
|
39
|
+
repos: :uffizzi_core_repos,
|
40
|
+
roles: :uffizzi_core_roles,
|
41
|
+
secrets: :uffizzi_core_secrets,
|
42
|
+
templates: :uffizzi_core_templates,
|
43
|
+
user_projects: :uffizzi_core_user_projects,
|
44
|
+
users: :uffizzi_core_users,
|
45
|
+
users_roles: :uffizzi_core_users_roles,
|
46
|
+
}
|
47
|
+
|
13
48
|
ActiveModelSerializers.config.adapter = :json
|
14
49
|
end
|
15
50
|
end
|
data/lib/uffizzi_core/version.rb
CHANGED
data/lib/uffizzi_core.rb
CHANGED
@@ -27,34 +27,5 @@ require 'sidekiq'
|
|
27
27
|
require 'virtus'
|
28
28
|
|
29
29
|
module UffizziCore
|
30
|
-
mattr_accessor :
|
31
|
-
rbac: 'UffizziCore::Rbac::UserAccessService',
|
32
|
-
}
|
33
|
-
mattr_accessor :table_names, default: {
|
34
|
-
accounts: :uffizzi_core_accounts,
|
35
|
-
activity_items: :uffizzi_core_activity_items,
|
36
|
-
builds: :uffizzi_core_builds,
|
37
|
-
comments: :uffizzi_core_comments,
|
38
|
-
compose_files: :uffizzi_core_compose_files,
|
39
|
-
config_files: :uffizzi_core_config_files,
|
40
|
-
container_config_files: :uffizzi_core_container_config_files,
|
41
|
-
containers: :uffizzi_core_containers,
|
42
|
-
coupons: :uffizzi_core_coupons,
|
43
|
-
credentials: :uffizzi_core_credentials,
|
44
|
-
deployments: :uffizzi_core_deployments,
|
45
|
-
events: :uffizzi_core_events,
|
46
|
-
invitations: :uffizzi_core_invitations,
|
47
|
-
memberships: :uffizzi_core_memberships,
|
48
|
-
payments: :uffizzi_core_payments,
|
49
|
-
prices: :uffizzi_core_prices,
|
50
|
-
products: :uffizzi_core_products,
|
51
|
-
projects: :uffizzi_core_projects,
|
52
|
-
ratings: :uffizzi_core_ratings,
|
53
|
-
repos: :uffizzi_core_repos,
|
54
|
-
roles: :uffizzi_core_roles,
|
55
|
-
templates: :uffizzi_core_templates,
|
56
|
-
user_projects: :uffizzi_core_user_projects,
|
57
|
-
users: :uffizzi_core_users,
|
58
|
-
users_roles: :uffizzi_core_users_roles,
|
59
|
-
}
|
30
|
+
mattr_accessor :table_names, default: {}
|
60
31
|
end
|