| Matthias Andreas Benkard | dd72247 | 2020-04-28 07:21:53 +0200 | [diff] [blame] | 1 | // -*- mode: groovy -*- | 
 | 2 | pipeline { | 
 | 3 |  | 
 | 4 |   agent { | 
 | 5 |     kubernetes { | 
 | 6 |       cloud 'kubernetes' | 
 | 7 |       label 'mulkcms2-v1' | 
 | 8 |       yaml """ | 
 | 9 |         apiVersion: v1 | 
 | 10 |         kind: Pod | 
 | 11 |         metadata: {} | 
 | 12 |         spec: | 
 | 13 |           containers: | 
 | 14 |             - name: main | 
 | 15 |               image: adoptopenjdk:14-hotspot-bionic | 
 | 16 |               tty: true | 
 | 17 |               command: | 
 | 18 |                 - /bin/cat | 
 | 19 |       } | 
 | 20 |       """ | 
 | 21 |     } | 
 | 22 |   } | 
 | 23 |  | 
 | 24 |   stages { | 
 | 25 |  | 
 | 26 |     stage('Build & Test') { | 
 | 27 |       steps { | 
 | 28 |         container('main') { | 
 | 29 |           cache(maxCacheSize: 1000, caches: [ | 
 | 30 |               [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: "$HOME/.m2"], | 
 | 31 |               [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: "$HOME/.yarn-cache"], | 
 | 32 |           ]) { | 
 | 33 |             ansiColor('xterm') { | 
 | 34 |               sh """ | 
 | 35 |                 apt-get -y update | 
 | 36 |                 apt-get -y install --no-install-recommends npm | 
 | 37 |                 npm install -g yarn | 
 | 38 |                 yarn config set cache-folder $HOME/.yarn-cache | 
| Matthias Andreas Benkard | 0a73944 | 2020-04-28 08:49:54 +0200 | [diff] [blame] | 39 |                 ./mvnw package -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true | 
| Matthias Andreas Benkard | dd72247 | 2020-04-28 07:21:53 +0200 | [diff] [blame] | 40 |               """ | 
 | 41 |             } | 
 | 42 |           } | 
 | 43 |         } | 
 | 44 |       } | 
 | 45 |     } | 
 | 46 |  | 
 | 47 |     stage('Archive artifacts') { | 
 | 48 |       steps { | 
 | 49 |         container('main') { | 
 | 50 |           recordIssues tools: [ | 
 | 51 |               mavenConsole(), | 
 | 52 |               java() | 
 | 53 |           ] | 
 | 54 |         } | 
 | 55 |       } | 
 | 56 |     } | 
 | 57 |  | 
 | 58 |   } | 
 | 59 | } |