Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release Automation] Extend release pipeline creating zip files for source code as required by Apache #828

Closed
eduardocerqueira opened this issue Jan 16, 2024 · 6 comments
Assignees
Labels
apache:migration Related to Apache Migration

Comments

@eduardocerqueira
Copy link
Member

eduardocerqueira commented Jan 16, 2024

extend pipelines adding step to compress in a tarball/zip the source code as it is required for releasing in Apache.

PS: it is for all repos targeting the 10.0.0 release.

@eduardocerqueira eduardocerqueira converted this from a draft issue Jan 16, 2024
@eduardocerqueira eduardocerqueira added the apache:migration Related to Apache Migration label Jan 23, 2024
@cimbalek cimbalek moved this from 📋 Backlog to ⏳ In Progress in 🦉 KIE Podling Board Jan 31, 2024
@cimbalek
Copy link

@eduardocerqueira Do we want to produce zips per repository or is one huge zip preferred?

@porcelli porcelli moved this from ⏳ In Progress to 🅿️ Parking Lot in 🦉 KIE Podling Board May 9, 2024
@porcelli porcelli closed this as completed May 9, 2024
@github-project-automation github-project-automation bot moved this from 🅿️ Parking Lot to 🎯 Done in 🦉 KIE Podling Board May 9, 2024
@cimbalek cimbalek reopened this May 15, 2024
@porcelli
Copy link
Member

this is what I wrote for Jenkins, this should do the job:

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()
        }
    }
}

@porcelli
Copy link
Member

this is supposed to be a permanent automation to release in Apache

@porcelli porcelli moved this from 🎯 Done to 📋 Backlog in 🦉 KIE Podling Board May 22, 2024
@porcelli porcelli changed the title Extend release pipeline creating zip files for source code as required by Apache [Release Automation] Extend release pipeline creating zip files for source code as required by Apache May 22, 2024
@cimbalek
Copy link

cimbalek commented May 23, 2024

PR with Implementation is here: apache/incubator-kie-kogito-pipelines#1202 - please review
I decided to go with BASH script as it is better transferrable than a jenkins job and in case of need can be run locally. Also, I had it done when Alex posted the job code. I was just testing.

Job that builds it can be found here: https://ci-builds.apache.org/job/KIE/job/tools/job/zip-sources/
For now I agreed with Jan that separate job will be fine and we can include the script in pipelines later.

@baldimir
Copy link

@cimbalek I think what Alex did creates one big zip. In the zip script, it creates one zip per repository. Could you please update the script, that it just clones everything and does on big zip of the whole folder with all repositories?

@cimbalek
Copy link

cimbalek commented Jul 2, 2024

@cimbalek cimbalek closed this as completed Jul 2, 2024
@github-project-automation github-project-automation bot moved this from ⏳ In Progress to 🎯 Done in 🦉 KIE Podling Board Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apache:migration Related to Apache Migration
Projects
Status: 🎯 Done
Development

No branches or pull requests

4 participants