--- a/Jenkinsfile Tue Dec 13 22:06:34 2016 +0000
+++ b/Jenkinsfile Tue Dec 13 22:48:25 2016 +0000
@@ -4,6 +4,15 @@
def pipeline;
+/*
+ * A helper function to return a branch to build.
+ *
+ * For normal jobs this is the value of 'Branch' field from SCM configuration.
+ * For multibranch jobs, this is the value of BRANCH_NAME environment variable.
+ *
+ * This is the same as build() function in `pipeline.groovy` and should be kept
+ * in sync. We cannot use the one there as we yet have to load it.
+ */
def branch() {
if (env.BRANCH_NAME == null) {
return scm.getBranch();
@@ -35,5 +44,14 @@
}
}
-pipeline.build()
-pipeline.test()
\ No newline at end of file
+/*
+ * If we're building a 'default' branch, run "integration" pipeline. Otherwise,
+ * run normal "build" pipeline, assuming this build is just a test build for
+ * some feature-in-progress. If different logic is needed, then make a branch
+ * and modify this file
+ */
+if ( branch().equals("default") ) {
+ pipeline.integration()
+} else {
+ pipeline.build()
+}