blob: ffa1a02e479edad86e5e60b0f9c412f89d5c1880 [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:
Zack Williams1068edd2018-11-08 08:40:12 -070049 build-timeout: 40
Zack Williamsc3c83932018-10-30 13:56:37 -070050 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}'
Zack Williamsa6261442018-11-01 14:00:35 -070060 basedir: '{basedir}'
Zack Williamsc3c83932018-10-30 13:56:37 -070061
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
Zack Williamsa6261442018-11-01 14:00:35 -070080 docker run -d -p 3306:3306 --name springbootdb \
Zack Williamsc3c83932018-10-30 13:56:37 -070081 -e MYSQL_DATABASE=osam_core \
82 -e MYSQL_USER=root \
83 -e MYSQL_ROOT_PASSWORD=123456 \
84 mariadb:10.3-bionic
85
Zack Williamsa6261442018-11-01 14:00:35 -070086 # wait for mariadb to start up, print docker container status
87 sleep 15
88 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -070089
90 - maven-target:
91 goals: "test"
92 pom: "pom.xml"
93 # java-opts option is a workaround for:
94 # Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter
95 # solutionfound here: https://stackoverflow.com/a/53085816
96 java-opts:
97 - "-Djdk.net.URLClassPath.disableClassPathURLCheck=true"
98
99 publishers:
100 - postbuildscript:
101 builders:
102 - build-on:
103 - SUCCESS
104 - UNSTABLE
105 - FAILURE
106 build-steps:
107 - shell: |
108 #!/usr/bin/env bash
109 set -eux -o pipefail
110
111 echo "Stopping database"
Zack Williamsa6261442018-11-01 14:00:35 -0700112 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -0700113 docker rm -f springbootdb
114