mirror of
https://github.com/corda/corda.git
synced 2025-04-09 04:15:35 +00:00
INFRA-826 Add publishing steps (#6780)
This commit is contained in:
parent
e7df5818e4
commit
d5790a6251
70
.ci/dev/open-j9/Jenkinsfile
vendored
70
.ci/dev/open-j9/Jenkinsfile
vendored
@ -1,39 +1,87 @@
|
||||
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
||||
@Library('existing-build-control')
|
||||
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
||||
#!groovy
|
||||
/**
|
||||
* Jenkins pipeline to build Corda OS release branches and tags.
|
||||
* PLEASE NOTE: we DO want to run a build for each commit!!!
|
||||
*/
|
||||
|
||||
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
||||
/**
|
||||
* Sense environment
|
||||
*/
|
||||
boolean isReleaseTag = (env.TAG_NAME =~ /^release-.*JDK11$/)
|
||||
boolean isInternalRelease = (env.TAG_NAME =~ /^internal-release-.*JDK11$/)
|
||||
boolean isReleaseCandidate = (env.TAG_NAME =~ /^release-.*(RC|HC).*JDK11$/)
|
||||
|
||||
/**
|
||||
* Common Gradle arguments for all Gradle executions
|
||||
*/
|
||||
String COMMON_GRADLE_PARAMS = [
|
||||
'--no-daemon',
|
||||
'--stacktrace',
|
||||
'--info',
|
||||
'-Pcompilation.warningsAsErrors=false',
|
||||
'-Ptests.failFast=true',
|
||||
].join(' ')
|
||||
|
||||
pipeline {
|
||||
agent { label 'open-j9 && os' }
|
||||
|
||||
/*
|
||||
* List options in alphabetical order
|
||||
*/
|
||||
options {
|
||||
timestamps()
|
||||
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
||||
timeout(time: 10, unit: 'HOURS')
|
||||
timestamps()
|
||||
}
|
||||
|
||||
/*
|
||||
* List environment variables in alphabetical order
|
||||
*/
|
||||
environment {
|
||||
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
||||
ARTIFACTORY_BUILD_NAME = "Corda OS OpenJ9 :: Publish :: Publish Release to Artifactory :: ${env.BRANCH_NAME}"
|
||||
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
||||
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
||||
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh "./gradlew clean --continue test --info"
|
||||
sh "./gradlew clean --continue test --info -Ptests.failFast=true"
|
||||
}
|
||||
}
|
||||
stage('Integration Tests') {
|
||||
steps {
|
||||
sh "./gradlew clean --continue integrationTest --info"
|
||||
sh "./gradlew clean --continue integrationTest --info -Ptests.failFast=true"
|
||||
}
|
||||
}
|
||||
stage('Smoke Tests') {
|
||||
steps {
|
||||
sh "./gradlew clean --continue smokeTest --info"
|
||||
sh "./gradlew clean --continue smokeTest --info -Ptests.failFast=true"
|
||||
}
|
||||
}
|
||||
stage('Slow Integration Tests') {
|
||||
steps {
|
||||
sh "./gradlew clean --continue slowIntegrationTest --info"
|
||||
sh "./gradlew clean --continue slowIntegrationTest --info -Ptests.failFast=true"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish Release to Docker Hub') {
|
||||
when {
|
||||
expression { isReleaseTag && !isInternalRelease && !isReleaseCandidate}
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'corda-publisher-docker-hub-credentials',
|
||||
usernameVariable: 'DOCKER_USERNAME',
|
||||
passwordVariable: 'DOCKER_PASSWORD')
|
||||
]) {
|
||||
sh script: [
|
||||
'./gradlew',
|
||||
COMMON_GRADLE_PARAMS,
|
||||
'docker:buildAndPushDockerhubImages'
|
||||
].join(' ')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,4 +94,4 @@ pipeline {
|
||||
deleteDir() /* clean up our workspace */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user