/*
 * pipeline script for Java builds
 * Copyright (c) 2019-2020 StrongBox Data Solutions, Inc.  ALL RIGHTS RESERVED
 *
 */

@Library('buildUtils@develop') _
// run the develop branch 2x daily
String cron_string = BRANCH_NAME == "develop" ? "H 0,6 * * *" : ""

pipeline {
    agent { label "${buildVars.AWS_AGENT}" }
    triggers { cron(cron_string) }
    options {
        ansiColor('xterm')
        timestamps()
    }

    stages {
        stage('Set Properties') {
            steps {
                buildInit channel: 'wfe-build'
            }
        }
        stage('Build Jar') {
            steps {
                mvnBuild(kotlin: true,
                pom: 'pom.xml')
            }
        }
        stage('Package') {
            steps {
                createArchive()
            }
        }
    }
    post {
        always {
            endBuild()
        }
    }

}
