小编Guy*_*ans的帖子

使用PM2永远运行NodeJs http-server

我的问题是关于与PM2一起运行HTTP服务器.

我面临的问题是:

  1. HTTP服务器需要输入作为网站根目录的文件夹和运行网站的端口号.
  2. 即使使用-g选项安装HTTP服务器,PM2也无法识别HTTP-server命令.

所以我尝试了以下(请注意应该将参数传递给HTTP服务器脚本的双破折号:

/node_modules/http-server/lib$ pm2 start http-server.js -- /home/unixuser/websiteroot -p8686
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

我也尝试过:

http-server /home/unixuser/websiteroot -p8686
Run Code Online (Sandbox Code Playgroud)

哪个有效,但没有pm2的大力支持?

任何建议都会很棒,谢谢!

httpserver node.js pm2

16
推荐指数
2
解决办法
1万
查看次数

詹金斯和纽曼 - 报告未显示

我在 JenkinsFile 中定义了以下步骤,该步骤在运行 Jenkins 管道时生成 html 报告:

        stage('Run Integration Tests') {
            steps {
                        dir("${env.WORKSPACE}/test/integration") {
                            sh'''
                                npm install -g newman
                                npm install -g newman-reporter-htmlextra
                                newman run postman_collection.json -e ''' +APIGEE_ENVIRONMENT+'''.postman_environment.json --reporters cli,htmlextra --reporter-htmlextra-export "newman_result.html"
                            '''
                        }
            }
        }
Run Code Online (Sandbox Code Playgroud)

然后我尝试发布此报告,但无论我尝试什么,它都不会显示该报告,而是显示一个空的 html 页面。我可能在配置中弄乱了一些东西,但我现在已经在这个问题上坚持了几个小时了。我希望有人能找到缺失的部分。预先非常感谢您。

        stage('Artifacts') {
            steps {
                publishHTML(target: [
                    alwaysLinkToLastBuild: false,
                    allowMissing: false,
                    keepAll: true,
                    reportDir: "${WORKSPACE}",
                    reportFiles: 'newman_result.html',
                    reportName: 'Integration Test Results',
                    reportTitles: ''
                ])
            }
        }
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-plugins jenkins-groovy postman-newman

5
推荐指数
1
解决办法
446
查看次数