Zack Williams | b531e57 | 2018-10-23 09:03:33 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | 83a475b | 2018-12-13 09:26:48 -0700 | [diff] [blame] | 16 | - 'verify-sonarqube': |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 17 | dependency-jobs: 'verify_osam_licensed' |
Zack Williams | 83a475b | 2018-12-13 09:26:48 -0700 | [diff] [blame] | 18 | sonar-prep-commands: 'mvn compile' |
| 19 | sonar-java-binaries: 'osam-core' |
| 20 | - 'osam-test': |
| 21 | dependency-jobs: 'verify_osam_sonarqube' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 22 | |
Zack Williams | b531e57 | 2018-10-23 09:03:33 -0700 | [diff] [blame] | 23 | # - 'tag-collision-reject': |
| 24 | # dependency-jobs: 'verify_osam_licensed' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 25 | |
| 26 | - job-template: |
| 27 | id: 'osam-test' |
| 28 | name: 'verify_{project}_test' |
| 29 | |
| 30 | description: | |
| 31 | Created by {id} job-template from ci-management/jjb/verify/osam.yaml |
| 32 | |
| 33 | triggers: |
| 34 | - cord-infra-gerrit-trigger-patchset: |
| 35 | gerrit-server-name: '{gerrit-server-name}' |
| 36 | project-regexp: '^{project}$' |
| 37 | branch-regexp: '{branch-regexp}' |
| 38 | dependency-jobs: '{dependency-jobs}' |
| 39 | file-include-regexp: '{all-files-regexp}' |
| 40 | |
| 41 | properties: |
| 42 | - cord-infra-properties: |
| 43 | build-days-to-keep: '{build-days-to-keep}' |
| 44 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 45 | |
| 46 | wrappers: |
| 47 | - lf-infra-wrappers: |
Zack Williams | 1068edd | 2018-11-08 08:40:12 -0700 | [diff] [blame] | 48 | build-timeout: 40 |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 49 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 50 | |
| 51 | scm: |
| 52 | - cord-infra-gerrit-scm: |
| 53 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 54 | refspec: '$GERRIT_REFSPEC' |
| 55 | branch: '$GERRIT_BRANCH' |
| 56 | submodule-recursive: 'false' |
| 57 | choosing-strategy: 'gerrit' |
| 58 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 59 | basedir: '{basedir}' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 60 | |
| 61 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 62 | project-type: freestyle |
| 63 | concurrent: true |
| 64 | |
| 65 | builders: |
Zack Williams | 77e2d3c | 2018-11-14 09:58:31 -0700 | [diff] [blame] | 66 | # NOTE: this env var is only required to fix a bug in the "surefire" dependency: |
| 67 | # https://issues.apache.org/jira/browse/SUREFIRE-1588 |
| 68 | # https://github.com/apache/maven-surefire/pull/197 |
| 69 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925 |
| 70 | # should be removed as soon as this problem is resolved |
| 71 | - inject: |
| 72 | properties-content: | |
| 73 | _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true |
| 74 | |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 75 | - shell: | |
| 76 | #!/usr/bin/env bash |
| 77 | set -eux -o pipefail |
| 78 | |
| 79 | echo "Starting database for OSAM tests" |
| 80 | |
| 81 | # pull database |
| 82 | docker pull mariadb:10.3-bionic |
| 83 | |
| 84 | # run database |
| 85 | # Settings for the following commmand must match values given |
| 86 | # in: osam-core/model/src/main/resources/application.properties |
| 87 | |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 88 | docker run -d -p 3306:3306 --name springbootdb \ |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 89 | -e MYSQL_DATABASE=osam_core \ |
| 90 | -e MYSQL_USER=root \ |
| 91 | -e MYSQL_ROOT_PASSWORD=123456 \ |
| 92 | mariadb:10.3-bionic |
| 93 | |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 94 | # wait for mariadb to start up, print docker container status |
| 95 | sleep 15 |
| 96 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 97 | |
| 98 | - maven-target: |
| 99 | goals: "test" |
| 100 | pom: "pom.xml" |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 101 | |
| 102 | publishers: |
| 103 | - postbuildscript: |
| 104 | builders: |
| 105 | - build-on: |
| 106 | - SUCCESS |
| 107 | - UNSTABLE |
| 108 | - FAILURE |
| 109 | build-steps: |
| 110 | - shell: | |
| 111 | #!/usr/bin/env bash |
| 112 | set -eux -o pipefail |
| 113 | |
| 114 | echo "Stopping database" |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 115 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 116 | docker rm -f springbootdb |
| 117 | |