我有一个使用私有Git(在Github上)仓库的Python无服务器项目。
requirements.txt文件如下:
itsdangerous==0.24
boto3>=1.7
git+ssh://git@github.com/company/repo.git#egg=my_alias
该项目的配置主要如下所示
plugins:
- serverless-python-requirements
- serverless-wsgi
custom:
wsgi:
app: app.app
packRequirements: false
pythonRequirements:
dockerizePip: true
dockerSsh: true
当我使用这个命令部署时:
sls deploy --aws-profile my_id --stage dev --region eu-west-1
我遇到了这个错误:
Command "git clone -q ssh://git@github.com/company/repo.git /tmp/pip-install-a0_8bh5a/my_alias" failed with error code 128 in None
我做错了什么?我怀疑是我配置Github访问的SSH密钥方式或无服务器包的配置问题。
https://github.com/company/repo.git#egg=my_alias
替换要求url即可。dockerSsh: true
的作用,它将密钥从外部映射到容器内部。M-T-A
,你能否在你的部署命令中添加--verbose
标志,并分享相应的输出结果? - Tarun Lalwaniserverless-python-requirements
版本是什么? - Andrii Maletskyisls deploy
,还是通过某些构建系统运行?如果您在控制台中运行它,则可以使用 git+https 进行交互式身份验证。 - Andrii Maletskyi