【问题标题】:Node application failing to come up from JenkinsJenkins 无法启动节点应用程序
【发布时间】:2020-06-21 17:19:15
【问题描述】:

我有一个通过 Jenkins 运行的 ansible 文件

  shell: 'unzip -o p.zip'
  args:
    chdir: '/home/ec2-user/'
- pause: seconds=10
- name:  install eslint
  shell: 'npm install -g eslint --unsafe-perm=true --allow-root'
  args:
    chdir: '/home/ec2-user/'
- name:  remove node-sass
  shell: 'npm uninstall --save-dev node-sass'
  args:
    chdir: '/home/ec2-user/'
- name:  install node-sass
  shell: 'npm install --save-dev node-sass'
  args:
    chdir: '/home/ec2-user/'
  failed_when: false
- pause: seconds=10
- name:  start ng serve
  shell: 'ng serve --port 4401 --host 0.0.0.0 --verbose &'
  args:
    chdir: '/home/ec2-user/'

但是应用程序被杀死了。 当我手动运行最后一个命令时,它会启动服务:--ng serve --port 4401 --host 0.0.0.0 --verbose &

同样的命令通过 ansible 失败

【问题讨论】:

  • 有错误吗?剧本的哪一步失败了?
  • 运行成功没有错误

标签: node.js angular jenkins ansible


【解决方案1】:

以下更改有效 shell: 'nohup ng serve --port 4401 --host 0.0.0.0 > nohup.out 2>&1 &'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多