【问题标题】:building jenkins pipeline in nodejs在 nodejs 中构建 jenkins 管道
【发布时间】:2020-07-18 16:35:35
【问题描述】:

我需要实现这个:

pipeline {
    agent none
    stages {
        stage('Build') {
            agent {
                docker {
                    image 'python:2-alpine'
                }
            }
            steps {
                sh 'python -m py_compile sources/add2vals.py sources/calc.py'
            }
        }
        stage('Test') {
            agent {
                docker {
                    image 'qnib/pytest'
                }
            }
            steps {
                sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
            }
            post {
                always {
                    junit 'test-reports/results.xml'
                }
            }
        }
    }
}

在 nodejs express 项目上并使用 mocha 和 chai 运行单元测试, 这是我的代码:

pipeline {
    agent { docker { image 'node:6.3' } }
    stages {
        stage('build') {
            steps {
                sh 'npm --version'
            }
        }
    }
}

谁能告诉我应该怎么做?这个例子是用python的,所以我不知道我需要做什么。

【问题讨论】:

    标签: node.js express jenkins mocha.js chai


    【解决方案1】:

    我会看看 Jenkins 博客上的资源。您正在查看的是位于项目目录根目录中的 Jenkinsfile。

    https://jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多