• jenkins多job并发


    现在大系统都是用一个deploy job去部署,在pipeline里面配置了多个job,运行时间很长,所以考虑优化一下

    stage ('scrm deploy jobs'){ 
    build job: 'perf.scrm.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_branch', value: params.scrm_branch]]
    build job: 'perf.scrm-credit-base.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_credit_base_branch', value: params.scrm_credit_base_branch]]
    build job: 'perf.scrm-credit-core.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_credit_core_branch', value: params.scrm_credit_core_branch]]
    build job: 'perf.scrm-funds-core.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_funds_core_branch', value: params.scrm_funds_core_branch]]
    build job: 'perf.customerbase.deploy',parameters: [[$class: 'StringParameterValue', name: 'customerbase_branch', value: params.customerbase_branch]]
    build job: 'perf.scrm-gateway.deploy',parameters: [[$class: 'StringParameterValue', name: 'gateway_branch', value: params.gateway_branch]]
    build job: 'perf.scrm-behavior.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
    build job: 'perf.scrm-behavior-job.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
    build job: 'perf.scrm-search-core.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
    build job: 'perf.scrm-search-job.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
    build job: 'perf.scrm-customer-core-j.deploy',parameters : [[$class: 'StringParameterValue', name: 'scrm_customer_core_j_branch', value: params.scrm_customer_core_j_branch]]
    }

     看了下jenkins里面的语法提示

    改造成并发比较容易,不过考虑到有些模块之间的依赖关系,所以分组设置,不同组之间可以并发部署

    stage ('scrm deploy jobs'){
        
        parallel 'scrm.deploy':{
        build job: 'perf.scrm.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_branch', value: params.scrm_branch]]
        },'scrm-credit':{
        build job: 'perf.scrm-credit-base.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_credit_base_branch', value: params.scrm_credit_base_branch]]
        build job: 'perf.scrm-credit-core.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_credit_core_branch', value: params.scrm_credit_core_branch]]
        },'scrm-funds':{
        build job: 'perf.scrm-funds-core.deploy',parameters: [[$class: 'StringParameterValue', name: 'scrm_funds_core_branch', value: params.scrm_funds_core_branch]]
        },'scrm-customer':{
        build job: 'perf.scrm-customer-core-j.deploy',parameters : [[$class: 'StringParameterValue', name: 'scrm_customer_core_j_branch', value: params.scrm_customer_core_j_branch]]
        build job: 'perf.customerbase.deploy',parameters: [[$class: 'StringParameterValue', name: 'customerbase_branch', value: params.customerbase_branch]]
        },'scrm-gateway':{
        build job: 'perf.scrm-gateway.deploy',parameters: [[$class: 'StringParameterValue', name: 'gateway_branch', value: params.gateway_branch]]
        },'scrm-behavior':{
        build job: 'perf.scrm-behavior.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
        build job: 'perf.scrm-behavior-job.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
        },'scrm-search':{
        build job: 'perf.scrm-search-core.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
        build job: 'perf.scrm-search-job.deploy',parameters : [[$class: 'StringParameterValue', name: 'behavior_branch', value: params.behavior_branch]]
        },'scrm-benefit':{
        build job: 'perf.benefit-core.deploy',parameters : [[$class: 'StringParameterValue', name: 'core_branch', value: params.scrm_benefit_branch]]
        build job: 'perf.benefit-base.deploy',parameters : [[$class: 'StringParameterValue', name: 'base_branch', value: params.scrm_benefit_branch]]
        }
            
    }

    执行后查看,各个分组已经可以同时运行

    最后查看执行时间,缩短了80%

  • 相关阅读:
    egret 里面设置MovieClip的scale缩放值时,没有效果的情况
    游戏中的胜场数,净胜场数的计算
    使用Laya引擎和AS3(非原生AS)开发手游相关 总结常见bug
    javascript 一些注意事项
    JavaScript面向对象学习小结
    编写协议时注意事项
    Jenkins 在windows系统上的安装与使用
    LayaAir2.0 自定义Mesh-画圆环
    LayaAir2.0 自定义Mesh-画扇形
    Cocos Creator 使用 protobuf
  • 原文地址:https://www.cnblogs.com/opama/p/8213722.html
Copyright © 2020-2023  润新知