Our tests depends on files shared between services. The container that is running the tests has ruby and is running selenium tests with BrowserStack. These tests need "web" service and "queue" service (other services are not important for this question).
First question here is "Is it possible to share BITBUCKET_CLONE_DIR with the web and queue service?" This should be shared with both "web" and "queue" service because they are using the same code. I do not see anything in the documentation for this (I know I can set variables and checkout the code but this will not work because of the second bit that still requires shared dir.)
The second bit is that "web" and "queue" communicates to each other using shared directory. The "web" service will receive a request and will create a file in the shared directory that represents a task for the "queue" service. The "queue" service monitors the directory and when there is a file it will process is and delete it after this. Any idea how can I do this?
In our dev env we are using "docker-compose" and the source is on the host. It's shared as volumes to each service that requires it. The directory used by services to communicate is inside the source. I have tried to use the same thing by using the "docker" service. The problem with this is that the entry point of some services use "chown" to ensure directories will have proper permissions. This is because the service runs as specific user, not as root. On our local machines this is working without issues but here we receive "chown: changing ownership of '/var/lib/XXXXX/data/YYYYYY': Operation not permitted". In this example the source code is in "/var/lib/XXXXX". The "/var/lib/XXXXX/data" directory is used by services to communicate. The directory where "docker-compose" is started is BITBUCKET_CLONE_DIR and the "volumes" section in the docker-compose.yml for this service is
volumes:
- .:/var/lib/XXXXX
The "chown" command is executed as root.
Any help how we can solve the problem to share directory between services to communicate is appreciated.