Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 3.42 KB | None | 0 0
  1. if (params.ENVIRONMENT == 'Cloud'){
  2.     stage('Get commit'){
  3.         podTemplate(label: jnlp, cloud: 'aks', containers:[
  4.             containerTemplate(
  5.                 name: 'jnlp',
  6.                 image: 'jenkins/jnlp-slave:3.27-1-alpine',  
  7.                 alwaysPullImage: false,
  8.                 args: '${computer.jnlpmac} ${computer.name}'  
  9.             ),
  10.         ])
  11.         {
  12.             node(jnlp) {
  13.                 stage('Git checkout'){
  14.                     scmVars = checkout scm
  15.                     commit = scmVars.GIT_COMMIT
  16.                 }
  17.             }
  18.         }
  19.     }
  20.     stage('stage for parallel'){
  21.         parallel (
  22.             el5: {
  23.                 stage('Building module:el5'){                  
  24.                     podTemplate(label: el5, cloud: 'aks', containers:[
  25.                         containerTemplate(
  26.                             name: 'el5',
  27.                             image: 'sandbox.repo/oa-build-envs/el5:8.3.6',  
  28.                             alwaysPullImage: false,
  29.                             command: 'cat',
  30.                             ttyEnabled: true,
  31.                             resourceRequestCpu: '5000m',
  32.                             resourceRequestMemory: '5G'
  33.                         ),
  34.                     ],
  35.                     imagePullSecrets:  [ 'sandbox-secret' ]
  36.                     )
  37.                     {
  38.                         node(el5) {
  39.                             container('el5') {
  40.                                 timestamps {
  41.                                     wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
  42.                                         timeout(time: 60, unit: 'MINUTES') {
  43.                                             gitCheckout(commit)
  44.                                             modulesBuild()  
  45.                                         }
  46.                                     }
  47.                                 }
  48.                             }
  49.                         }
  50.                     }
  51.                 }
  52.             },
  53.             el6: {
  54.                 stage('Building module: el6'){        
  55.                     podTemplate(label: el6, cloud: 'aks', containers:[
  56.                         containerTemplate(
  57.                             name: 'el6',
  58.                             image: 'sandbox.repo/oa-build-envs/el6:8.3.5',  
  59.                             alwaysPullImage: false,
  60.                             command: 'cat',
  61.                             ttyEnabled: true,
  62.                             resourceRequestCpu: '5000m',
  63.                             resourceRequestMemory: '5G'
  64.                         ),
  65.                     ],
  66.                     imagePullSecrets:  [ 'sandbox-secret' ]
  67.                     )
  68.                     {
  69.                         node(el6) {
  70.                             container('el6') {
  71.                                 timestamps {
  72.                                     wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
  73.                                         timeout(time: 60, unit: 'MINUTES') {
  74.                                             gitCheckout(commit)
  75.                                             modulesBuild()  
  76.                                         }
  77.                                     }
  78.                                 }
  79.                             }
  80.                         }
  81.                     }
  82.                 }
  83.             }
  84.         )  
  85.     }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement