Skip to content

Commit

Permalink
Do not send any email
Browse files Browse the repository at this point in the history
  • Loading branch information
valenad1 committed Feb 13, 2025
1 parent a72295a commit 0c3a43a
Showing 1 changed file with 46 additions and 54 deletions.
100 changes: 46 additions & 54 deletions scripts/jenkins/jenkinsfiles/Jenkinsfile-Nightly
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,58 @@ def pipelineContext = null
def result = 'FAILURE'
def scmEnv = null

try {
ansiColor('xterm') {
timestamps {

boolean healthCheckPassed = false
int attempt = 0
stage('Checkout and Build') {
while (!healthCheckPassed) {
attempt += 1
if (attempt > HEALTH_CHECK_RETRIES) {
error "Too many attempts to pass initial health check"
}
String nodeLabel = DEFAULT_NODE_LABEL
if (pipelineContext != null) {
nodeLabel = DEFAULT_NODE_LABEL
ansiColor('xterm') {
timestamps {

boolean healthCheckPassed = false
int attempt = 0
stage('Checkout and Build') {
while (!healthCheckPassed) {
attempt += 1
if (attempt > HEALTH_CHECK_RETRIES) {
error "Too many attempts to pass initial health check"
}
String nodeLabel = DEFAULT_NODE_LABEL
if (pipelineContext != null) {
nodeLabel = DEFAULT_NODE_LABEL
}
echo "######### NodeLabel: ${nodeLabel} #########"
node(nodeLabel) {
dir('h2o-3') {
// clear the folder
deleteDir()
// checkout H2O-3
retryWithTimeout(180, 3) {
echo "###### Checkout H2O-3 ######"
scmEnv = checkout scm
}
echo "######### NodeLabel: ${nodeLabel} #########"
node(nodeLabel) {
dir('h2o-3') {
// clear the folder
deleteDir()
// checkout H2O-3
retryWithTimeout(180, 3) {
echo "###### Checkout H2O-3 ######"
scmEnv = checkout scm
}
}
}

if (pipelineContext == null) {
def initPipelineContext = load('h2o-3/scripts/jenkins/groovy/initPipelineContext.groovy')
pipelineContext = initPipelineContext(scmEnv, 'MODE_NIGHTLY', true)
// Execute nightly for master at 22:XX
// for rel- branches at 21:XX
String scheduleString = 'H 22 * * *'
if (env.BRANCH_NAME.startsWith('rel-')) {
scheduleString = 'H 21 * * *'
}
pipelineContext.getBuildConfig().setJobProperties(this, pipelineTriggers([cron(scheduleString)]))
// Load the defineTestStages script
defineTestStages = load('h2o-3/scripts/jenkins/groovy/defineTestStages.groovy')
}
healthCheckPassed = pipelineContext.getHealthChecker().checkHealth(this, env.NODE_NAME, pipelineContext.getBuildConfig().getDefaultImage(), pipelineContext.getBuildConfig().DOCKER_REGISTRY, pipelineContext.getBuildConfig())
if (healthCheckPassed) {
// Load build script and execute it
def buildH2O3 = load('h2o-3/scripts/jenkins/groovy/buildH2O3.groovy')
buildH2O3(pipelineContext)
}
if (pipelineContext == null) {
def initPipelineContext = load('h2o-3/scripts/jenkins/groovy/initPipelineContext.groovy')
pipelineContext = initPipelineContext(scmEnv, 'MODE_NIGHTLY', true)
// Execute nightly for master at 22:XX
// for rel- branches at 21:XX
String scheduleString = 'H 22 * * *'
if (env.BRANCH_NAME.startsWith('rel-')) {
scheduleString = 'H 21 * * *'
}
pipelineContext.getBuildConfig().setJobProperties(this, pipelineTriggers([cron(scheduleString)]))
// Load the defineTestStages script
defineTestStages = load('h2o-3/scripts/jenkins/groovy/defineTestStages.groovy')
}
healthCheckPassed = pipelineContext.getHealthChecker().checkHealth(this, env.NODE_NAME, pipelineContext.getBuildConfig().getDefaultImage(), pipelineContext.getBuildConfig().DOCKER_REGISTRY, pipelineContext.getBuildConfig())
if (healthCheckPassed) {
// Load build script and execute it
def buildH2O3 = load('h2o-3/scripts/jenkins/groovy/buildH2O3.groovy')
buildH2O3(pipelineContext)
}
}

defineTestStages(pipelineContext)
result = 'SUCCESS'
}
}
} finally {
if (pipelineContext != null) {
pipelineContext.getEmailer().sendEmail(this, result, pipelineContext.getBuildSummary().getSummaryHTML(this))
if (!pipelineContext.getHealthChecker().getHealthProblems().isEmpty()) {
pipelineContext.getEmailer().sendEmail(this, 'WARNING', pipelineContext.getHealthChecker().toEmail(this, pipelineContext), ['[email protected]'])
}
}

defineTestStages(pipelineContext)
result = 'SUCCESS'
}
}

0 comments on commit 0c3a43a

Please sign in to comment.