Trying to use the shared library feature, unsuccessfully.

201 views
Skip to first unread message

dandeliondodgeball

unread,
Sep 28, 2017, 6:17:20 PM9/28/17
to Jenkins Users
ERROR: Library XYZ expected to contain at least one of src or vars directories
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed

I created a new repo, and a "src" directory. And added "Wipe out repo and force clone", thinking it wasn't seeing that latest from the repo.

dandeliondodgeball

unread,
Sep 29, 2017, 12:45:20 PM9/29/17
to Jenkins Users
Maybe I am not understanding shared libraries.  I have another repo, in which there are python scripts I need to call to be able to build the repo for which I have the pipeline created.  So I make pipeline A for repo B, but I need to call scripts in repo C to build.  It looked like shared libraries were the way for pipeline A to know about repo C.  Is there another/better way of doing that?  Thx

Joe Cavanaugh

unread,
Sep 29, 2017, 5:07:27 PM9/29/17
to Jenkins Users
I don't know if I fully understand your question... but here is something I did to solve getting scripts for execution in RepoA from repo's B,C,D... I now know the specific directories to execute the scripts from and the files that needed to be updated for Puppet. 

If you find a better way or this is not what you're looking for, please let me know. 
        stage('Pre-Build') {
            steps { 
                parallel (
                    R10K_Git: { dir("${env.WORKSPACE}\\${params.R10K_PROJECT}") {
                        git ([url: "${GIT_URL}/${params.R10K_PROJECT}.git", credentialsId:"creds"])
                    } },

                    Hieradata_Git: { dir("${env.WORKSPACE}\\${params.HIERADATA_PROJECT}") {
                        git ([url: "${GIT_URL}/${params.HIERADATA_PROJECT}.git", credentialsId:"creds"])
                    } },

                    Jenkins_Scripts_Git: { dir("${env.WORKSPACE}\\build\\scripts") {
                        git ([url: "${GIT_URL}/Jenkins_Scripts.git", credentialsId:"creds"])
                    } }
                )
            }
        }
Reply all
Reply to author
Forward
0 new messages