Skip to content

Commit

Permalink
build: support use of docker provider in builder
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Mar 20, 2020
1 parent 84ddf0b commit a4fe341
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class BuildersPlugin implements Plugin<Project> {
})
}

static boolean usingDockerProvider() {
def env = System.getenv("VAGRANT_DEFAULT_PROVIDER")
return env == "docker";
}

static boolean isRunning(Project project, String builderName) {
def output = new ByteArrayOutputStream()
project.exec {
Expand Down Expand Up @@ -123,6 +128,9 @@ class BuildersPlugin implements Plugin<Project> {
}

static syncVM(Project project, String builderName) {
if (usingDockerProvider()) {
return;
}
project.exec {
workingDir project.host.vagrantfileDir
commandLine adaptCommandForOs('vagrant', 'rsync', "builder-${builderName}")
Expand Down Expand Up @@ -155,6 +163,9 @@ class BuildersPlugin implements Plugin<Project> {
}

static syncHost(Project project, String builderName) {
if (usingDockerProvider()) {
return;
}
def vDir = project.host.vagrantfileDir.toString()
def result = project.exec {
workingDir project.host.vagrantfileDir
Expand Down

0 comments on commit a4fe341

Please sign in to comment.