dimanche 22 septembre 2019

if statement on gitlab.ci yaml

on my gitlab.ci.yaml response status must be 200 else job should be fail and must write transfer already started. else job should be fail. But I dont know how to write if statement for that.

    variables:
  NUGET_PATH: 'C:\Tools\Nuget\nuget.exe'
  MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\msbuild.exe'
  SOLUTION_PATH: 'Textbox_ComboBox.sln'

stages:
  - build
  - job1
  - job2

before_script:
  - "cd Source"

build_job:
  stage: build
  except:
    - schedules
  script:
    - '& "$env:NUGET_PATH" restore'
    - '& "$env:MSBUILD_PATH" "$env:SOLUTION_PATH" /nologo /t:Rebuild /p:Configuration=Debug'

job1:
  stage: job1
  script:
    - 'curl adress1'


job2:
  stage: trigger_SAP_service
  when: delayed
  start_in: 5 minutes
  only:
    - schedules
  script:
    - 'curl adress2'

how to add if condition for status=200 and transfer started in response.? İt is important for me please.

Aucun commentaire:

Enregistrer un commentaire