代码之家  ›  专栏  ›  技术社区  ›  DrRoach

Gitlab CI YML语法错误

  •  1
  • DrRoach  · 技术社区  · 8 年前

    Error: (<unknown>): mapping values are not allowed in this context at line 10 column 15

    before-script:
        - bash ci/install.sh > /dev/null
    
    cache:
        paths:
        - vendor/
    
    test:5.6:
        image: php:5.6
            script: 
            - vendor/bin/codecept run
    
    test:7.0:
        image: php:7.0
            script: 
            - vendor/bin/codecept run
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   DrRoach    8 年前

    玩了一玩过梁后,我发现正确的语法是:

    before_script:
    - bash ci/install.sh > /dev/null
    
    test:5.6:
      image: php:5.6
    
      script:
      - vendor/bin/codecept run
    
    test:7.0:
      image: php:7.0
    
      script:
      - vendor/bin/codecept run