Comments (6)
Fixed in new version 0.9.1 available now.
from gradle-dcompose-plugin.
Quick workaround:
Include this in your build.gradle
:
allprojects { prj ->
prj.tasks.withType(com.chrisgahlert.gradledcomposeplugin.tasks.AbstractDcomposeTask) { task ->
task.dockerClassLoaderFactory.getDefaultInstance()
}
}
I'll be releasing a new version soon... and thanks for reporting! ;)
from gradle-dcompose-plugin.
Thank you for fixing this so fast!
from gradle-dcompose-plugin.
@chrisgahlert Thank you!
Just a question regarding DcomposeCopyFileFromContainerTask
as I noticed that with the new version i am having trouble copying the files (works in Gradle 3.5 with the new version of the plugin, files are copied). So does this look like a bug or I am doing something wrong (e.g. use Sync
?) or missing something (some changes in Gradle 4.0) ?
Error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':tests:copyReportFiles'.
> Docker command failed: Could not find the file /tmp/build/reports/tests in container dcompose_4164440d_test
The source:
task copyReportFiles(type: DcomposeCopyFileFromContainerTask) {
service = dcompose.test
containerPath = '/tmp/build/reports/tests'
destinationDir = file("build/reports/")
cleanDestinationDir = false
}
startTestContainer.finalizedBy copyReportFiles
If necessary I can provide the full Gradle file.
from gradle-dcompose-plugin.
I don't think this is related to the plugin itself:
The DcomposeCopyFileFromContainerTask
can copy files from containers - whether they are running or not (i.e. they might have never been started). The task only has a dependency on the create<Service>Container
task.
For this reason I'm suspecting that you always copied the files from a container, where the startTestContainer
task was previously executed causing the missing files to exist.
So in your example you would need to do the following:
- Add a dependency to the start task:
task copyReportFiles(type: DcomposeCopyFileFromContainerTask) {
service = dcompose.test
...
dependsOn startTestContainer // or more generic: "$service.projectPath:$service.startContainerTaskName"
}
- In order to wait for the container to finish it's task, I would recommend to add the following properties:
dcompose {
test {
// image,baseDir,command = ...
waitForCommand = true // makes sure that the process will finish before moving to the copy task
attachStdout = true // helpful for debugging: will be piped to System.out by default
attachStderr = true // helpful for debugging: will be piped to System.err by default
}
}
from gradle-dcompose-plugin.
@chrisgahlert Thank you!!
Point 2 was already satisfied, also included point 1.
I was able to pinpoint the issue to how those tests reports were generated (or more precisely were not generated); I was not really happy with that env in the first place, so this gave me a good reason to change it.
from gradle-dcompose-plugin.
Related Issues (20)
- /var/run/docker.sock = localhost assumption is incorrect HOT 5
- Honor Dockerfile healthchek HOT 2
- Cannot load auth from ~/.docker/config.json HOT 2
- Would like to apply multiple tags to the same image HOT 2
- Add "setter" for command property to ServiceReference HOT 2
- Can't run multiple "waitForCommand" services in single gradle exection. HOT 3
- Converting complete image ref (including tag) to lower case prevents use of mixed case tags. HOT 1
- pull image progress HOT 1
- connect to external network not working HOT 3
- Usage with Kotlin-DSL HOT 5
- feat(healthcheck): Add helthcheck api for DefaultService HOT 4
- Start Container never ends HOT 4
- Old volumes are reused HOT 3
- Unable to force deletion of an image HOT 7
- ClassCastException with 0.16.4 HOT 5
- Getting logs from container build HOT 3
- Feature Request: Add support for composite build HOT 3
- ConnectionClosedException with Docker for Mac 2.5.0.1 HOT 2
- Intermittent "Container id not available for service database - has it been started?"
- Intermittent "Container id not available for service database - has it been started?" HOT 2
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 gradle-dcompose-plugin.