No, there still isn't any common practice for this since this is not very common.
I would recommend you to create a Development Jenkins Environment and run tests against it. Right now you will have to do that from scratch since there are not many open source repositories that could help you.
So, how does this Jenkins Development Environment look like?
In order to pass masked credentials to your Jenkins job, do the following:
In Jenkins, install Credentials Binding plugin.
In your Jenkins, go to Credentials and click the global domain.
In the left pane, click "Add credential".
From the "Kind" dropdown, choose "Username with password".
Enter the username and password in the reflective boxes and choose an ...
You can use Jenkins DSL and pass the environment variable as mentioned in below links:
No, Jenkins file is not created at execution.
Actually Jenkins file is a suite of all steps or activity which you want to build as a job or a groovy code.
Jenkins file come from code repository, if you added file in your project.
Below is a Jenkins file example: