Travis CI构建错误

4

我通过语义化版本控制工具"semantic-release"生成了一个travis.yml文件,它看起来像这样:

sudo: false
language: node_js
cache:
  directories:
    - node_modules
notifications:
  email: false
node_js:
  - 'iojs'
before_install:
  - npm i -g npm@^2.0.0
before_script:
  - npm prune
  script:
  - npm run test:single
after_success:
  - npm run semantic-release
branches:
  except:
    - /^v\d+\.\d+\.\d+$/

在进行git push之后,我从Travis收到以下错误信息:
ERROR: An error occured while trying to parse your .travis.yml file.
Please make sure that the file is valid YAML.
http://lint.travis-ci.org can check your .travis.yml.
The log message was: Build config file had a parse error: did not find expected '-' indicator while parsing a block collection at line 13 column 3.

我在Travis的邮件中还收到了以下系统消息:

系统消息: 由于新的sudo启用的Precise和Trusty镜像,我们看到了构建失败。更多细节请参见此处。感谢您的耐心等待。

那么,我的travis.yml文件中是否有错误,还是其他原因导致的呢?

谢谢, Sohail


1
你把它粘贴到 lint.travis-ci.org 了吗? - cartant
2个回答

3

从中去除空格:

  script:
  - npm run test:single

to:

script:
  - npm run test:single

1

太好了,知道它已经修复了 :) - gonephishing
1
您的链接已过时。 - recursion.ninja
2
是的,他们关闭了网站:/ 如果你找到了替代方案,请在这里更新。 - gonephishing
https://github.com/travis-ci/travis.rb#lint - amohr
3
你可以在http://www.yamllint.com/上在线检查你的travis.yml文件是否存在简单的语法错误。 - naXa stands with Ukraine
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接