You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2022/07/05 07:38:41 UTC
[jackrabbit-filevault-jenkins-lib] branch master updated: add sanity check step (#3)
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault-jenkins-lib.git
The following commit(s) were added to refs/heads/master by this push:
new 116f1bb add sanity check step (#3)
116f1bb is described below
commit 116f1bb9bad5f192c18b1018c8c767033157c651
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Jul 5 09:38:37 2022 +0200
add sanity check step (#3)
enable fail-fast option for parallel builds
---
.../apache/jackrabbit/vault/PipelineSupport.groovy | 12 ++++---
vars/vaultStageBuild.groovy | 2 +-
vars/vaultStageSanityCheck.groovy | 38 ++++++++++++++++++++++
3 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/src/org/apache/jackrabbit/vault/PipelineSupport.groovy b/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
index cd31353..7af4102 100644
--- a/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
+++ b/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
@@ -34,7 +34,7 @@ class PipelineSupport implements Serializable {
if (INSTANCE == null) {
throw new IllegalStateException("createInstance has not been called before, not wrapped in vaultPipeline step?")
}
- return INSTANCE;
+ return INSTANCE
}
private final String mainNodeLabel;
@@ -44,7 +44,7 @@ class PipelineSupport implements Serializable {
PipelineSupport(String mainNodeLabel, int mainJdkVersion, String mainMavenVersion, boolean isOnMainBranch) {
this.mainNodeLabel = mainNodeLabel
- this.mainJdkVersion = mainJdkVersion;
+ this.mainJdkVersion = mainJdkVersion
this.mainMavenVersion = mainMavenVersion
this.isOnMainBranch = isOnMainBranch
}
@@ -73,13 +73,13 @@ class PipelineSupport implements Serializable {
}
def stepsFor(String stepsLabel, Set<String> nodeLabels, Set<Integer> jdkVersions, Set<String> mavenVersions, Closure closure, boolean excludeMain = false) {
- def stepsMap = [:]
+ def stepsMap = [failFast: true]
for (nodeLabel in nodeLabels) {
for (jdkVersion in jdkVersions) {
for (mavenVersion in mavenVersions) {
boolean isMainBuild = (nodeLabel.equals(mainNodeLabel) && jdkVersion.equals(mainJdkVersion) && mavenVersion.equals(mainMavenVersion))
if (excludeMain && isMainBuild) {
- continue; // skip main environment
+ continue // skip main environment
}
stepsMap["${stepsLabel} (JDK ${jdkVersion}, ${nodeLabel}, Maven ${mavenVersion}${isMainBuild ? ' (Main)' : ''})"] = closure(nodeLabel, jdkVersion, mavenVersion, isMainBuild)
}
@@ -87,4 +87,8 @@ class PipelineSupport implements Serializable {
}
return stepsMap
}
+
+ String getMainNodeLabel() {
+ return mainNodeLabel
+ }
}
\ No newline at end of file
diff --git a/vars/vaultStageBuild.groovy b/vars/vaultStageBuild.groovy
index a0f5667..d0f2d42 100644
--- a/vars/vaultStageBuild.groovy
+++ b/vars/vaultStageBuild.groovy
@@ -77,5 +77,5 @@ def call(List<String> additionalNodeLabels, List<Integer> additionalJdkVersions,
}
}
}
- } )
+ })
}
diff --git a/vars/vaultStageSanityCheck.groovy b/vars/vaultStageSanityCheck.groovy
new file mode 100644
index 0000000..e2cbb5c
--- /dev/null
+++ b/vars/vaultStageSanityCheck.groovy
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.jackrabbit.vault.PipelineSupport
+
+/**
+ * Quick sanity check before triggering expensive parallel builds with vaultStageBuild
+ */
+def call() {
+ PipelineSupport pipelineSupport = PipelineSupport.getInstance()
+ stage("Sanity Check") {
+ node(pipelineSupport.getMainNodeLabel()) {
+ timeout(30) {
+ echo "Running on node ${env.NODE_NAME}"
+ deleteDir()
+ checkout scm
+ String mavenArguments = 'clean compile'
+ pipelineSupport.executeMaven(this, mavenArguments, false)
+ }
+ }
+ }
+}
\ No newline at end of file