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 | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 16 | - 'osam-test': |
| 17 | dependency-jobs: 'verify_osam_licensed' |
| 18 | |
Zack Williams | b531e57 | 2018-10-23 09:03:33 -0700 | [diff] [blame] | 19 | # - '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 Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 25 | |
| 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 Williams | 1068edd | 2018-11-08 08:40:12 -0700 | [diff] [blame] | 49 | build-timeout: 40 |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 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}' |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 60 | basedir: '{basedir}' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 61 | |
| 62 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 63 | project-type: freestyle |
| 64 | concurrent: true |
| 65 | |
| 66 | builders: |
Zack Williams | 77e2d3c | 2018-11-14 09:58:31 -0700 | [diff] [blame^] | 67 | # 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 Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 76 | - 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 Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 89 | docker run -d -p 3306:3306 --name springbootdb \ |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 90 | -e MYSQL_DATABASE=osam_core \ |
| 91 | -e MYSQL_USER=root \ |
| 92 | -e MYSQL_ROOT_PASSWORD=123456 \ |
| 93 | mariadb:10.3-bionic |
| 94 | |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 95 | # wait for mariadb to start up, print docker container status |
| 96 | sleep 15 |
| 97 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 98 | |
| 99 | - maven-target: |
| 100 | goals: "test" |
| 101 | pom: "pom.xml" |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 102 | |
| 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 Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 116 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 117 | docker rm -f springbootdb |
| 118 | |