Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 1 | pipeline { |
2 | agent { | ||||
3 | kubernetes { | ||||
4 | label 'basyx-' + env.BRANCH_NAME + '-' + env.BUILD_NUMBER | ||||
5 | yaml """ | ||||
6 | apiVersion: v1 | ||||
7 | kind: Pod | ||||
8 | spec: | ||||
9 | containers: | ||||
10 | - name: postgresql | ||||
11 | image: postgres:latest | ||||
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 12 | resources: |
13 | requests: | ||||
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 14 | memory: "2Gi" |
15 | cpu: "0.5" | ||||
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 16 | limits: |
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 17 | memory: "2Gi" |
18 | cpu: "0.5" | ||||
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 19 | command: |
20 | - cat | ||||
21 | tty: true | ||||
22 | env: | ||||
23 | - name: POSTGRES_PASSWORD | ||||
24 | value: admin | ||||
25 | - name: PGDATA | ||||
26 | value: /run/postgresql/data | ||||
Thomas Psota | d856f5e | 2020-03-23 14:53:48 +0100 | [diff] [blame] | 27 | - name: java |
Thomas Psota | 4a2e1b6 | 2020-03-23 16:16:14 +0100 | [diff] [blame] | 28 | image: maven:3.6-jdk-8 |
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 29 | resources: |
30 | requests: | ||||
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 31 | memory: "3Gi" |
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 32 | cpu: "0.75" |
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 33 | limits: |
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 34 | memory: "3Gi" |
35 | cpu: "0.75" | ||||
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 36 | command: |
37 | - cat | ||||
38 | tty: true | ||||
39 | env: | ||||
40 | - name: MAVEN_CONFIG | ||||
41 | value: /home/jenkins/agent/.m2 | ||||
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 42 | - name: cpp |
43 | image: iesetps/basyx-ci-cpp:latest | ||||
44 | resources: | ||||
45 | requests: | ||||
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 46 | memory: "3Gi" |
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 47 | cpu: "0.75" |
48 | limits: | ||||
Thomas Psota | 0397c2c | 2019-12-06 02:21:12 +0100 | [diff] [blame] | 49 | memory: "3Gi" |
50 | cpu: "0.75" | ||||
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 51 | command: |
52 | - cat | ||||
53 | tty: true | ||||
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 54 | """ |
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 Psota | d856f5e | 2020-03-23 14:53:48 +0100 | [diff] [blame] | 71 | container('java') { |
Thomas Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 72 | sh ''' |
73 | mkdir /home/jenkins/agent/.m2 | ||||
74 | chmod +x ./ci/build_java.sh | ||||
75 | ./ci/build_java.sh | ||||
76 | ''' | ||||
77 | } | ||||
78 | } | ||||
79 | } | ||||
Thomas Psota | 17c2db4 | 2019-12-04 23:15:14 +0100 | [diff] [blame] | 80 | 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 Psota | 0bc7d0d | 2019-11-15 11:53:26 +0100 | [diff] [blame] | 90 | } |
Thomas Psota | d856f5e | 2020-03-23 14:53:48 +0100 | [diff] [blame] | 91 | } |