blob: a89f1cccf76cbe68c111ae8abbc783521be0d7ec [file] [log] [blame]
Zack Williamsb531e572018-10-23 09:03:33 -07001---
2# verification jobs for 'osam' repo
3
4- project:
5 name: osam
6 project: '{name}'
7
8 jobs:
9 - 'verify-osam-jobs':
10 branch-regexp: '{supported-branches-regexp}'
11
12- job-group:
13 name: 'verify-osam-jobs'
14 jobs:
15 - 'verify-licensed'
Zack Williams83a475b2018-12-13 09:26:48 -070016 - 'osam-test':
Zack Williamsad92e6e2020-10-07 09:54:10 -070017 dependency-jobs: 'verify_osam_licensed'
Zack Williamsc3c83932018-10-30 13:56:37 -070018
19- job-template:
20 id: 'osam-test'
21 name: 'verify_{project}_test'
22
23 description: |
24 Created by {id} job-template from ci-management/jjb/verify/osam.yaml
25
26 triggers:
27 - cord-infra-gerrit-trigger-patchset:
28 gerrit-server-name: '{gerrit-server-name}'
29 project-regexp: '^{project}$'
30 branch-regexp: '{branch-regexp}'
31 dependency-jobs: '{dependency-jobs}'
32 file-include-regexp: '{all-files-regexp}'
33
34 properties:
35 - cord-infra-properties:
36 build-days-to-keep: '{build-days-to-keep}'
37 artifact-num-to-keep: '{artifact-num-to-keep}'
38
39 wrappers:
40 - lf-infra-wrappers:
Zack Williams1068edd2018-11-08 08:40:12 -070041 build-timeout: 40
Zack Williamsc3c83932018-10-30 13:56:37 -070042 jenkins-ssh-credential: '{jenkins-ssh-credential}'
43
44 scm:
45 - cord-infra-gerrit-scm:
46 git-url: '$GIT_URL/$GERRIT_PROJECT'
47 refspec: '$GERRIT_REFSPEC'
48 branch: '$GERRIT_BRANCH'
49 submodule-recursive: 'false'
50 choosing-strategy: 'gerrit'
51 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Zack Williamsa6261442018-11-01 14:00:35 -070052 basedir: '{basedir}'
Zack Williamsc3c83932018-10-30 13:56:37 -070053
54 node: 'ubuntu16.04-basebuild-1c-2g'
55 project-type: freestyle
56 concurrent: true
57
58 builders:
Zack Williams77e2d3c2018-11-14 09:58:31 -070059 # NOTE: this env var is only required to fix a bug in the "surefire" dependency:
60 # https://issues.apache.org/jira/browse/SUREFIRE-1588
61 # https://github.com/apache/maven-surefire/pull/197
62 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
63 # should be removed as soon as this problem is resolved
64 - inject:
65 properties-content: |
66 _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
67
Zack Williamsc3c83932018-10-30 13:56:37 -070068 - shell: |
69 #!/usr/bin/env bash
70 set -eux -o pipefail
71
72 echo "Starting database for OSAM tests"
73
74 # pull database
75 docker pull mariadb:10.3-bionic
76
77 # run database
78 # Settings for the following commmand must match values given
79 # in: osam-core/model/src/main/resources/application.properties
80
Zack Williamsa6261442018-11-01 14:00:35 -070081 docker run -d -p 3306:3306 --name springbootdb \
Zack Williamsc3c83932018-10-30 13:56:37 -070082 -e MYSQL_DATABASE=osam_core \
83 -e MYSQL_USER=root \
84 -e MYSQL_ROOT_PASSWORD=123456 \
85 mariadb:10.3-bionic
86
Zack Williamsa6261442018-11-01 14:00:35 -070087 # wait for mariadb to start up, print docker container status
88 sleep 15
89 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -070090
91 - maven-target:
92 goals: "test"
93 pom: "pom.xml"
Zack Williamsc3c83932018-10-30 13:56:37 -070094
95 publishers:
96 - postbuildscript:
97 builders:
98 - build-on:
99 - SUCCESS
100 - UNSTABLE
101 - FAILURE
102 build-steps:
103 - shell: |
104 #!/usr/bin/env bash
105 set -eux -o pipefail
106
107 echo "Stopping database"
Zack Williamsa6261442018-11-01 14:00:35 -0700108 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -0700109 docker rm -f springbootdb
110