Closed EmreCihanbeyoglu closed 1 year ago
I have found a solution for this. :)
I have noticed that we are able to define environment variables specific to a service in gitlab. So configuration can be given by means of this:
services:
- name: mocksserver/main
alias: mocks
variables:
#MOCKS_CONFIG_FILE_SEARCH_FROM: "$CI_PROJECT_DIR"
MOCKS_SERVER_PORT: 3500
#MOCKS_CONFIG_FILE_SEARCH_PLACES: ".mocksrc.json"
MOCKS_FILES_PATH: "$CI_PROJECT_DIR/mocks/"
before_script:
- curl "http://mocks:3500/api/users"
- curl "http://mocks:3500/api/users" | grep -q "Emre Cihan"
- npm install
Hi @EmreCihanbeyoglu , thanks for sharing! 😃
And sorry for the delay in my response, I was on holidays.
Hi,
This is a question, not a bug or feature. I want to run mocks server independent from application as an image in a container without having to install it as a dependency.
So I need to pass arguments (like port and volume) by means of commands instead of docker arguments.
A sample usage of services in gitlab:
I am wondering how to convert docker run command
into a format which fits gitlab services functionality.
Resource: https://docs.gitlab.com/ee/ci/services/#available-settings-for-services
Could you please help me with this?