rht-labs / labs-ci-cd

👻UNMAINTAINED - A collection of Red Hat Open Innovation Labs CI/CD components
Apache License 2.0
101 stars 70 forks source link

Allow Jenkins to configure global shared library at startup #222

Closed mcanoy closed 6 years ago

mcanoy commented 6 years ago

This adds a feature to the Jenkins image that allows a global shared library to be installed whe deploying if desired. It allows all pipelines access to common methods like patchBuildConfigOutputLabels(). This feature is added through an init.groovy.d script and the deployment needs to provide env vars (defined in s2i-config/jenkins-master/README.md) which references the git repository containing the shared library. It supports public repos and private repos through an OCP secret.

Pipelines will NO longer have to import libraries with code like

            steps {
                library identifier: 'shared-library@master',
                    retriever: modernSCM([$class: 'GitSCMSource',
                    credentialsId: 'git-secret',
                    remote: 'git@mygit.com:labs/shared-jenkins-library.git',
                ])
            }
        }
sherl0cks commented 6 years ago

@mcanoy NICE!