import groovy.json.JsonOutput

AWS_REGION = "us-west-2"

def make(cmd) {
  sh "make ${cmd}"
}

pipeline {
    agent any
    options {
        disableConcurrentBuilds()
        timeout(time: 1, unit: 'HOURS')
        ansiColor('xterm')
        timestamps()
    }
    stages {
        stage('Build') {
            steps {
                make("compose_build")
            }
        }
        stage('Lint & Test') {
            steps {
                echo "Build environment"
                sh "env"
                echo "Running lint with `make lint`"
                make("lint")
                echo "Running tests with `make test`"
                make("test")
            }
        }
    }
}

