3

I want the some of the variables should be required before executing the pipeline in gitlab. Can I achieve it. I have below gitlab-ci.yml

stages:          # Runs First - Anything that needs to run prior to your scripts running
  - deploy
  - Script

variables:
  Domain:
    value: "dom"
  HOST_NAME:
    value: ""  
  JAVA_FILES_WITH_ARGS:
    value: ""
  

I want to make mandatory(JAVA_FILES_WITH_ARGS, HOST_NAME) before run the pipeline how can I achieve it. it will not start the pipeline without these two variable values.

Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74

1 Answers1

2

The Answer: is

rules:
 - if: '$JAVA_FILES_WITH_ARGS != "" && $HOST_NAME != ""'
   allow_failure: true
Dennis
  • 20,275
  • 4
  • 64
  • 80
Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74