Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4b82a2c
Import yjshen's PR.
yjshen Aug 11, 2015
eddcc47
Use newer shaded docker-client artifact
JoshRosen Oct 19, 2015
8bb62ea
Use map for setting environment variables.
JoshRosen Oct 19, 2015
23443a5
Ensure that Docker container is cleaned up after error.
JoshRosen Oct 19, 2015
e6c7709
Remove a bunch of layers of indirection / abstraction.
JoshRosen Nov 5, 2015
d06847b
Fix networking for boot2docker.
JoshRosen Nov 5, 2015
93bcf45
Log warning in case container cleanup fails
JoshRosen Nov 5, 2015
bf98ae0
Rename class and freeze image versions
JoshRosen Nov 5, 2015
1e389e2
Automatically get docker IP from docker-machine and boot2docker.
JoshRosen Nov 5, 2015
d9c37df
Print nicer message if Docker connection fails.
JoshRosen Nov 5, 2015
95f00e1
Add test tag for excluding Docker tests in SBT.
JoshRosen Nov 5, 2015
fcf5dc4
Upgrade to non-ancient version of docker-client.
JoshRosen Nov 6, 2015
2273f87
Upgrade Jersey to avoid ASM incompatibilities / classpath ordering is…
JoshRosen Nov 6, 2015
65315c4
Merge remote-tracking branch 'origin/master' into docker-jdbc-tests
JoshRosen Nov 6, 2015
cba340f
Experiment with bumping Jersey, even though I know we can't do that.
JoshRosen Nov 6, 2015
1a09a65
Hack to fix IP address binding in Jenkins.
JoshRosen Nov 9, 2015
af84a47
Move docker tests to own subproject.
JoshRosen Nov 9, 2015
4899b2e
Add DockerTest tag.
JoshRosen Nov 9, 2015
ef85200
Use non-shaded Docker client.
JoshRosen Nov 9, 2015
6db2c1c
Fix dependency problems.
JoshRosen Nov 10, 2015
9011bc5
Merge remote-tracking branch 'origin/master' into docker-jdbc-tests
JoshRosen Nov 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Automatically get docker IP from docker-machine and boot2docker.
  • Loading branch information
JoshRosen committed Nov 5, 2015
commit 1e389e2b534e7c8da8a502eefd11abc869965620
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import java.net.ServerSocket
import java.sql.Connection

import scala.collection.JavaConverters._
import scala.sys.process._
import scala.util.Try
import scala.util.control.NonFatal

import com.spotify.docker.client.messages.{ContainerConfig, HostConfig, PortBinding}
Expand Down Expand Up @@ -94,7 +96,7 @@ abstract class DockerJDBCIntegrationSuite
sock.close()
port
}
val dockerIp = sys.env.getOrElse("DOCKER_IP", Utils.localHostName())
val dockerIp = getDockerIp()
val hostConfig: HostConfig = HostConfig.builder()
.networkMode("bridge")
.portBindings(
Expand Down Expand Up @@ -144,6 +146,19 @@ abstract class DockerJDBCIntegrationSuite
}
}

private def getDockerIp(): String = {
/** If docker-machine is setup on this box, attempts to find the ip from it. */
def findFromDockerMachine(): Option[String] = {
sys.env.get("DOCKER_MACHINE_NAME").flatMap { name =>
Try(Seq("/bin/bash", "-c", s"docker-machine ip $name 2>/dev/null").!!.trim).toOption
}
}
sys.env.get("DOCKER_IP")
.orElse(findFromDockerMachine())
.orElse(Try(Seq("/bin/bash", "-c", "boot2docker ip 2>/dev/null").!!.trim).toOption)
.getOrElse(Utils.localHostName())
}

/**
* Prepare databases and tables for testing.
*/
Expand Down