-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
271 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import org.jenkinsci.plugins.workflow.libs.Library | ||
@Library('jenkins-pipeline-shared-libraries')_ | ||
|
||
import org.kie.jenkins.MavenCommand | ||
|
||
pipeline { | ||
agent { | ||
label 'kie-rhel7' | ||
} | ||
|
||
tools { | ||
maven 'kie-maven-3.6.3' | ||
jdk 'kie-jdk11' | ||
} | ||
|
||
options { | ||
timestamps() | ||
timeout(time: 60, unit: 'MINUTES') | ||
} | ||
|
||
// parameters { | ||
// For parameters, check into ./dsl/jobs.groovy file | ||
// } | ||
|
||
environment { | ||
// Static env is defined into ./dsl/jobs.groovy file | ||
|
||
// Keep here for visitibility | ||
MAVEN_OPTS = '-Xms1024m -Xmx4g' | ||
|
||
// TODO move to env var of job dsl | ||
PIPELINES_REPO_NAME = 'kogito-pipelines' | ||
PIPELINES_AUTHOR = 'radtriste' | ||
PIPELINES_BRANCH = 'split_nightly_jobs' | ||
PIPELINES_COMMON_SCRIPT_PATH = '.ci/jenkins/scripts/helper.groovy' | ||
} | ||
|
||
stages { | ||
stage('Initialize') { | ||
steps { | ||
script { | ||
assert env.UPDATE_VERSION_SCRIPT_PATH | ||
|
||
cleanWs() | ||
|
||
checkout scm | ||
pipelinesCommon = load "${WORKSPACE}/${PIPELINES_COMMON_SCRIPT_PATH}" | ||
pipelinesCommon.init() | ||
|
||
if (env.PIPELINE_CHECKS_SCRIPT_PATH) { | ||
pipelinesCommon.loadAndExecuteScript(env.PIPELINE_CHECKS_SCRIPT_PATH) | ||
} | ||
|
||
pipelinesCommon.checkoutRepo() | ||
} | ||
} | ||
} | ||
stage('Prepare for PR') { | ||
when { | ||
expression { return pipelinesCommon.isCreatePr() } | ||
} | ||
steps { | ||
script { | ||
pipelinesCommon.prepareForPR() | ||
} | ||
} | ||
} | ||
stage('Update version') { | ||
steps { | ||
script { | ||
pipelinesCommon.loadAndExecuteScript(env.UPDATE_VERSION_SCRIPT_PATH) | ||
} | ||
} | ||
} | ||
stage('Create PR') { | ||
when { | ||
expression { return pipelinesCommon.isCreatePR() } | ||
} | ||
steps { | ||
script { | ||
msg = pipelinesCommon.getCommitMessageForVersionUpdate() | ||
pipelinesCommon.commitChanges(msg) | ||
pipelinesCommon.createPRForVersionUpdate(msg) | ||
} | ||
} | ||
} | ||
stage('Merge PR') { | ||
when { | ||
expression { return pipelinesCommon.isPRMergedAutomatically() } | ||
} | ||
steps { | ||
script { | ||
pipelinesCommon.checkoutRepo() | ||
pipelinesCommon.mergeAndPushPR() | ||
} | ||
} | ||
} | ||
stage('Tag repository') { | ||
when { | ||
expression { return pipelinesCommon.getGitTag() } | ||
} | ||
steps { | ||
script { | ||
pipelinesCommon.tagRepository() | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
script { | ||
pipelinesCommon.archivePipelineProperties() | ||
} | ||
} | ||
cleanup { | ||
script { | ||
util.cleanNode('docker') | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters