richzhu
V2EX  ›  Node.js

Jenkins 运行 yarn build 失败,但是手动登录到服务器就成功

  •  
  •   richzhu · Dec 14, 2021 · 4567 views
    This topic created in 1613 days ago, the information mentioned may be changed or developed.

    各位大佬好,遇到了一个神奇的问题,我利用 jenkins 拉下来项目代码后,直接 ssh 登录到 jenkins 服务器上执行 yarn install yarn build 就没有什么问题,如果把这两条命令,放到 jenkins 的 shell 中,就会报错,而且没有错误日志,只是返回了一个

    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    Build step 'Execute shell' marked build as failure
    Finished: FAILURE
    

    求各位大佬指点一下 要怎么解决这个问题,非常感谢 😄

    CodeCodeStudy
        1
    CodeCodeStudy  
       Dec 14, 2021
    你 ssh 登录的是什么用户?用什么用户运行的 jenkins ?
    richzhu
        2
    richzhu  
    OP
       Dec 14, 2021
    大佬好,感谢回帖,我解决了,是因为缺少一条 CI=false 的环境变量,加上后就成功了😄 不加这条环境变量的话,warning 会被 shell 识别成 error
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   984 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 18:57 · PVG 02:57 · LAX 11:57 · JFK 14:57
    ♥ Do have faith in what you're doing.