- job:
    name: jdk8-build-and-test
    project-type: multijob
    defaults: global
    description: |
        * This jobs builds the jdk images and runs tests and benchmarks against the built images.<br>
        * <b>Note:</b> this job is usually triggered by a source change (ie. the "jdk8-update-src-tree" job).<br>
        If it is run manually it will use the source tarball from the last successful build of that job.<br>
        * If this jobs runs to completion the results are published to http://openjdk.linaro.org/.
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            openjdk-members:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 10
            artifact-num-to-keep: 5
    parameters:
        - string:
            name: YEAR
            default: 'default'
        - string:
            name: DAY_OF_YEAR
            default: 'default'
    disabled: true
    node: master
    display-name: 'DELETE ME'
    wrappers:
        - workspace-cleanup:
            dirmatch: false
        - timestamps
    builders:
        - multijob:
            name: 'OpenJDK Clean job'
            condition: SUCCESSFUL
            projects:
                - name: jdk-clean-job
                  current-parameters: true
                  kill-phase-on: NEVER
        - multijob:
            name: 'Build j2sdk images'
            condition: SUCCESSFUL
            projects:
              - name: jdk8-build-image
                current-parameters: true
                kill-phase-on: FAILURE
        # Get depenencies for subsequent jobs.
        - multijob:
            name: 'Get Deps'
            condition: ALWAYS
            projects:
              - name: jdk8-get-deps
                current-parameters: true
                kill-phase-on: FAILURE
# FIXME - set SPECjbb2015 benchmark continuation condition from SUCCESSFUL to ALWAYS
# Exception in thread "main" java.util.ServiceConfigurationError:
# org.spec.jbb.core.comm.connectivity.ConnectivityProvider:
# Provider org.spec.jbb.core.comm.connectivity.GrizzlyNioProvider could not be instantiated
# Caused by: java.lang.IllegalStateException: java.lang.RuntimeException: java.lang.NullPointerException
        - multijob:
            name: 'SPECjbb2015 benchmark'
            condition: SUCCESSFUL
            projects:
              - name: jdk8-specjbb2015-benchmark
                current-parameters: true
                kill-phase-on: FAILURE
        - multijob:
            name: '1GB Terasort benchmark'
            condition: SUCCESSFUL
            projects:
              - name: jdk8-terasort-benchmark
                current-parameters: true
                kill-phase-on: NEVER
        - multijob:
            name: 'JTREG tests'
            condition: SUCCESSFUL
            projects:
              - name: jdk8-jtreg-test
                current-parameters: true
                predefined-parameters: 'XJTREG_SUBCATEGORIES=tools/javap/typeAnnotations'
                kill-phase-on: NEVER
        - multijob:
            name: 'jcstress'
            condition: COMPLETED
            projects:
              - name: jdk8-jcstress-test
                current-parameters: true
                kill-phase-on: FAILURE
        - multijob:
            name: 'Publish results to openjdk.linaro.org'
            condition: SUCCESSFUL
            projects:
              - name: jdk8-publish-and-report
                current-parameters: true
                kill-phase-on: FAILURE
        - copyartifact:
            project: jdk8-update-src-tree
            filter: 'out/*'
            target: out
            flatten: true
        - copyartifact:
            project: jdk8-build-image
            filter: 'out/**/*'
            target: out
            flatten: true
        - copyartifact:
            project: jdk8-specjbb2015-benchmark
            filter: 'out/**/*'
            target: out
            flatten: true
        - copyartifact:
            project: jdk8-terasort-benchmark
            filter: 'out/**/*'
            target: out
            flatten: true
        - copyartifact:
            project: jdk8-jtreg-test
            filter: 'out/**/*'
            target: out
            flatten: true
            stable: true
        - copyartifact:
            project: jdk8-jcstress-test
            filter: 'out/**/*'
            target: out
            flatten: true
    publishers:
        - archive:
            artifacts: 'out/**/*'
