summaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: d11ad69f08a2a86920f5960a1a4b53fa2feca14b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// -*- mode: groovy -*-
pipeline {

  agent {
    kubernetes {
      cloud 'kubernetes'
      label 'mulkcms2-v1'
      yaml """
        apiVersion: v1
        kind: Pod
        metadata: {}
        spec:
          containers:
            - name: main
              image: adoptopenjdk:14-hotspot-bionic
              tty: true
              command:
                - /bin/cat
      }
      """
    }
  }

  stages {

    stage('Build & Test') {
      steps {
        container('main') {
          cache(maxCacheSize: 1000, caches: [
              [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: "$HOME/.m2"],
              [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: "$HOME/.yarn-cache"],
          ]) {
            ansiColor('xterm') {
              sh """
                apt-get -y update
                apt-get -y install --no-install-recommends npm
                npm install -g yarn
                yarn config set cache-folder $HOME/.yarn-cache
                ./mvnw package -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
              """
            }
          }
        }
      }
    }

    stage('Archive artifacts') {
      steps {
        container('main') {
          recordIssues tools: [
              mavenConsole(),
              java()
          ]
        }
      }
    }

  }
}