diff options
author | Adam Savitzky <adam.savitzky@gmail.com> | 2017-03-09 14:52:30 -0800 |
---|---|---|
committer | Adam Savitzky <adam.savitzky@gmail.com> | 2017-03-09 14:52:30 -0800 |
commit | 739fe3c24d16ecab33ce2a6a3747dc4e2b203870 (patch) | |
tree | 8fb43809c73cb5769b303ab4e83cb4ed85fcf46e /src/main/scala | |
parent | 8900264ef8a875ae97fd7468e437012ebd65afbf (diff) | |
download | sbt-settings-739fe3c24d16ecab33ce2a6a3747dc4e2b203870.tar.gz sbt-settings-739fe3c24d16ecab33ce2a6a3747dc4e2b203870.tar.bz2 sbt-settings-739fe3c24d16ecab33ce2a6a3747dc4e2b203870.zip |
Add keystore generation to docker
In order to call other services that use SSL certs generated by our internal self-signed CA, we will need to convert the ca certificate that dr attaches to the container to a jvm trust store. This change adds a command to the container that executes before it starts, and builds the trust store from the ca certificate.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/xyz.driver.sbt/SbtSettings.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/scala/xyz.driver.sbt/SbtSettings.scala b/src/main/scala/xyz.driver.sbt/SbtSettings.scala index e266f3a..680b49d 100644 --- a/src/main/scala/xyz.driver.sbt/SbtSettings.scala +++ b/src/main/scala/xyz.driver.sbt/SbtSettings.scala @@ -339,6 +339,7 @@ object SbtSettings extends AutoPlugin { baseImage: String = "openjdk:8-jre-alpine", customCommands: List[String] = List.empty[String], aggregateSubprojects: Boolean = false): Project = { + project .enablePlugins(DockerPlugin, JavaAppPackaging) .settings( @@ -371,7 +372,13 @@ object SbtSettings extends AutoPlugin { val repositoryName = "gcr.io/" + gCloudProject - dockerConfiguration(imageName, repositoryName, exposedPorts, baseImage, dockerCustomCommands, aggregateSubprojects) + val trustStoreConfiguration = + "[ -n \"$TRUSTSTORE\" ] && keytool -import -noprompt -trustcacerts -alias driver-internal -file /etc/$imageName/ssl/issuing_ca -storepass 123456" + + val dockerCommands = + dockerCustomCommands :+ trustStoreConfiguration + + dockerConfiguration(imageName, repositoryName, exposedPorts, baseImage, dockerCommands, aggregateSubprojects) .settings( Seq(resourceGenerators in Test += Def.task { val variablesFile = file("deploy/variables.sh") |