Jenkins CI: Where and how are configuration files stored?

I am running configuration options from a Java application. I found that the best way to extend the class path and use .properties (leave only ZooKeeper for another requirement).

So my WAR file no longer has hosts / IPs / URLs, users / passwords.

DevOps distributes configurations manually through a test, old, stable installation.

Now is the time for Jenkins to run the tests. But they fail because there are no required .propeties files in the .propeties .

How to load these configuration files into Jenkins and how to make available in a test class?

maven-surefire-plugin allow extension of the classpath and passing system properties .

So the only question is how to get a separate directory on the Jenkins server and upload the files to this directory and create an alias / placeholder / envvar to specify the assembly to reference this path in the assembly configuration.

This task can be accomplished using SSH access, but I think this is the β€œwrong way”. I expect that this can be done through the Jenkins UI (any manager can upload a file to a web browser).

UPDATE I have no requirements for distributed slave / master assemblies, but it would be nice to have a solution that automatically transfers configuration files to slaves ...

So sshing for a host or ftp / scp is a bad thing.

+5
source share
2 answers

I read most of Jenkins docs, asked on the mailing list and IRC. Yes - the Jenkins community is silent. In the documents, I found a link to the File Provider Plugin , after which I will go to the page http://builder.evil.com/jenkins/pluginManager/available and find the config keyword.

There are many related plugins with varying utility for my object (most useless in the first place):

Only the last plugin - Config File Provider Plugin allows you to edit configurations through the Jenkins WEB interface. And he has a brother - a script-driven plugin - for loading / managing / editing user scripts. No question, now I'm using the File Provider Plugin !

+8
source

You must save the configuration necessary for the tests along with the rest of the source code so that your unit tests can work after compilation.

After deploying .war , the DevOps team should overwrite the built-in configurations with any configurations for each environment that they have.

-1
source

Source: https://habr.com/ru/post/1204169/


All Articles