skip to Main Content

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


  1. 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:

    services:
      - name: wiremock/wiremock
        entrypoint: ["/bin/bash", "-c", "cp /builds/ /home/wiremock/builds && /docker-entrypoint.sh"]
        # change the source/destination as needed
    

    See the services documentation for more information.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search