This article shows you how to inject credentials into a builder template.
1. Create a credential with the username/password option.
![create-credentials.png](../_images/Inject-credentials-in-a-builder-template/create-credentials.96d1ed4.png)
2. Create a builder template
New Item->Builder Template
Now, let’s create an attribute:
![attribute.png](../_images/Inject-credentials-in-a-builder-template/attribute.faa976e.png)
After this, I configured the transformer as following:
![transformer.png](../_images/Inject-credentials-in-a-builder-template/transformer.046f54b.png)
3. Create free style job using this build template
New Item->Freestyle project
Then, in the build section you need to add the build-template you have created as a build step.
![build-section.png](../_images/Inject-credentials-in-a-builder-template/build-section.22f6423.png)
4. Finally build and you should get an output like this one:
Started by user admin Building in workspace /Users/Felix/CloudBees/jenkins-test/1.580.2.1/jenkins\_home/jobs/builder-job/workspace \[workspace\] $ /bin/sh -e /var/folders/pb/jd1lfm8x2f91s0htlm2zvsmh0000gn/T/hudson8819317042280542346.sh credential: myusername2/mypassword2 Finished: SUCCESS
Groovy Script:
zeUserName = mycredential.username zePassword = mycredential.password
Shell Script:
echo "credential: $zeUserName/$zePassword"