Revision e0543554
Added by Daniel Lobato Garcia over 8 years ago
app/models/container.rb | ||
---|---|---|
1 | 1 |
class Container < ActiveRecord::Base |
2 | 2 |
include Authorizable |
3 | 3 |
include Taxonomix |
4 |
include ForemanTasks::Concerns::ActionSubject |
|
5 | 4 |
|
6 | 5 |
belongs_to :compute_resource |
7 | 6 |
belongs_to :registry, :class_name => "DockerRegistry", :foreign_key => :registry_id |
app/models/service/actions/compute_resource/pull.rb | ||
---|---|---|
1 |
module Service |
|
2 |
module Actions |
|
3 |
module ComputeResource |
|
4 |
class Pull < ::Actions::EntryAction |
|
5 |
def plan(container) |
|
6 |
#container.disable_auto_reindex! |
|
7 |
action_subject(container) |
|
8 |
container.compute_resource.create_image(:fromImage => container.repository_pull_url) |
|
9 |
end |
|
10 |
|
|
11 |
def humanized_name |
|
12 |
_('Pull') |
|
13 |
end |
|
14 |
|
|
15 |
def finalize |
|
16 |
logger.info('Finished pulling Docker image') |
|
17 |
end |
|
18 |
end |
|
19 |
end |
|
20 |
end |
|
21 |
end |
foreman_docker.gemspec | ||
---|---|---|
20 | 20 |
|
21 | 21 |
s.add_dependency 'docker-api', '~> 1.13' |
22 | 22 |
s.add_dependency 'wicked', '~> 1.1' |
23 |
s.add_dependency 'foreman-tasks' |
|
24 | 23 |
s.add_development_dependency 'rubocop', '~> 0.26' |
25 | 24 |
end |
lib/foreman_docker/engine.rb | ||
---|---|---|
14 | 14 |
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"] |
15 | 15 |
config.autoload_paths += Dir["#{config.root}/app/models/concerns"] |
16 | 16 |
|
17 |
initializer "foreman_docker.require_dynflow", |
|
18 |
:before => "foreman_tasks.initialize_dynflow" do |app| |
|
19 |
ForemanTasks.dynflow.require! |
|
20 |
end |
|
21 |
|
|
22 | 17 |
initializer 'foreman_docker.load_app_instance_data' do |app| |
23 | 18 |
app.config.paths['db/migrate'] += ForemanDocker::Engine.paths['db/migrate'].existent |
24 | 19 |
end |
Also available in: Unified diff
Revert "Fixes #8409 - Pull docker image asynchronously"
This reverts commit 16234b270677486ea197a0dca54b14ed981abfc5.
Conflicts:
app/models/service/containers.rb