Skip to content

Commit

Permalink
BXMSPROD-1182 - Adding Jenkinsfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
bacciotti committed Jul 6, 2023
1 parent aad26f0 commit d71fd93
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@Library('jenkins-pipeline-shared-libraries')_

pipeline {
agent any
tools {
maven 'kie-maven-3.8.7'
jdk 'kie-jdk11'
nodejs 'nodejs-16.2.0'
}
stages {
stage('Clone, cherry-pick and push') {
steps {
script {
println "[INFO] Cloning..."
sh "git clone https://github.com/${params.PROJECT}.git"
dir("appformer"){
println "[INFO] Adding upstream..."
sh "git remote add upstream https://github.com/${params.PROJECT}.git"
println "[INFO] Fetching tags..."
sh "git fetch origin --tags"
println "[INFO] Checkout on given tag..."
sh "git checkout ${params.TAG}"
println "[INFO] Create new branch and checkout..."
sh "git checkout -b ${params.JIRA_ID}"
println "[INFO] Cherry-picking..."
}
}
}
}
stage('Running PME tool') {
steps {
script {
println "PME"
}
}
}
stage('Install & run build-chain tool') {
steps {
script {
println "[INFO] Installing build-chain tool"
sh "npm install -g @kie/build-chain-action${env.NPM_REGISTRY_URL ? " -registry=${NPM_REGISTRY_URL}" : ''}"
sh "npm list -g | grep build-chain"
println "[INFO] Running build-chain tool on project ${params.PROJECT} and tag ${params.TAG}"
sh "build-chain build branch --token=xxxxx -p ${params.PROJECT} -b main -f https://gist.githubusercontent.com/bacciotti/c86547846a6f6674a5fd6d84bb2e7f05/raw/47c9ebc1d8d9b45fc92ea07215e0c8cde96fb039/gistfile1.yaml"
}
}
}
stage('Distribute patch') {
steps {
script {
println "[INFO] Distributing patch..."
}
}
}
stage('Update Jira') {
steps {
script {
println "[INFO] Updating Jira..."
}
}
}
}
post {
always {
cleanWs()
}
}
}

0 comments on commit d71fd93

Please sign in to comment.