mercredi 16 novembre 2016

GitLab CI What is the syntax for using if statements

I would like to check the value of one of my variables in my build script in order to only deploy if a variable has a specific value.

deploy utilities:
  stage: deploy
  script:
    - echo %DEPLOY%
    - if [ "%DEPLOY%" == "utilities" ]; then 'msbuild.exe Build\TCBuild.CreateAndPublishNugetPackages.Utilities.Targets /p:BUILD_NUMBER=%CI_BUILD_ID%'; fi
  dependencies:
    - restore deploy packages
    - build utilities
  only: 
    - triggers
  artifacts:
    name: 'Utilities_nuget-package%CI_BUILD_ID%'
    expire_in: 1 days
    paths: 
    - Build

But when it builds I get the following error:

"utilities" was unexpected at this time.

What is the correct syntax for using if statements in .gitlab-ci.yml?

Aucun commentaire:

Enregistrer un commentaire