I am currently working on a deployment script that will run as part of my GitLab CI setup. I want to copy a file from one place to another and rename it.
Now I want to find with what commit this file is generated, so I would like to add a commit hash to it.
For this, I would like to use something like this:
cp myLogFile.log /var/log/gitlab-runs/$COMMITHASH.log
The output should be a file with a name for example.
/var/log/gitlab-runs/9b43adf.log
How can this be achieved with GitLab CI?
source
share