13
13
// The following property need to be set for the HTML report @TODO figure out how to get this nicely on jenkins
14
14
// System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
15
15
16
- /**
17
- * Release branches
18
- */
19
- def RELEASE_BRANCHES = [" master" ]
20
-
21
- /**
22
- * Branches to send notifcations for
23
- */
24
- def NOTIFY_BRANCHES = [" master" ]
25
-
26
-
27
16
/**
28
17
* The following flags are switches to control which stages of the pipeline to be run. This is helpful when
29
18
* testing a specific stage of the pipeline.
@@ -69,6 +58,22 @@ def SYSTEM_RESULTS = "${TEST_RESULTS_FOLDER}/system"
69
58
*/
70
59
def MASTER_BRANCH = " master"
71
60
61
+ /**
62
+ * The name of the dev branch
63
+ */
64
+ def DEV_BRANCH = " dev"
65
+
66
+ /**
67
+ * Release branches
68
+ */
69
+ def RELEASE_BRANCHES = [MASTER_BRANCH , DEV_BRANCH ]
70
+
71
+ /**
72
+ * Branches to send notifcations for
73
+ */
74
+ def NOTIFY_BRANCHES = [MASTER_BRANCH , DEV_BRANCH ]
75
+
76
+
72
77
/**
73
78
* Variables to check any new commit since the previous successful commit
74
79
*/
@@ -94,7 +99,7 @@ def opts = []
94
99
95
100
// Setup a schedule to run build periodically
96
101
// Run a build at 2.00AM everyday
97
- def CRON_STRING = BRANCH_NAME == MASTER_BRANCH ? " H 2 * * *" : " "
102
+ def CRON_STRING = RELEASE_BRANCHES . contains( BRANCH_NAME ) ? " H 2 * * *" : " "
98
103
99
104
if (RELEASE_BRANCHES . contains(BRANCH_NAME )) {
100
105
// Only keep 20 builds
@@ -547,7 +552,7 @@ pipeline {
547
552
return PIPELINE_CONTROL . deploy
548
553
}
549
554
expression {
550
- return BRANCH_NAME == MASTER_BRANCH
555
+ return RELEASE_BRANCHES . contains( BRANCH_NAME )
551
556
}
552
557
expression {
553
558
return GIT_COMMIT != GIT_PREVIOUS_SUCCESSFUL_COMMIT
@@ -601,7 +606,7 @@ pipeline {
601
606
return PIPELINE_CONTROL . deploy
602
607
}
603
608
expression {
604
- return BRANCH_NAME == MASTER_BRANCH
609
+ return RELEASE_BRANCHES . contains( BRANCH_NAME )
605
610
}
606
611
expression {
607
612
return GIT_COMMIT != GIT_PREVIOUS_SUCCESSFUL_COMMIT
@@ -622,6 +627,9 @@ pipeline {
622
627
623
628
script {
624
629
if (BRANCH_NAME == MASTER_BRANCH ) {
630
+ echo " publishing next to $TEST_NPM_REGISTRY "
631
+ sh " npm publish --tag alpha"
632
+ } else if (BRANCH_NAME == DEV_BRANCH ) {
625
633
echo " publishing next to $TEST_NPM_REGISTRY "
626
634
sh " npm publish --tag next"
627
635
} else {
0 commit comments