aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2019-04-15 10:18:59 -0400
committerMatt Rendina <mrendina@stsci.edu>2019-04-15 13:00:15 -0400
commit01957741c8bb74cec6e72c734ba0b8589efa1f72 (patch)
treefeff8f7acce78abace30aaf1a45f6dafbf716efb /Jenkinsfile
parentd9d2b53ce76d4654f70766acb846c1b3baf5588a (diff)
downloadjscu_refactor-01957741c8bb74cec6e72c734ba0b8589efa1f72.tar.gz
Add tests dir; try out inclusion into jenkinsfile
Cleanup jenkinsfile. Add hook instalation script Rename jenkinsfile.test Update hook to use renamed Jenkinsfile
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile62
1 files changed, 62 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..6ffbe14
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,62 @@
+@Library('utils@master') _
+
+//trivial edit
+// [skip ci] and [ci skip] have no effect here.
+if (utils.scm_checkout(['skip_disable':true])) 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.post_test_summary = true
+//jobconfig.credentials = ['SECRET_VALUE']
+//jobconfig.enable_env_publication = true
+//jobconfig.publish_env_on_success_only = false
+
+
+// Pytest wrapper
+def PYTEST_BASETEMP = "test_outputs"
+def PYTEST = "pytest \
+ -r s \
+ --basetemp=${PYTEST_BASETEMP} \
+ --junit-xml=results.xml"
+
+// Configure artifactory ingest
+data_config = new DataConfig()
+data_config.server_id = 'bytesalad'
+data_config.root = '${PYTEST_BASETEMP}'
+data_config.match_prefix = '(.*)_result' // .json is appended automatically
+
+
+bc0 = new BuildConfig()
+//bc0.nodetype = 'RHEL-6'
+bc0.nodetype = 'linux'
+bc0.name = 'First buildconfig'
+bc0.env_vars = ['VAR_ONE=1',
+ 'VAR_TWO=2']
+bc0.conda_ver = '4.6.4'
+bc0.conda_packages = ['python=3.6',
+ 'pytest=3.8.2']
+bc0.build_cmds = ["date",
+ "./access_env_var.sh",
+ "which python",
+ "conda install ipython"]
+bc0.test_cmds = ["${PYTEST} test_75pass.py"]
+bc0.test_configs = [data_config]
+
+
+bc1 = utils.copy(bc0)
+bc1.name = 'Second'
+bc1.env_vars = ['VAR_THREE=3',
+ 'VAR_FOUR=4']
+bc1.test_cmds[1] = "${PYTEST} test_25pass.py"
+
+
+bc2 = utils.copy(bc0)
+bc2.name = 'Third build config'
+bc2.conda_packages = []
+bc2.build_cmds = ["which python"]
+bc2.test_cmds = ["ls -al"]
+bc2.test_configs = []
+
+
+utils.run([bc0, bc1, bc2, jobconfig])