How to tackle configuration file in Jenkins?

Multi tool use
How to tackle configuration file in Jenkins?
There are some configurations in my code (to connect DB). I wrote them in .env
. Users need to create their own .env
file to run the application. This is the copy code in Dockerfile:
COPY .env server
COPY .env test
.env
.env
COPY .env server
COPY .env test
When I use Jenkins to build a pipline, I have to commit this file, but I should not do that(aws information included there).
What is the best practice to save configuration file?
Thanks
@user3483203 thank you very much! I will check it out.
– MongoliaOba
Jul 1 at 3:17
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Why not let jenkins handle the credentials for you? Are you talking about credentials for your pipeline or for the application you are deploying?
– user3483203
Jun 30 at 19:30