0

我有一个看起来像这样的 Bitbucket Pipelines yaml:

图片:蟒蛇:3.5.1

pipelines:
  branches:
    master:
      - step:
          script:
            - apt-get update
            - apt-get install lsb-release -y
            - curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
            - VERSION=node_5.x
            - DISTRO="$(lsb-release -s -c)"
            - echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list
            - echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list
            - apt-get update
            - apt-get install nodejs -y
            - npm install
            - npm run build
            - python get-pip.py
            - pip install boto3==1.3.0
            - python s3_upload.py io-master.fromthiscomesthat.co.uk dist io-master

一切正常,除了DISTRO="$(lsb-release -s -c)"失败。找不到lsb-release可执行文件,即使它已成功安装在脚本中。我已经尝试过find / -name lsb-release,但这只会产生以下结果:

+ find / -name lsb-release
/usr/share/doc/lsb-release
/usr/share/bug/lsb-release 

...这不是很有用。

可执行文件在哪里??

4

1 回答 1

0

lsb-release是包lsb_release的名称,是内部二进制的名称。

我是怎么发现的:

  1. 在您的主机上安装 docker
  2. 获取 docker 映像并运行要在其中进行测试的容器docker run -it --rm python:3.5.1 /bin/bash
  3. 安装lsb-release_apt-get update && apt-get install -y lsb-release
  4. 查看包中的dpkg -L lsb-release文件(**/bin目录中的文件是可执行文件)
于 2016-10-27T04:43:51.243 回答