其他分享
首页 > 其他分享> > Jenkinsfile 构建 接口自动化

Jenkinsfile 构建 接口自动化

作者:互联网

1.git 上维护一份Jenkinsfile文件,内容如下:

pipeline {
    agent any

    stages {
        stage('pull JMX') {
            steps {
                checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '1c711e8e-d7fb-4521-8634-0d2b1a3333e0', url: 'git@192.168.184.149:test_group/autotest.git']]])
            }
        }
         stage('RUN') {
            steps {
                sh '/opt/ant/bin/ant -file build.xml run'
            }
        }
    }
    post {
    	always {
    	  publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '/root/test_report/html', reportFiles: 'TestReport.html', reportName: 'HTML Report', reportTitles: 'AUTOTEST'])
    	}
    }
}

如下:

  1. Jenkinsfile steps中的内容说明:

pull code:

run: 固定写法
post - always:

标签:git,false,接口,ant,html,steps,自动化,Jenkinsfile
来源: https://www.cnblogs.com/czzz/p/16461969.html