这是我的 GitLab 阶段和脚本:-
stages:
- lfs
lfs:
stage: lfs
image: python:3.9
script:
- echo "running lfs clean up"
- git --version
- python --version
- pip3 install --upgrade pip
- pip3 install git-lfs
根据作业日志,已安装 git-lfs,但当我尝试打印版本时,它说找不到命令。这是日志参考:-
$ git --version
git version 2.39.2
$ python --version
Python 3.9.18
$ pip3 install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (23.0.1)
Collecting pip
Downloading pip-23.2.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 24.0 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.0.1
Uninstalling pip-23.0.1:
Successfully uninstalled pip-23.0.1
Successfully installed pip-23.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
$ pip3 install git-lfs
Collecting git-lfs
Downloading git_lfs-1.6-py2.py3-none-any.whl (5.6 kB)
Installing collected packages: git-lfs
Successfully installed git-lfs-1.6
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
$ git-lfs --version
/usr/bin/bash: line 142: git-lfs: command not found
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1