Closed lordofthejars closed 7 years ago
@lordofthejars Idea looks good. But I would look for following locations.
In this way we are not forcing user to put docker file inside test/resources/docker/Dockerfile.
User can put Dockerfile in any folder under resources.
@dipak-pawar I agree with you, the problem is that I have seen some people putting these files in src/main/docker
which it is not a resources dir. SO we can do what you mention + src/main(test)/docker
@lordofthejars I would assume priority for src/main(test)/docker
as last.
From my point of view we should look it up in the following way:
src/{main,test}/docker
src/{main,test}/resources
I doubt we will have files in more than one place listed above, but you never know, so in such a case I would report and suggest configuration (still taking precedence as a default).
Well, from my point of view the directory src/{main,test}/docker
is definitely not the correct place where you should keep our test resources. For this purpose, there is the resources
directory and I would really avoid creating this new "dummy" directory for docker related things and I would keep the convention. In addition, the files are not connected to the java project anyhow - they're just another resource files.
I would vote for this order:
docker
directory either in src/{main,test}/
or in the root project@MatousJobanek I saw it used quite a lot to be honest. Therefore if we find such a directory user does it by purpose. That's why my suggested order.
resources
is too generic, so I can undrestand why people tend to have dedicated folder for docker images.
Also adding in src/main/resources means that goes inside JAR. What I have seen in a lot of places is the src/main/docker
as well.
I saw it used quite a lot to be honest.
Ok, I don't have the experience so I cannot judge.
resources is too generic, so I can undrestand why people tend to have dedicated folder for docker images.
yeah, in this case, I would expect a docker
directory inside of the resources directory
For me the path src/main/docker
looks just weird, but it is probably because I don't have enough experience with it...
We are not trying to promote anything, just handle locations where ppl put it.
@MatousJobanek neither do I I have the experience, but I think there is nothing clear in this sense. But for now of 30 votes (64% of people choose src/main/docker
)
Final results:
src/main/docker
53%
src/main/resources/docker
35%
src/main/resources
12%
And then we have other users using /
and src/distribution
So my bets are:
1) src/{test, main}/docker
(first test if not main)
2) /
3) src/distribution
4) src/{test, main}/resources/docker
5) src/{test, main}/resources
I have left the resources
ones to latest because they can be considered somehow a bad practice since the bundling file will contain Dockerfile/docker-compose as well.
Issue Overview
Automatic Resolution of Docker files like
docker-compose
orDockerfile
Expected Behaviour
If user does not set
dockerContainers
nordockerContainersFile/s
then it would be great that Arquillian Cube does next things:1) search in
/docker-compose.y(a)ml
if found then it is used 2) if not then search in/src/test/docker/docker-compose.y(a)ml
3) if not/src/test/resources/docker-compose.y(a)ml
4) if not/src/test/resources/docker/docker-compose.y(a)ml
if it is not present in any of these locations search the same but in
src/main
instead ofsrc/test
If again there is no
docker-compose
there, just search the same but forDockerfile
, and in case of finding it, get the EXPOSE port/s and create dynamically adockerContainers
expression building that containerIf none of this things happens then an exception is thrown.
In this way we avoid having to create an
arquillian.xml
file all the time.