blob: f5e0e8bcadb9746dc22cb90cf1975d7415dbe63b [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 - 'verify-sonarqube':
Zack Williamsc9fea682019-01-16 18:12:33 -070017 build-timeout: 40
Zack Williamsc3c83932018-10-30 13:56:37 -070018 dependency-jobs: 'verify_osam_licensed'
Zack Williams83a475b2018-12-13 09:26:48 -070019 sonar-prep-commands: 'mvn compile'
20 sonar-java-binaries: 'osam-core'
21 - 'osam-test':
22 dependency-jobs: 'verify_osam_sonarqube'
Zack Williamsc3c83932018-10-30 13:56:37 -070023
Zack Williamsb531e572018-10-23 09:03:33 -070024# - 'tag-collision-reject':
25# dependency-jobs: 'verify_osam_licensed'
Zack Williamsc3c83932018-10-30 13:56:37 -070026
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:
Zack Williams77e2d3c2018-11-14 09:58:31 -070067 # NOTE: this env var is only required to fix a bug in the "surefire" dependency:
68 # https://issues.apache.org/jira/browse/SUREFIRE-1588
69 # https://github.com/apache/maven-surefire/pull/197
70 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
71 # should be removed as soon as this problem is resolved
72 - inject:
73 properties-content: |
74 _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
75
Zack Williamsc3c83932018-10-30 13:56:37 -070076 - shell: |
77 #!/usr/bin/env bash
78 set -eux -o pipefail
79
80 echo "Starting database for OSAM tests"
81
82 # pull database
83 docker pull mariadb:10.3-bionic
84
85 # run database
86 # Settings for the following commmand must match values given
87 # in: osam-core/model/src/main/resources/application.properties
88
Zack Williamsa6261442018-11-01 14:00:35 -070089 docker run -d -p 3306:3306 --name springbootdb \
Zack Williamsc3c83932018-10-30 13:56:37 -070090 -e MYSQL_DATABASE=osam_core \
91 -e MYSQL_USER=root \
92 -e MYSQL_ROOT_PASSWORD=123456 \
93 mariadb:10.3-bionic
94
Zack Williamsa6261442018-11-01 14:00:35 -070095 # wait for mariadb to start up, print docker container status
96 sleep 15
97 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -070098
99 - maven-target:
100 goals: "test"
101 pom: "pom.xml"
Zack Williamsc3c83932018-10-30 13:56:37 -0700102
103 publishers:
104 - postbuildscript:
105 builders:
106 - build-on:
107 - SUCCESS
108 - UNSTABLE
109 - FAILURE
110 build-steps:
111 - shell: |
112 #!/usr/bin/env bash
113 set -eux -o pipefail
114
115 echo "Stopping database"
Zack Williamsa6261442018-11-01 14:00:35 -0700116 docker ps -a
Zack Williamsc3c83932018-10-30 13:56:37 -0700117 docker rm -f springbootdb
118