- scm:
   name: jtreg
   scm:
    - hg:
        url: http://hg.openjdk.java.net/code-tools/jtreg/
        clean: true
        browser: hgweb
        browser-url: http://hg.openjdk.java.net/code-tools/jtreg/
        subdir: jtreg
- job:
    name: jtreg-build
    project-type: freestyle
    defaults: global
    description: |
        * Build JDK Regression Test Harness (jtreg).
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            openjdk-members:
                - job-build
                - job-cancel
                - job-workspace
        - build-discarder:
            days-to-keep: 30
            num-to-keep:  10
            artifact-num-to-keep: 5
    disabled: true
    node: aarch64-06
    display-name: 'DELETE ME'
    scm:
        - jtreg
    triggers:
        - pollscm:
            cron: 'H/5 * * * *'
    wrappers:
        - timestamps
    builders:
        - shell: |
            #!/bin/bash

            set -eu

            cd jtreg

            JDKHOME=$(dirname $(java -XshowSettings:properties |& \
                 grep java.home |  sed 's,^.*java.home = \(.*\),\1,'))

            bash make/build-all.sh $JDKHOME

            : ${MAJOR:=4}
            : ${MINOR:=2}
            : ${MICRO:=0}
            : ${VERSION_SUFFIX:=SNAPSHOT}
            : ${JOB_NAME:=jtreg}
            : ${ZIP_TYPE:=xz}

            artifact=${JOB_NAME}-${MAJOR}.${MINOR}.${MICRO}-${VERSION_SUFFIX}

            cd ./build/images
            tar afcv $artifact.tar.${ZIP_TYPE} jtreg
            mv $artifact.tar.${ZIP_TYPE} ../../..
            cd ..
    publishers:
        - archive:
            artifacts: 'jtreg-build-*-SNAPSHOT.tar.xz'
        - email:
            recipients: 'stuart.monteith@linaro.org fathi.boudra@linaro.org'
