mirror of
https://github.com/corda/corda.git
synced 2025-05-24 11:14:25 +00:00
INFRA-357 Publish build tag (#6375)
This commit is contained in:
parent
a7644dab8b
commit
e021022d0d
@ -1,121 +0,0 @@
|
|||||||
@Library('corda-shared-build-pipeline-steps')
|
|
||||||
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
||||||
|
|
||||||
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sense environment
|
|
||||||
*/
|
|
||||||
boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/)
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
dockerfile {
|
|
||||||
label 'k8s'
|
|
||||||
additionalBuildArgs "--build-arg USER=stresstester"
|
|
||||||
filename '.ci/dev/compatibility/DockerfileJDK11'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options {
|
|
||||||
timestamps()
|
|
||||||
buildDiscarder(logRotator(daysToKeepStr: '7', artifactDaysToKeepStr: '7'))
|
|
||||||
timeout(time: 3, unit: 'HOURS')
|
|
||||||
}
|
|
||||||
|
|
||||||
environment {
|
|
||||||
DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}JDK11"
|
|
||||||
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
|
||||||
BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}"
|
|
||||||
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
|
||||||
ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish JDK 11 Release to Artifactory".replaceAll("/", "::")
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Generate Build Image') {
|
|
||||||
steps {
|
|
||||||
withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) {
|
|
||||||
sh "./gradlew " +
|
|
||||||
"-Dkubenetize=true " +
|
|
||||||
"-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " +
|
|
||||||
"-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " +
|
|
||||||
"-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
|
||||||
"-Ddocker.buildbase.tag=11latest " +
|
|
||||||
"-Ddocker.dockerfile=DockerfileJDK11Azul" +
|
|
||||||
" clean pushBuildImage preAllocateForParallelRegressionTest preAllocateForAllParallelSlowIntegrationTest --stacktrace"
|
|
||||||
}
|
|
||||||
sh "kubectl auth can-i get pods"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Testing phase') {
|
|
||||||
parallel {
|
|
||||||
stage('Regression Test') {
|
|
||||||
steps {
|
|
||||||
sh "./gradlew " +
|
|
||||||
"-DbuildId=\"\${BUILD_ID}\" " +
|
|
||||||
"-Dkubenetize=true " +
|
|
||||||
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
|
||||||
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
|
||||||
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
||||||
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
" parallelRegressionTest --stacktrace"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Slow Integration Test') {
|
|
||||||
steps {
|
|
||||||
sh "./gradlew " +
|
|
||||||
"-DbuildId=\"\${BUILD_ID}\" " +
|
|
||||||
"-Dkubenetize=true " +
|
|
||||||
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
|
||||||
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
|
||||||
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
||||||
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
" allParallelSlowIntegrationTest --stacktrace"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish to Artifactory') {
|
|
||||||
when {
|
|
||||||
expression { isReleaseTag }
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
rtServer(
|
|
||||||
id: 'R3-Artifactory',
|
|
||||||
url: 'https://software.r3.com/artifactory',
|
|
||||||
credentialsId: 'artifactory-credentials'
|
|
||||||
)
|
|
||||||
rtGradleDeployer(
|
|
||||||
id: 'deployer',
|
|
||||||
serverId: 'R3-Artifactory',
|
|
||||||
repo: 'r3-corda-releases'
|
|
||||||
)
|
|
||||||
rtGradleRun(
|
|
||||||
usesPlugin: true,
|
|
||||||
useWrapper: true,
|
|
||||||
switches: '-s --info',
|
|
||||||
tasks: 'artifactoryPublish',
|
|
||||||
deployerId: 'deployer',
|
|
||||||
buildName: env.ARTIFACTORY_BUILD_NAME
|
|
||||||
)
|
|
||||||
rtPublishBuildInfo(
|
|
||||||
serverId: 'R3-Artifactory',
|
|
||||||
buildName: env.ARTIFACTORY_BUILD_NAME
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false
|
|
||||||
junit '**/build/test-results-xml/**/*.xml'
|
|
||||||
}
|
|
||||||
cleanup {
|
|
||||||
deleteDir() /* clean up our workspace */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
35
.ci/dev/regression/Jenkinsfile
vendored
35
.ci/dev/regression/Jenkinsfile
vendored
@ -17,7 +17,7 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|||||||
/**
|
/**
|
||||||
* Sense environment
|
* Sense environment
|
||||||
*/
|
*/
|
||||||
boolean isTag = (env.TAG_NAME =~ /^release-V(\d+\.\d+)?(\.\d+)?(-.+)?$/)
|
boolean isReleaseTag = (env.TAG_NAME =~ /^release-.*(?<!_JDK11)$/)
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'k8s' }
|
agent { label 'k8s' }
|
||||||
@ -32,6 +32,7 @@ pipeline {
|
|||||||
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
||||||
BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}"
|
BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}"
|
||||||
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
||||||
|
ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish Release to Artifactory".replaceAll("/", "::")
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@ -85,6 +86,36 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Publish to Artifactory') {
|
||||||
|
when {
|
||||||
|
expression { isReleaseTag }
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
rtServer(
|
||||||
|
id: 'R3-Artifactory',
|
||||||
|
url: 'https://software.r3.com/artifactory',
|
||||||
|
credentialsId: 'artifactory-credentials'
|
||||||
|
)
|
||||||
|
rtGradleDeployer(
|
||||||
|
id: 'deployer',
|
||||||
|
serverId: 'R3-Artifactory',
|
||||||
|
repo: 'r3-corda-releases'
|
||||||
|
)
|
||||||
|
rtGradleRun(
|
||||||
|
usesPlugin: true,
|
||||||
|
useWrapper: true,
|
||||||
|
switches: '-s --info',
|
||||||
|
tasks: 'artifactoryPublish',
|
||||||
|
deployerId: 'deployer',
|
||||||
|
buildName: env.ARTIFACTORY_BUILD_NAME
|
||||||
|
)
|
||||||
|
rtPublishBuildInfo(
|
||||||
|
serverId: 'R3-Artifactory',
|
||||||
|
buildName: env.ARTIFACTORY_BUILD_NAME
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -126,7 +157,7 @@ pipeline {
|
|||||||
|
|
||||||
script
|
script
|
||||||
{
|
{
|
||||||
if (!isTag) {
|
if (!isReleaseTag) {
|
||||||
// We want to send a summary email, but want to limit to once per day.
|
// We want to send a summary email, but want to limit to once per day.
|
||||||
// Comparing the dates of the previous and current builds achieves this,
|
// Comparing the dates of the previous and current builds achieves this,
|
||||||
// i.e. we will only send an email for the first build on a given day.
|
// i.e. we will only send an email for the first build on a given day.
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
FROM stefanotestingcr.azurecr.io/buildbase:11latest
|
|
||||||
COPY . /tmp/source
|
|
||||||
CMD cd /tmp/source && GRADLE_USER_HOME=/tmp/gradle ./gradlew clean testClasses integrationTestClasses --parallel --inf
|
|
Loading…
x
Reference in New Issue
Block a user