繁体   English   中英

在nodejs中构建jenkins管道

[英]building jenkins pipeline in nodejs

我需要实现这个:

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 所以我不知道我需要做什么。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM