0

I have a Bitbucket Pipelines yaml that looks like this:

image: python: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

All working well, except DISTRO="$(lsb-release -s -c)" is failing. Cannot find the lsb-release executable, even though it's installed successfully in the script. I have tried find / -name lsb-release but that only yields the following:

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

...which is not very useful.

Where is the executable??

plesiv
  • 6,935
  • 3
  • 26
  • 34
serlingpa
  • 12,024
  • 24
  • 80
  • 130

1 Answers1

0

lsb-release is the name of the package, lsb_release is the name of binary within.

How did I find out this:

  1. Have docker installed on your host
  2. Fetch docker image and run container in which to test docker run -it --rm python:3.5.1 /bin/bash
  3. Install lsb-release with apt-get update && apt-get install -y lsb-release
  4. See files in package dpkg -L lsb-release (files in **/bin directories are executables)
plesiv
  • 6,935
  • 3
  • 26
  • 34
  • Ok, I've done 1 to 3 already, but I'm having real problems installing the package. Is there a straightforward, idiot-proof means of installing the lsb-release binary?? – serlingpa Oct 27 '16 at 09:42