I’m trying to run a gitlab service running wiremock on my gitlab ci.
I want to take my json files for configure wiremock from the repository and mount as a volume to the wiremock image that run as an service on gitlab ci
.gitlab-ci.yml
variables:
SHARED_PATH: $CI_PROJECT_PATH/src/main/resources
services:
- name: wiremock/wiremock
alias: wiremock
image: openjdk:11
deploy:jdk11:
stage: deploy
script:
- 'curl -X POST http://wiremock:8080/'
I want to mount the SHARED_PATH as a volume for the wiremock service
2
Answers
The job directory is already mounted in containers started with
services:
. All services have the job directory mounted as a volume under/builds
.If you need to move that to a specific location inside the service image, you can use
services:[]:entrypoint:
to define an entrypoint that copies the files, creates symlinks, or whatever you need to do.For example, you might do something like this:
See the services documentation for more information.
Currently there is no possibility to mount a volume.
See this in the Gitlab issue tracker: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/28121