I got a pipeline up and working. My supervisor gave me access to a VM, on which I installed gitlab-runner and all needed dependencies (I'm using the shell mode).
The build task runs without problems, but I also want to create some tests. The Problem is, that the program input are files, which contents are secret and therefore are not included in the repository.
I stored the files on the VM (e.g. in /path/to/file.txt
). But when I pass the (absolute) path to the file in the test job, in the script section:
variables:
FILE: "/path/to/file.txt"
...
test-job:
stage: test
script:
- ./build/my_program $FILE
then I get the (it's a c++ program) (test-job)pipeline error output:
terminate called after throwing an instance of 'std::runtime_error'
what(): ERROR: File /path/to/file.txt not found
bash: line 145: 52372 Aborted ./build/my_program $FILE
How can I pass local files, which are stored on the machine and not in the repository to a job? Or is there even a best practice on passing local/ secret files to a test?