blob: 36385446a201fac5312a7ad5a888fea5aeede6ab [file] [log] [blame]
Thomas Psota0bc7d0d2019-11-15 11:53:26 +01001pipeline {
2 agent {
3 kubernetes {
4 label 'basyx-' + env.BRANCH_NAME + '-' + env.BUILD_NUMBER
5 yaml """
6apiVersion: v1
7kind: Pod
8spec:
9 containers:
10 - name: postgresql
11 image: postgres:latest
Thomas Psota17c2db42019-12-04 23:15:14 +010012 resources:
13 requests:
Thomas Psota0397c2c2019-12-06 02:21:12 +010014 memory: "2Gi"
15 cpu: "0.5"
Thomas Psota17c2db42019-12-04 23:15:14 +010016 limits:
Thomas Psota0397c2c2019-12-06 02:21:12 +010017 memory: "2Gi"
18 cpu: "0.5"
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010019 command:
20 - cat
21 tty: true
22 env:
23 - name: POSTGRES_PASSWORD
24 value: admin
25 - name: PGDATA
26 value: /run/postgresql/data
Thomas Psotad856f5e2020-03-23 14:53:48 +010027 - name: java
Thomas Psota4a2e1b62020-03-23 16:16:14 +010028 image: maven:3.6-jdk-8
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010029 resources:
30 requests:
Thomas Psota0397c2c2019-12-06 02:21:12 +010031 memory: "3Gi"
Thomas Psota17c2db42019-12-04 23:15:14 +010032 cpu: "0.75"
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010033 limits:
Thomas Psota0397c2c2019-12-06 02:21:12 +010034 memory: "3Gi"
35 cpu: "0.75"
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010036 command:
37 - cat
38 tty: true
39 env:
40 - name: MAVEN_CONFIG
41 value: /home/jenkins/agent/.m2
Thomas Psota17c2db42019-12-04 23:15:14 +010042 - name: cpp
43 image: iesetps/basyx-ci-cpp:latest
44 resources:
45 requests:
Thomas Psota0397c2c2019-12-06 02:21:12 +010046 memory: "3Gi"
Thomas Psota17c2db42019-12-04 23:15:14 +010047 cpu: "0.75"
48 limits:
Thomas Psota0397c2c2019-12-06 02:21:12 +010049 memory: "3Gi"
50 cpu: "0.75"
Thomas Psota17c2db42019-12-04 23:15:14 +010051 command:
52 - cat
53 tty: true
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010054"""
55 }
56 }
57 stages {
58 stage('Setup PostgreSQL') {
59 steps {
60 container('postgresql') {
61 sh '''
62 chmod +x ./ci/init_postgres.sh
63 ./ci/init_postgres.sh postgres
64 pg_ctl start
65 '''
66 }
67 }
68 }
69 stage('Java SDK Tests') {
70 steps {
Thomas Psotad856f5e2020-03-23 14:53:48 +010071 container('java') {
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010072 sh '''
73 mkdir /home/jenkins/agent/.m2
74 chmod +x ./ci/build_java.sh
75 ./ci/build_java.sh
76 '''
77 }
78 }
79 }
Thomas Psota17c2db42019-12-04 23:15:14 +010080 stage('C++ SDK Tests') {
81 steps {
82 container('cpp') {
83 sh '''
84 chmod +x ./ci/build_cpp.sh
85 ./ci/build_cpp.sh
86 '''
87 }
88 }
89 }
Thomas Psota0bc7d0d2019-11-15 11:53:26 +010090 }
Thomas Psotad856f5e2020-03-23 14:53:48 +010091}