Build from git operation for docker

This commit is contained in:
Oleksiy Protas 2016-10-17 00:51:33 +03:00 committed by Brian Cain
parent de6a1794c7
commit cbc69f5158
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 6 additions and 4 deletions

View File

@ -17,9 +17,11 @@ module VagrantPlugins
machine = env[:machine]
build_dir = env[:build_dir]
build_dir ||= machine.provider_config.build_dir
git_repo = env[:git_repo]
git_repo ||= machine.provider_config.git_repo
# If we're not building a container, then just skip this step
return @app.call(env) if !build_dir
return @app.call(env) if (!build_dir && !git_repo)
# Try to read the image ID from the cache file if we've
# already built it.
@ -52,7 +54,7 @@ module VagrantPlugins
end
image = machine.provider.driver.build(
build_dir,
build_dir || git_repo,
extra_args: args) do |type, data|
data = remove_ansi_escape_codes(data.chomp).chomp
env[:ui].detail(data) if data != ""

View File

@ -7,7 +7,7 @@ module VagrantPlugins
end
def call(env)
env[:result] = !!env[:machine].provider_config.build_dir
env[:result] = (!!env[:machine].provider_config.build_dir || !!env[:machine].provider_config.git_repo)
@app.call(env)
end
end