Run a script before services

Hi,

I’m trying to execute a script before docker initialization.
I’ve tried “before_script”, but it’s executed after the service has started

before_script:
    - echo "BEFORE SCRIPT"
services:
    redis:latest

Is there a way to do this ?

Regards

1 Like

This is a very interesting question! In my case, I’m interested in doing something like the following, but it is not working :confused:

before_script:
  - mvn help:evaluate -Dexpression=elasticsearch.version -Doutput=.POM_ES_VERSION
  - export POM_ES_VERSION=`cat .POM_ES_VERSION`

services:
  - name: elasticsearch:$POM_ES_VERSION