Comments (15)
Yeah! It works by removing dockerComposeInstances.bin
, thanks @tobym.
@kurtkopchik All is okay with this new snapshot too.
Well, everything seems fine now. Thank you again to both of you 👍
from sbt-docker-compose.
Hi @Cowa. Thanks for opening this issue!
At the moment to use the env_file:
docker-compose setting with the plugin the path to the file needs to be fully qualified. For example: env_file: /Users/cowa/project/settings.env
I've updated the README to reflect this. Let me know if making this change enables you to successfully run dockerComposeUp
.
That being said, I'm working on removing the need to do this and will let you know when there is a version that doesn't require this modification.
from sbt-docker-compose.
Thanks @kurtkopchik for the answer.
However my usage is to run tests on a CI (not my machine), so I will not have the qualified path there.
I will wait :)
from sbt-docker-compose.
Hi @Cowa. I published a 1.0.8-SNAPSHOT
release that I believe should fix the issue:
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.8-SNAPSHOT")
Please let me know if it works for you and if so I'll get an official release out with the change.
from sbt-docker-compose.
Thanks it works for dockerComposeUp
!
But on dockerComposeTest
, the .env
file seems not to be properly injected.
Play framework cry when loading the configuration:
Could not resolve substitution to a value: ${REDIS_HOST}
But no problem on dockerComposeUp
. So it's weird...
from sbt-docker-compose.
Hi @Cowa, you could pull in the configuration via a system property myConfigKey = ${redis:6379}
which is passed in to the test runner. You can make it optional like this myConfigKey = ${?redis:6379}
if you want to attempt setting myConfigKey
multiple ways depending on the environment. (See https://github.com/typesafehub/config#optional-system-or-env-variable-overrides).
from sbt-docker-compose.
It should also be noted that the test cases run by dockerComposeTest
run outside of the docker-compose instance. They connect into the instance via the configMap
and System property values passed into the test case which contain the dynamically assigned port and container information. From your original compose yml it looks like you are not exposing a port on your Redis service which you will have to do to connect to it from a test case using the info from @tobym
redis:
image: iadvize/redis:3
ports:
- "6379"
env_file: .env
Let me know if that works!
from sbt-docker-compose.
I understand more how it works now, thanks!
There is a problem with the system property though, typesafe/config
doesn't allow :
so ${redis:6379}
is not valid.
I tried with quotes ${"redis:6379"}
, but:
Could not resolve substitution to a value: ${"redis:6379"}
(And of course I added the port 6379 for redis)
from sbt-docker-compose.
Good catch; yes, you need the quotes. That looks like it should work, however. Could you share the version of Play and typesafe config that you're using, along with the config file?
Also, potentially related: lightbend/config#134
from sbt-docker-compose.
I use Play 2.5.3 shipped with config 1.3.0.
Config file:
redis {
host = ${?REDIS_HOST}
host = ${"redis:6379"}
port = ${?REDIS_PORT}
port = 6379
pool {
max_connections = 10
max_connections = ${?REDIS_POOL_MAX_CONNECTIONS}
}
}
from sbt-docker-compose.
Try this:
Shut down sbt, and if there is a file in /tmp/dockerComposeInstances.bin, delete it. (This contains information about running docker-compose instances, and in 1.0.7 there is a bug which may cause the plugin to be unable to find the right instances; this is fixed in the upcoming 1.0.8 release). Run the tests again and see if that fixed it.
from sbt-docker-compose.
Here is a trivial app that shows the system property working in isolation of the plugin and docker: https://gist.github.com/tobym/35d0fe799a520122b98e9eebfda266aa
from sbt-docker-compose.
Cowa I also published and updated version of the 1.0.8-SNAPSHOT release that also includes the fix for the bug mentioned by @tobym.
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.8-SNAPSHOT")
When you have a moment please sbt update
your plugins and give it another try. If it still fails, if we could get the full output from the dockerComposeTest
command that would help us track down the root cause.
We are so close....Thanks!
from sbt-docker-compose.
Excellent! I'm glad you are now up and running with the plugin. I'll let you know when the official release with these changes gets published.
from sbt-docker-compose.
The official 1.0.8 release has been published: addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.8")
Please open a new issue if you run into any other problems. Thanks again for using the plugin!
from sbt-docker-compose.
Related Issues (20)
- Plugin starts tests even if not all containers are ready. HOT 4
- useStaticPorts does not seems to take effect HOT 2
- -debug doesn't work with specs2 HOT 2
- How to link my scala app's container, created by sbt-native-packager, to the dependency containers? HOT 1
- dockerComposeTest does not remove Docker instances when the compliation fails HOT 7
- multi project build with sbt-native-packager HOT 2
- DockerComposeTest does not pick up FeatureSpecs HOT 3
- Specs2 tests that have a different constructor don't run
- dockerComposeTest returns success on compilation error
- Provide dockerComposeTestOnly HOT 1
- Question - where does sbt-docker-compose plugin live? HOT 2
- Exception for invalid volume definition
- Configurable 'instanceName' (-p project-name)
- Forthcoming Deprecation / Transfer of Ownership Notice HOT 2
- SBT 1.3.3 breaks sbt-docker-compose
- dockerComposeTest doesn't include parent test scope in dependency classpath
- "Could not parse image id" HOT 1
- Support docker-compose 2.x HOT 3
- Run specs2 tests in multi-project code? HOT 4
- SBT 1.1.0-M1 compatibility issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-docker-compose.