在我的bitbucket-pipelines.yml文件中,我有以下内容:
- step:
image: python:3.7.2-stretch
name: upload to s3
script:
- export S3_BUCKET="elasticbeanstalk-us-east-1-133233433288"
- export VERSION_LABEL=$(cat VERSION_LABEL)
- sudo apt-get install -y zip # required for packaging up the application
- pip install boto3==1.3.0 # required for upload_to_s3.py
- zip --exclude=*.git* -r /tmp/artifact.zip . # package up the application for deployment
- python upload_to_s3.py # run the deployment script但是当我在Bitbucket中运行这个管道时,我得到了一个错误,输出如下:
+ sudo apt-get install -y zip
bash: sudo: command not found为什么它不知道sudo是什么意思?这不是对所有Linux机器都很常见吗?
发布于 2019-03-27 14:19:19
如果在环境$PATH中配置的文件夹中找不到二进制文件,则会在stderr中输出"command not find“错误
首先,你需要找出它是否存在:
find /usr/bin -name "sudo"如果找到二进制文件,请尝试使用以下命令设置PATH变量:
export PATH=$PATH:/usr/bin/ 然后再次尝试运行sudo。
发布于 2019-03-27 14:21:44
不,并不是所有地方都可以使用sudo。
但不管怎样,你都不必为此而烦恼。在运行映像时,您是root用户,因此您可以简单地运行apt-get,而不必考虑权限。
https://stackoverflow.com/questions/55370796
复制相似问题