Module: Appril::CLI::Docker
- Included in:
- Appril::CLI
- Defined in:
- lib/appril-cli/docker.rb,
lib/appril-cli/docker/build.rb,
lib/appril-cli/docker/update.rb,
lib/appril-cli/docker/install.rb
Defined Under Namespace
Classes: Build, Install, Update
Constant Summary
collapse
- DOCKER_DIR =
BASE_DIR / 'docker'
- CONFIG_FILE =
'./config.yml'.freeze
- START_FILE =
'./start.sh'.freeze
- PREPARE_BUILD_FILE =
'./prepare_build.sh'.freeze
- BUILD_FILE =
'./build.sh'.freeze
- CLEANUP_FILE =
'./cleanup.sh'.freeze
Instance Method Summary
collapse
Instance Method Details
#docker(args) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/appril-cli/docker.rb', line 13
def docker args
opted_dir = args[2]
assert_directory_provided(opted_dir)
dir = expanded_path(opted_dir)
case instruction = args[1]
when 'i', 'install'
docker_install(dir, working_dir_opted: working_dir_opted?(opted_dir))
when 'b', 'build'
docker_build(dir, {
update_runner_only: args.find {|a| a == '-u'},
push_opted: args.find {|a| a == '-p'}
})
when 'u', 'update'
docker_update(dir)
else
unknown_instruction_error!(instruction, 'install (or i)', 'build (or b)', 'update (or u)')
end
end
|
#docker_build(dir, opts) ⇒ Object
45
46
47
48
49
|
# File 'lib/appril-cli/docker.rb', line 45
def docker_build dir, opts
assert_directory_exists(dir)
assert_config_file_exists(dir)
Docker::Build.new(dir, opts)
end
|
#docker_install(dir, opts) ⇒ Object
39
40
41
42
43
|
# File 'lib/appril-cli/docker.rb', line 39
def docker_install dir, opts
create_dirname_for(dir)
assert_installable_dir(dir, opts[:working_dir_opted])
Docker::Install.new(dir, opts)
end
|
#docker_update(dir) ⇒ Object
51
52
53
54
|
# File 'lib/appril-cli/docker.rb', line 51
def docker_update dir
assert_is_docker_dir(dir)
Docker::Update.new(dir)
end
|