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: |
| 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 Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 80 | docker run -d -p 3306:3306 --name springbootdb \ |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 81 | -e MYSQL_DATABASE=osam_core \ |
| 82 | -e MYSQL_USER=root \ |
| 83 | -e MYSQL_ROOT_PASSWORD=123456 \ |
| 84 | mariadb:10.3-bionic |
| 85 | |
Zack Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 86 | # wait for mariadb to start up, print docker container status |
| 87 | sleep 15 |
| 88 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 89 | |
| 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 Williams | a626144 | 2018-11-01 14:00:35 -0700 | [diff] [blame] | 112 | docker ps -a |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 113 | docker rm -f springbootdb |
| 114 | |