qdyxmas's Room

Done is better than perfect...

pipeline语法汇总

def services_to_build = params.services.split(',');
pipeline {
  agent any
  stages {
    stage("start") {
      steps {
        echo ("拉取${params.services}代码");
      }
    }
    stage("update code") {
      steps {
        script {
          for (i = 0; i < services_to_build.size(); i++) {
            def service = services_to_build[i];
            echo ("开始拉${service}的代码"); 
            dir("${service}") {
                echo ("service=${service}的代码"); 
                git branch: "${source_branch}", credentialsId: 'xxxxxxxxxxxx', url: "https://git.xkool.org/xkool/${service}.git" ;
                //checkout 目的分支
                checkout([$class: 'GitSCM', branches: [[name: "${target_branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "${target_branch}"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'xxxxxxxxxxxx', url: "https://git.xkool.org/xkool/${service}.git"]]]);
            }
          }
        }
      }
    }  
    stage("compare branch") {
       steps {
        sh("python3 diff_branch.py ${source_branch} ${target_branch}")
      }  
    }
  }
}

4 评论

  1. Tarah
    /回复

    Thanks for writing this awesome article. I'm a long time reader but I've never been compelled to leave a comment. I subscribed to your blog and shared this on my Twitter. Thanks again for a great post! https://museefashionboutique.com/

  2. Gladis
    /回复

    I will appreciate for those who proceed this in future. Many folks will probably be benefited from your writing. Cheers!| https://valeriecampion.com/

  3. CharlesVex
    /回复

    “I haven’t seen you in these parts,” the barkeep said, sidling during to where I sat. “Personage’s Bao.” He stated it exuberantly, as if say of his exploits were shared aside settlers hither many a firing in Aeternum. He waved to a wooden butt upset us, and I returned his token with a nod. He filled a field-glasses and slid it to me across the stained red wood of the court first continuing. “As a betting houseman, I’d be assenting to wager a fair bit of coin you’re in Ebonscale Reach for more than the wet one's whistle and sights,” he said, eyes glancing from the sword sheathed on my hip to the capitulate slung across my back. http://www.google.kz/url?q=https://renewworld.ru/

  4. CharlesVex
    /回复

    “I haven’t seen you in these parts,” the barkeep said, sidling over to where I sat. “Designation’s Bao.” He stated it exuberantly, as if word of his exploits were shared by way of settlers around assorted a ‚lan in Aeternum. He waved to a expressionless keg beside us, and I returned his indication with a nod. He filled a eyeglasses and slid it to me across the stained red wood of the excluding before continuing. “As a betting chains, I’d be assenting to wager a adequate portion of coin you’re in Ebonscale Reach for the purpose more than the carouse and sights,” he said, eyes glancing from the sword sheathed on my hip to the bend slung across my back. https://maps.google.com.pe/url?q=https://renewworld.ru/otlichie-new-world-versii-deluxe-i-standart-edition/

评论