I am using python Project on gitlab. we configured Gitlab-CI for the project . We have settings.ini file which contains paswords and usernames so we dont commit that file to Repo. How can I pass the settings.ini file to gitlab runner to run unit test. when it’s a file loaded with configparser.
I would create a „template „ settings.ini in the project and just replace username and password with e.g. sed by variables you set in the project in a before_script step.
Can I be provided with any Example project I can Refer to
- add a file
[default] username=@@USERNAME@@ password=@@PASSWORD@@
- Add this to the repository.
- Add variables
THE_PASSWORDin your project.
sed -e 's/@@USERNAME@@/'$THE_USERNAME'/' -e 's/@@PASSWORD@@/'$THE_PASSWORD'/' settings.ini.template > settings.ini.
Thank you . I really appreciate your help
You are welcome. If this works for you, I think you may add that the issue is “resolved”.