Krishna
Krishna

Reputation: 1209

Jenkins job build with parameters and SVN

I have a job in jenkins build with parameters. A simple batch script which compiles one java file and runs it by passing those parameters as arguments.

javac TestService.java
java TestService %environment% %service%

Now I need to search for a file in SVN Repo with file extension of %environment% and pass the location as an argument. Any solution?

Upvotes: 0

Views: 91

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328614

I think your best bet is to checkout the remote repo locally. Try to run svn checkout ... before you run the java command. To find the file name, either let the Java code search it or use the find command of your batch interpreter.

Other options: Make sure you can access the remote SVN server via HTTP. Then write code to scrape the HTML pages recursively to find the file names. You can do that in Java using HttpClient, for example. You will want to switch your build process from javac to Maven or Gradle for this, though.

Upvotes: 1

Related Questions