Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Conditional variables in gitlab-ci.yml

job:
  variables:
    DEPLOY_VARIABLE: "default-deploy"
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
      variables:                              # Override DEPLOY_VARIABLE defined
        DEPLOY_VARIABLE: "deploy-production"  # at the job level.
    - if: $CI_COMMIT_REF_NAME =~ /feature/
      variables:
        IS_A_FEATURE: "true"                  # Define a new variable.
  script:
    - echo "Run script with $DEPLOY_VARIABLE as an argument"
    - echo "Run another script if $IS_A_FEATURE exists"
Comment

PREVIOUS NEXT
Code Example
Shell :: installer lamp ubuntui 
Shell :: Git - checkout a specific remote branch 
Shell :: create a git repository from local machine and push it online 
Shell :: add username password git 
Shell :: Install specific node version and update node to lastest stable version 
Shell :: sh or bash validate if file no exist 
Shell :: list of installed packages and version 
Shell :: grep without 
Shell :: genymotion install ubuntu 
Shell :: bash case statement 
Shell :: how to add git bash to context menu 
Shell :: windows cmd remove a not empty directory 
Shell :: php install extension 
Shell :: install paddlepaddle 
Shell :: generate ssh key in github 
Shell :: how to upgrade npm in ubuntu 
Shell :: Using git reset to Undo a Merge 
Shell :: mssql-tools : depends: msodbcsql17 (= 17.3.0.0) but it is not going to be installed 
Shell :: cmd delete folder and all contents 
Shell :: gitbash update 
Shell :: error eacces permission denied mkdir xampp ubuntu 
Shell :: reboot with systemctl command 
Shell :: install mpfr ubuntu 
Shell :: how to ignore files in git 
Shell :: How can I remove the first line of a text file using bash/sed script? 
Shell :: ssh permission denied publickey 
Shell :: helm add stable hub 
Shell :: linux list all system groups in order 
Shell :: git change date 
Shell :: bash script comment 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =