```
vaultPipeline('ubuntu', 11, '3', {
- vaultStageBuild(['ubuntu', 'Windows'], [8, 11, 17], ['3', '3.6.3'], 'apache_jackrabbit-filevault-package-maven-plugin')
+ vaultStageBuild(['Windows'], [8, 17], ['3.6.3'], 'apache_jackrabbit-filevault-package-maven-plugin')
vaultStageDeploy()
}
)
The first argument is the main *node label* to build with, the second one the main *JDK version*, third argument the main *Maven version*
The fourth argument is a closure containing the actual stages where each may be one of
+1. `vaultStageSanityCheck`: a quick Maven build supposed to fail fast and executed before triggering expensive parallel builds with `vaultStageBuild`
1. `vaultStageBuild`: the actual Maven build and SonarQube execution (the latter only for the main environment)
1. `vaultStageIT`: an isolated execution of just the integration tests
1. `vaultStageDeploy`: the stage to deploy the previously built Maven artifacts to the ASF Snapshot Repository (depends on 1.)
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;
PipelineSupport(String mainNodeLabel, int mainJdkVersion, String mainMavenVersion, boolean isOnMainBranch) {
this.mainNodeLabel = mainNodeLabel
- this.mainJdkVersion = mainJdkVersion;
+ this.mainJdkVersion = mainJdkVersion
this.mainMavenVersion = mainMavenVersion
this.isOnMainBranch = isOnMainBranch
}
}
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)
}
}
return stepsMap
}
+
+ String getMainNodeLabel() {
+ return mainNodeLabel
+ }
}
\ No newline at end of file
} else {
pipelineSupport.executeMaven(this, "install:install-file -Dfile=${jarFiles[0].path} -DpomFile=pom.xml", false)
}
- String mavenOpts = '';
- // workaround for https://bugs.openjdk.java.net/browse/JDK-8057894
- if (!isUnix()) {
- mavenOpts = '-Djava.security.egd=file:/dev/urandom';
- }
// execute ITs
- pipelineSupport.executeMaven(this, jdkVersion, mavenVersion, 'failsafe:integration-test failsafe:verify', mavenOpts, false)
+ pipelineSupport.executeMaven(this, jdkVersion, mavenVersion, 'failsafe:integration-test failsafe:verify', false)
} finally {
junit '**/target/failsafe-reports*/**/*.xml'
}
--- /dev/null
+/**
+ * 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