Quite new to GitLab CI/CD. I’m using self-hosted GL.
I’ve got a Python script that extracts data from a text file (hosts) and generates a second text file (config).
I would need to copy the second file into a remote GL repository.
This is what I’ve done so far in my gitlab-ci.yml file:
stages:
- build
- copy
build-job:
stage: build
only:
- main
script:
- python3 --version
- python3 inventory2ssh.py
- cat config
copy-job:
stage: copy
only:
- main
script:
- cat config
- git clone "https://user:$PROJECT_TOKEN@remote_repo_url" ssh-config
- cp config ssh-config/ssh/
- cd ssh-config/ssh
- git config user.name "my_user"
- git config user.email "my_email"
- git add config
- git commit -m "Adding config file"
- git push origin master
The problem is that only the first job succeeds, the second one throws this error:
fatal: pathspec 'config' did not match any files