1
votes

I am configuring very basic Gitlab pipeline for protractor tests. There is only one service, using docker image selenium/standalone-chrome-debug.

I want to start the image within GitLab CI as a service but with specific command line options: "docker run -d -p 4444:4444 -p 5900:5900 selenium/standalone-chrome-debug". I found out that it is possible to pass command line arguments by creating a custom docker image with CMD (details here https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2514), but I can't find a word about passing command line options. It is even possible?

stage: test
  services:
    - name: selenium/standalone-chrome-debug
  before_script:  
    - removed as it is not relevant
  script:
    - npm run $TEST_SUITE_NAME -- --host=selenium__standalone-chrome-debug
1

1 Answers

0
votes

You can do it with docker or docker-compose

Change your service to docker:dind and try this

stage: test
  services:
    - name: docker:dind
  before_script:  
    - removed as it is not relevant
    - docker run -d -p 4444:4444 -p 5900:5900 selenium/standalone-chrome-debug
  script:
    - npm run $TEST_SUITE_NAME -- --host=localhost:5900

I didn't test it...but I think it will work with some improvements.