我有一个使用私有Git(在Github上)存储库的Python无服务器项目。
Requirements.txt文件如下所示:
itsdangerous==0.24
boto3>=1.7
git+ssh://[email protected]/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://[email protected]/company/repo.git /tmp/pip-install-a0_8bh5a/my_alias" failed with error code 128 in None
我究竟做错了什么?我怀疑我为Github访问配置SSH密钥的方式还是无服务器软件包的配置。
所以我设法解决这个问题的唯一方法是
serverless.yml
,我添加了以下内容: custom:
wsgi:
app: app.app
packRequirements: false
pythonRequirements:
dockerizePip: true
dockerSsh: true
dockerSshSymlink: ~/.ssh
注意,我添加dockerSshSymlink
了报告本地计算机上ssh文件的位置;~/.ssh
。
在中requirements.txt
,我添加了我的私有依赖项,如下所示:
git+ssh://[email protected]/my_comp/my_repo.git#egg=MyRepo
所有作品。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句