porcelli commented on issue #828:
URL:
https://github.com/apache/incubator-kie-issues/issues/828#issuecomment-2125948158
this is what I wrote for Jenkins, this should do the job:
```groovy
def repos = [
[name: 'kie-drools', url:
'https://github.com/apache/incubator-kie-drools.git'],
[name: 'kie-optaplanner', url:
'https://github.com/apache/incubator-kie-optaplanner.git'],
[name: 'kie-kogito-runtimes', url:
'https://github.com/apache/incubator-kie-kogito-runtimes.git'],
[name: 'kie-kogito-apps', url:
'https://github.com/apache/incubator-kie-kogito-apps.git'],
[name: 'kie-kogito-images', url:
'https://github.com/apache/incubator-kie-kogito-images.git'],
[name: 'kie-tools', url:
'https://github.com/apache/incubator-kie-tools.git'],
[name: 'kie-sandbox-quarkus-accelerator', url:
'https://github.com/apache/incubator-kie-sandbox-quarkus-accelerator.git']
]
pipeline {
agent any
parameters {
string(name: 'BRANCH_NAME', defaultValue: 'main', description:
'Branch name to use for all repositories')
string(name: 'VERSION_NUMBER', defaultValue: '1.0.0', description:
'Version number for the ZIP file')
}
environment {
ZIP_FILE_NAME = "apache-kie-${params.VERSION_NUMBER}.zip"
}
stages {
stage('Clone Repositories') {
steps {
script {
repos.each { repo ->
dir(repo.name) {
git branch: params.BRANCH_NAME, url: repo.url
}
}
}
}
}
stage('Remove .git Directories') {
steps {
script {
repos.each { repo ->
sh "rm -rf ${repo.name}/.git"
}
}
}
}
stage('Create ZIP File') {
steps {
script {
def repoNames = repos.collect { it.name }
sh "zip -r ${env.ZIP_FILE_NAME} ${repoNames.join(' ')}"
}
}
}
stage('Archive ZIP') {
steps {
archiveArtifacts artifacts: env.ZIP_FILE_NAME,
allowEmptyArchive: false
}
}
}
post {
always {
cleanWs()
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]