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

add an svninfo step that can provide infos for a wc path #176

Open
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@tobiasbaum
Copy link

commented Jan 7, 2017

Hi,

I implemented an "svninfo" step that provides information like the current revision for a working copy path. If you want to, you can include it in the official release.

Background: We're currently porting our builds to pipeline and miss the SVN_REVISION environment variable. As a workaround, we first tried to shell out and use a native svn to get the info. That works, but the dependency on a native svn (possibly different from the one Jenkins uses) is a potential maintenance problem. I looked some time for another solution but then went ahead implementing it.

I added some more of the provided infos to the returned map. I selected ones I thought could be interesting, but the selection is nevertheless rather arbitrary. It should be easy to extend.

Best regards,
Tobias

@jglick
Copy link
Member

left a comment

Minor mistakes.

The broader question is whether a general solution to JENKINS-26100 is feasible and a better idea—if SubversionSCM normally sets these variables, then we would want checkout to return this.


}

public static final class Execution extends AbstractSynchronousNonBlockingStepExecution<Map<String, String>> {

This comment has been minimized.

Copy link
@jglick

jglick Jan 26, 2017

Member

Update dep and use SynchronousNonBlockingStepExecution. Also need not be public.

private static final long serialVersionUID = 1456116737119973646L;

@Override
public void checkRoles(final RoleChecker checker) throws SecurityException {

This comment has been minimized.

Copy link
@jglick

jglick Jan 26, 2017

Member

No. Use MasterToSlaveFileCallable.

tobiasbaum added some commits Jan 26, 2017

Update dependencies to be able to extend SynchronousNonBlockingStepEx…
…ecution

Also had to change from Java 6 to 7 in the process.
@tobiasbaum

This comment has been minimized.

Copy link
Author

commented Jan 26, 2017

Updating the dependencies does not seem to be that straightforward, at least some tests fail now (ExtensionListListener cannot be found and the test setup does not work anymore). Perhaps I'll have some time to look at it in more depth in the next days.

Solving JENKINS-26100 would definitely be nice. I used the current solution mainly because it seemed easier to me. Also having an svninfo step is more powerful than just returning the revision, so I think they don't exclude each other.

@jglick

This comment has been minimized.

Copy link
Member

commented May 16, 2017

I think this is superseded by #182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.