I'm running Jenkins in a Docker and I want to clone a BitBucket repository in a temporary fashion, execute the script and wipe the clone out.
If I try to clone right now I'm having error of the private key obviously because it's not installed in the Docker. So I would like to use the Jenkins credentials to clone and wipeout. My scenario is something like this:
git somehowlogin with jenkinscredentials SSHprivatekeys
git clone ssh://git@stash.group.net/~myid/myrepo.git
git checkout echo ${env.BRANCH_NAME}
Execute some scripts within the repo
git somehow clean all temp files
Can you help me with this?
