mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
INFRA-2040: Merging forward updates from 4.5 to 4.6 (2023-04-16)
This commit is contained in:
commit
5e9dee18b1
@ -19,34 +19,6 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|||||||
*/
|
*/
|
||||||
boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/)
|
boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/)
|
||||||
|
|
||||||
/*
|
|
||||||
** calculate the stage for NexusIQ evaluation
|
|
||||||
** * build for snapshots
|
|
||||||
** * stage-release: for release candidates and for health checks
|
|
||||||
** * release: for GA release
|
|
||||||
*/
|
|
||||||
def nexusDefaultIqStage = "build"
|
|
||||||
if (isReleaseTag) {
|
|
||||||
switch (env.TAG_NAME) {
|
|
||||||
case ~/.*-RC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break;
|
|
||||||
case ~/.*-HC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break;
|
|
||||||
default: nexusDefaultIqStage = "release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* make sure calculated default value of NexusIQ stage is first in the list
|
|
||||||
* thus making it default for the `choice` parameter
|
|
||||||
*/
|
|
||||||
def nexusIqStageChoices = [nexusDefaultIqStage].plus(
|
|
||||||
[
|
|
||||||
'develop',
|
|
||||||
'build',
|
|
||||||
'stage-release',
|
|
||||||
'release',
|
|
||||||
'operate'
|
|
||||||
].minus([nexusDefaultIqStage]))
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common Gradle arguments for all Gradle executions
|
* Common Gradle arguments for all Gradle executions
|
||||||
*/
|
*/
|
||||||
@ -84,10 +56,6 @@ pipeline {
|
|||||||
timestamps()
|
timestamps()
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters {
|
|
||||||
choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage'
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List environment variables in alphabetical order
|
* List environment variables in alphabetical order
|
||||||
*/
|
*/
|
||||||
@ -118,27 +86,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Sonatype Check') {
|
|
||||||
steps {
|
|
||||||
dir(sameAgentFolder) {
|
|
||||||
script {
|
|
||||||
sh "./gradlew --no-daemon properties | grep -E '^(version|group):' >version-properties"
|
|
||||||
/* every build related to Corda X.Y (GA, RC, HC, patch or snapshot) uses the same NexusIQ application */
|
|
||||||
def version = sh(returnStdout: true, script: "grep ^version: version-properties | sed -e 's/^version: \\([0-9]\\+\\(\\.[0-9]\\+\\)\\+\\).*\$/\\1/'").trim()
|
|
||||||
def groupId = sh(returnStdout: true, script: "grep ^group: version-properties | sed -e 's/^group: //'").trim()
|
|
||||||
def artifactId = 'corda'
|
|
||||||
nexusAppId = "${groupId}-${artifactId}-${version}"
|
|
||||||
}
|
|
||||||
nexusPolicyEvaluation(
|
|
||||||
failBuildOnNetworkError: false,
|
|
||||||
iqApplication: selectedApplication(nexusAppId), // application *has* to exist before a build starts!
|
|
||||||
iqScanPatterns: [[scanPattern: 'node/capsule/build/libs/corda*.jar']],
|
|
||||||
iqStage: params.nexusIqStage
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('All Tests') {
|
stage('All Tests') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Another agent') {
|
stage('Another agent') {
|
||||||
|
@ -14,36 +14,6 @@ import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|||||||
|
|
||||||
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
||||||
|
|
||||||
/*
|
|
||||||
** calculate the stage for NexusIQ evaluation
|
|
||||||
** * build for snapshots
|
|
||||||
*/
|
|
||||||
def nexusDefaultIqStage = "build"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* make sure calculated default value of NexusIQ stage is first in the list
|
|
||||||
* thus making it default for the `choice` parameter
|
|
||||||
*/
|
|
||||||
def nexusIqStageChoices = [nexusDefaultIqStage].plus(
|
|
||||||
[
|
|
||||||
'develop',
|
|
||||||
'build',
|
|
||||||
'stage-release',
|
|
||||||
'release',
|
|
||||||
'operate'
|
|
||||||
].minus([nexusDefaultIqStage]))
|
|
||||||
/**
|
|
||||||
* define an empty teamsWebHookURL and if it is a Release Branch
|
|
||||||
* then set it for the Corda 4 Jenkins Connector
|
|
||||||
*/
|
|
||||||
boolean isReleaseBranch = (env.BRANCH_NAME =~ /^release\/os\/.*/)
|
|
||||||
def teamsWebHookURL = ""
|
|
||||||
if (isReleaseBranch){
|
|
||||||
withCredentials([string(credentialsId: 'ms-teams-webhook', variable: 'webhook_url')]) {
|
|
||||||
teamsWebHookURL = "$webhook_url"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'standard' }
|
agent { label 'standard' }
|
||||||
|
|
||||||
@ -53,22 +23,6 @@ pipeline {
|
|||||||
overrideIndexTriggers(false)
|
overrideIndexTriggers(false)
|
||||||
timeout(time: 3, unit: 'HOURS')
|
timeout(time: 3, unit: 'HOURS')
|
||||||
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
||||||
office365ConnectorWebhooks([[
|
|
||||||
name : "Corda 4 Jenkins Connector",
|
|
||||||
notifyBackToNormal : true,
|
|
||||||
startNotification : false,
|
|
||||||
notifyFailure : true,
|
|
||||||
notifySuccess : true,
|
|
||||||
notifyNotBuilt : false,
|
|
||||||
notifyAborted : false,
|
|
||||||
notifyRepeatedFailure: true,
|
|
||||||
notifyUnstable : true,
|
|
||||||
url : "${teamsWebHookURL}"
|
|
||||||
]])
|
|
||||||
}
|
|
||||||
|
|
||||||
parameters {
|
|
||||||
choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
triggers {
|
triggers {
|
||||||
@ -84,26 +38,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Sonatype Check') {
|
|
||||||
steps {
|
|
||||||
sh "./gradlew --no-daemon clean jar"
|
|
||||||
script {
|
|
||||||
sh "./gradlew --no-daemon properties | grep -E '^(version|group):' >version-properties"
|
|
||||||
/* every build related to Corda X.Y (GA, RC, HC, patch or snapshot) uses the same NexusIQ application */
|
|
||||||
def version = sh (returnStdout: true, script: "grep ^version: version-properties | sed -e 's/^version: \\([0-9]\\+\\(\\.[0-9]\\+\\)\\+\\).*\$/\\1/'").trim()
|
|
||||||
def groupId = sh (returnStdout: true, script: "grep ^group: version-properties | sed -e 's/^group: //'").trim()
|
|
||||||
def artifactId = 'corda'
|
|
||||||
nexusAppId = "${groupId}-${artifactId}-${version}"
|
|
||||||
}
|
|
||||||
nexusPolicyEvaluation (
|
|
||||||
failBuildOnNetworkError: false,
|
|
||||||
iqApplication: selectedApplication(nexusAppId), // application *has* to exist before a build starts!
|
|
||||||
iqScanPatterns: [[scanPattern: 'node/capsule/build/libs/corda*.jar']],
|
|
||||||
iqStage: params.nexusIqStage
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish to Artifactory') {
|
stage('Publish to Artifactory') {
|
||||||
steps {
|
steps {
|
||||||
rtServer (
|
rtServer (
|
||||||
|
Loading…
Reference in New Issue
Block a user