// Obtain files from source control system.
if (utils.scm_checkout()) return

// Allow modification of the job configuration, affects all relevant
// build configs.
// Pass this object in the argument list to the`run()` function below
// to apply these settings to the job's execution.
jobconfig = new JobConfig()
jobconfig.credentials = ['drizzlepac_codecov']
// jobconfig.post_test_summary = true

// Configure artifactory ingest
data_config = new DataConfig()
data_config.server_id = 'bytesalad'
data_config.root = 'tests_output'
data_config.match_prefix = '(.*)_result' // .json is appended automatically

bc = new BuildConfig()
bc.nodetype = 'linux'
bc.env_vars = ['TEST_BIGDATA=https://bytesalad.stsci.edu/artifactory']
bc.name = '3.6'
bc.conda_channels = ['http://ssb.stsci.edu/astroconda']
bc.conda_packages = ['python=3.6']
bc.build_cmds = ["pip install numpy astropy codecov pytest-cov",
		 "pip install --upgrade -e '.[test]'",
                 "pip freeze"]
bc.test_cmds = ["pytest --cov=./ --basetemp=tests_output --junitxml results.xml --bigdata",
                "codecov --token=${drizzlepac_codecov}"]
bc.test_configs = [data_config]

bc1 = utils.copy(bc)
bc1.name = '3.6-dev'
bc1.build_cmds[1] = "pip install -r requirements-dev.txt --upgrade -e '.[test]'"

// Iterate over configurations that define the (distributed) build matrix.
// Spawn a host (or workdir) for each combination and run in parallel.
// Also apply the job configuration defined in `jobconfig` above.
utils.run([bc, bc1, jobconfig])
