Workspace does not exist in SCM checkout

34 views
Skip to first unread message

Francois Ferrand

unread,
Dec 22, 2015, 5:37:04 AM12/22/15
to Jenkins Developers
Hello,

I am trying to add Workflow support to the repo-plugin.
So far this is going well, but I have an issue with the workspace: when the checkout() method is called, the workspace directory does not actually exist, so the following workflow does not work:

node {
   checkout([$class: 'RepoScm', manifestRepositoryUrl:https://android.googlesource.com/platform/manifest])
}

If I add a simple shell step first (e.g. sh("echo")), things are working fine. The Git plugin seems to have no problem either.

I tried to lookup the API and the Git plugin, but could not find anything related to the workspace creation.
In case of Git plugin, it may actually work as a side effect of the call to "git init <workspace>".

I tried manually creating of the workspace directory if it does not exist, which works fine; but it seems somewhat weird to me, is this really the way to go?

Best regards,

-- 
Francois

Antonio Muñiz

unread,
Dec 22, 2015, 5:52:06 AM12/22/15
to jenkin...@googlegroups.com
Have you shared the code somewhere? It's difficult to know without taking a look to it.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/83ced67e-a0ed-405a-b25b-aa7aff75b83f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Antonio Muñiz
Software Engineer
CloudBees, Inc.

Jesse Glick

unread,
Dec 22, 2015, 10:08:12 AM12/22/15
to Jenkins Dev

If doing something with a `FilePath` that requires it to exist as a directory, call `mkdirs` first. Merely allocating a workspace does not force the directory to be created.

Message has been deleted

Francois Ferrand

unread,
Dec 31, 2015, 9:58:00 AM12/31/15
to Jenkins Developers
Code is on my fork of repo plugin: https://github.com/Typz/repo-plugin/tree/workflow-support

Ok, if mkdirs first is the way to go then everything is fine, this is already the solution I found.
Thanks,

-- 
Francois
Reply all
Reply to author
Forward
0 new messages