GitLab CI fails on forked repository
When a user requests a new set of images to be added to the library, they fork the repository.
The CI which is executed in merge requests in this forked repository can fail if the following CI/CD variables are not set: DOCKER_USERNAME
, DOCKER_PASSWORD
.
$ python3 skopeo-sync.py --src-username ${DOCKER_USERNAME} --src-password ${DOCKER_PASSWORD} --dest-username AWS --dest-password $(aws ecr get-login-password --region eu-west-1 --output text) --action sync --config library-dockerio.json # collapsed multi-line command
usage: skopeo-sync [-h] [--action {sync,list,scan}]
[--src-username SRC_USERNAME] [--src-password SRC_PASSWORD]
[--dest-username DEST_USERNAME]
[--dest-password DEST_PASSWORD] [--config CONFIG]
skopeo-sync: error: argument --src-username: expected one argument
Possible fix would be to check if the environment variable is set calling the skopeo-sync.py script.