blob: 85aa00b384b49394597b22e4f7ae7bef83357a11 [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 Williamsc3c83932018-10-30 13:56:37 -070016 - 'osam-test':
17 dependency-jobs: 'verify_osam_licensed'
18
Zack Williamsb531e572018-10-23 09:03:33 -070019# - 'tag-collision-reject':
20# dependency-jobs: 'verify_osam_licensed'
21# - 'verify-sonarqube':
22# dependency-jobs: 'verify_osam_tag-collision'
23# sonar-prep-commands: './build.sh'
24# sonar-java-binaries: 'target'
Zack Williamsc3c83932018-10-30 13:56:37 -070025
26
27- job-template:
28 id: 'osam-test'
29 name: 'verify_{project}_test'
30
31 description: |
32 Created by {id} job-template from ci-management/jjb/verify/osam.yaml
33
34 triggers:
35 - cord-infra-gerrit-trigger-patchset:
36 gerrit-server-name: '{gerrit-server-name}'
37 project-regexp: '^{project}$'
38 branch-regexp: '{branch-regexp}'
39 dependency-jobs: '{dependency-jobs}'
40 file-include-regexp: '{all-files-regexp}'
41
42 properties:
43 - cord-infra-properties:
44 build-days-to-keep: '{build-days-to-keep}'
45 artifact-num-to-keep: '{artifact-num-to-keep}'
46
47 wrappers:
48 - lf-infra-wrappers:
49 build-timeout: 20
50 jenkins-ssh-credential: '{jenkins-ssh-credential}'
51
52 scm:
53 - cord-infra-gerrit-scm:
54 git-url: '$GIT_URL/$GERRIT_PROJECT'
55 refspec: '$GERRIT_REFSPEC'
56 branch: '$GERRIT_BRANCH'
57 submodule-recursive: 'false'
58 choosing-strategy: 'gerrit'
59 jenkins-ssh-credential: '{jenkins-ssh-credential}'
60 basedir: '{project}'
61
62 node: 'ubuntu16.04-basebuild-1c-2g'
63 project-type: freestyle
64 concurrent: true
65
66 builders:
67 - shell: |
68 #!/usr/bin/env bash
69 set -eux -o pipefail
70
71 echo "Starting database for OSAM tests"
72
73 # pull database
74 docker pull mariadb:10.3-bionic
75
76 # run database
77 # Settings for the following commmand must match values given
78 # in: osam-core/model/src/main/resources/application.properties
79
80 docker run -d -p -p 3306:3306 --name springbootdb \
81 -e MYSQL_DATABASE=osam_core \
82 -e MYSQL_USER=root \
83 -e MYSQL_ROOT_PASSWORD=123456 \
84 mariadb:10.3-bionic
85
86 # wait for mariadb to start up
87 sleep 30
88
89 - maven-target:
90 goals: "test"
91 pom: "pom.xml"
92 # java-opts option is a workaround for:
93 # Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter
94 # solutionfound here: https://stackoverflow.com/a/53085816
95 java-opts:
96 - "-Djdk.net.URLClassPath.disableClassPathURLCheck=true"
97
98 publishers:
99 - postbuildscript:
100 builders:
101 - build-on:
102 - SUCCESS
103 - UNSTABLE
104 - FAILURE
105 build-steps:
106 - shell: |
107 #!/usr/bin/env bash
108 set -eux -o pipefail
109
110 echo "Stopping database"
111 docker rm -f springbootdb
112