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

Exporting new SVN_REVISION_HIGHEST for projects with multiple svn modules #105

Closed
wants to merge 2 commits into from

Conversation

caspercba
Copy link

Objective: Be able to know whats the highest svn revision among all the svn modules contained in the project. The var name is SVN_REVISION_HIGHEST
Motivation: We need to name the final release files using the svn revision. The problem arises when the build was triggered by a change in one of the libraries. We had to find a way to list all the svn revisions for our project and choose the highest one.
Cons: If a project is located in different svn repositories, then there's no point in comparing their revisions. This wouldn't be an issue but the SVN_REVISION_HIGHEST wouldn't be used.

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@@ -677,6 +677,7 @@ public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
try {
Map<String,Long> revisions = parseSvnRevisionFile(build);
Set<String> knownURLs = revisions.keySet();
Long revHighest = new Long(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use long instead of Long

@oleg-nenashev
Copy link
Member

The improvement looks to be reasonable for me

@recena
Copy link
Contributor

recena commented Aug 29, 2015

@caspercba Hello. Could you provide an use case? When you have configured several modules (repos) you can get SVN_REVISION environment variable for each one.

@recena
Copy link
Contributor

recena commented Nov 11, 2015

@caspercba Are you still interested in this PR?

@caspercba
Copy link
Author

@recena Yes we can get the svn revision for each one, but we also have to loop through those and find the highest. Looping through svn variables with unknown length its not ideal. So it would be great if jenkins could provide the highest value in one variable.
I don't need this feature anymore since we don't use our own libraries in our current projects.

@recena
Copy link
Contributor

recena commented Nov 11, 2015

@caspercba I believe that this functionality is not responsibility of this plugin. if you agree, I'll close this PR. ok?

@jglick
Copy link
Member

jglick commented Jan 30, 2017

Duplicate of #72?

@caspercba
Copy link
Author

caspercba commented Nov 1, 2017

@recena Please close it. We have no need for this (anymore), and it doesnt seem to be very popular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants