• jenkins pipeline


    node('builder-chengdu-arm64-245') {
        
        stage('AT-AMD') {
    
            deleteDir()
    
            git credentialsId: '91755e02-e0c9-4507-ab3d-3cbde96f98cf', url: 'git@gitlabcd.uniontech.com:autotest/cd-desktop-app.git'
    
            sh'''
                user=amd-1  
                ip=10.8.13.34
                work_space=${WORKSPACE}
                romete_project_path=/home/${user}/Documents/cd-desktop-app
    
                # 删除历史代码
                ssh ${user}@${ip} "rm -rf ${romete_project_path} && mkdir ${romete_project_path}"
                # 发送最新代码到测试机
                scp -r ${work_space}/* ${user}@${ip}:${romete_project_path}/
                # 执行多媒体
                ssh ${user}@${ip} "cd ${romete_project_path}/run/run_1040/media_run/ && python3 camera_run.py"
                # 返回报告
                sleep 5
                scp ${user}@${ip}:${romete_project_path}/report/${user}*.xml ${work_space}/report/allure_result_amd/
            '''
    
            allure includeProperties: false, jdk: '', results: [[path: 'report/allure_results_amd']]
        }
        
    }
    
    import groovy.json.JsonSlurperClassic
    import groovy.json.JsonOutput
    
    node('builder-chengdu-arm64-245') {
        try {
            stage('拉取代码') {
                deleteDir()
        
                git branch: 'dev-cases', credentialsId: '91755e02-e0c9-4507-ab3d-3cbde96f98cf', url: 'git@gitlabcd.uniontech.com:autotest/cd-desktop-app.git'
            }
            stage('AT') {
                parallel amd: {
                    sh '''
                        user=amd-2
                        ip=10.8.13.38
                      
                        romete_project_path=/home/${user}/Documents/cd-desktop-app
            
                        # 删除历史代码
                        ssh ${user}@${ip} "rm -rf ${romete_project_path} && mkdir ${romete_project_path}"
                        # 发送最新代码到测试机
                        scp -r ${WORKSPACE}/* ${user}@${ip}:${romete_project_path}/
                        # 执行多媒体
                        ssh ${user}@${ip} "cd ${romete_project_path}/run/run_1040/media_run/ && python3 image_viewer_run.py"
                        # 返回报告
                        sleep 5
                        scp ${user}@${ip}:${romete_project_path}/report/allure_results/* ${WORKSPACE}/report/allure_results_amd/
                    '''
    
                    allure includeProperties: false, jdk: '', results: [[path: 'report/allure_results_amd']]
                }, arm: {
                    sh '''
                        user=arm-2  
                        ip=10.8.13.36
                        
                        romete_project_path=/home/${user}/Documents/cd-desktop-app
    
                        # 删除历史代码
                        ssh ${user}@${ip} "rm -rf ${romete_project_path} && mkdir ${romete_project_path}"
                        # 发送最新代码到测试机
                        scp -r ${WORKSPACE}/* ${user}@${ip}:${romete_project_path}/
                        # 执行多媒体
                        ssh ${user}@${ip} "cd ${romete_project_path}/run/run_1040/media_run/ && python3 image_viewer_run.py"
                        # 返回报告
                        sleep 5
                        scp ${user}@${ip}:${romete_project_path}/report/allure_results/* ${WORKSPACE}/report/allure_results_arm/
                    '''
    
                    allure includeProperties: false, jdk: '', results: [[path: 'report/allure_results_arm']]
                }, mips: {
                    sh '''
                        user=mips-1
                        ip=10.8.13.14
                        
                        romete_project_path=/home/${user}/Documents/cd-desktop-app
    
                        # 删除历史代码
                        ssh ${user}@${ip} "rm -rf ${romete_project_path} && mkdir ${romete_project_path}"
                        # 发送最新代码到测试机
                        scp -r ${WORKSPACE}/* ${user}@${ip}:${romete_project_path}/
                        # 执行多媒体
                        ssh ${user}@${ip} "cd ${romete_project_path}/run/run_1040/media_run/ && python3 image_viewer_run.py"
                        # 返回报告
                        sleep 5
                        scp ${user}@${ip}:${romete_project_path}/report/allure_results/* ${WORKSPACE}/report/allure_results_mips/
                    '''
    
                    allure includeProperties: false, jdk: '', results: [[path: 'report/allure_results_mips']]
                    }
                }
            }
        catch (err) {
            currentBuild.result = 'FAILURE'
        }
        finally {
        }
    }
    
    没伞的孩子,就要学会在雨中奔跑!
  • 相关阅读:
    DOS命令大全 1 attrib,delete等 外部 内部 命令都有
    css图像映射
    简单的css样式控制分页效果
    (转)AjaxPro实现机制探讨——Ajax是如何调用服务器端C#方法?
    学习笔记ADO.Net方面
    一个挺好用的数据库操作类
    .net开发人员应该知道(二)
    js与C#之间相互调用的一些方法
    JS 事件大全
    .net开发人员应该知道(一)
  • 原文地址:https://www.cnblogs.com/mikigo/p/14674045.html
Copyright © 2020-2023  润新知