Advertisement
Guest User

Untitled

a guest
Mar 12th, 2018
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.64 KB | None | 0 0
  1. if(env.BRANCH_NAME == "master"){
  2.     //Something
  3. }else{
  4.     //Something else
  5. }
  6. library "lib@${env.BRANCH_NAME}"
  7. node(){
  8.     sh "mkdir ${Workspace}"
  9.     dir(Workspace){
  10.         checkout([$class: 'GitSCM', branches: [[name: "*/${env.BRANCH_NAME}"]],
  11.          doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [],
  12.          userRemoteConfigs: [[credentialsId: 'git', url:ssh://git@git.example.com/pipeline-sharedlib.git']]])
  13.         try{
  14.             //This
  15.         }catch(Exception e){
  16.             //Something went wrong
  17.             throw e
  18.         }finally{
  19.             //Clean it all up        
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement