1

I'm attempting to use bitbucket code pipelines to deploy to elastic beanstalk, using the eb cli.

Here's my bitbucket-pipelines.yml file, I've based it on the amazonlinux image, as this is what's running on the VM's in production.

image: amazonlinux

pipelines:
  branches:
    testing:
      - step:
          name: Build & Deploy
          script:
          - curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
          - yum -y install nodejs zip gcc-c++ make
          - curl -O https://bootstrap.pypa.io/get-pip.py
          - python get-pip.py
          - pip install awsebcli
          - npm install
          - export AWS_ACCESS_KEY_ID="$TEST_AWS_ACCESS_KEY_ID"
          - export AWS_DEFAULT_REGION="$TEST_AWS_DEFAULT_REGION"
          - export AWS_SECRET_ACCESS_KEY="$TEST_AWS_SECRET_ACCESS_KEY"
          - echo "deploying to $TEST_BEANSTALK_ENVIRONMENT_NAME"
          - eb --version
          - eb deploy $TEST_BEANSTALK_ENVIRONMENT_NAME

Installation seems to run fine, down to the eb --version line. However the eb deploy ... command return an incredibly useful error

ERROR: OSError ::

Does anyone have any suggestions as to what I could do differently to resolve this?

Edit - I get the same result running this from an ubuntu image too -

image: ubuntu:16.04

pipelines:
  branches:
    testing:
      - step:
          name: Build & Deploy
          script:
          - apt-get update && apt-get install -y software-properties-common
          - add-apt-repository universe
          - apt-get update && apt-get -y upgrade && apt-get install -y python-pip curl build-essential libssl-dev
          - curl -sL https://deb.nodesource.com/setup_8.x | bash
          - apt-get install nodejs
          - pip install awsebcli
          - node -v
          - npm -v
          - npm install
          - export AWS_ACCESS_KEY_ID="$TEST_AWS_ACCESS_KEY_ID"
          - export AWS_DEFAULT_REGION="$TEST_AWS_DEFAULT_REGION"
          - export AWS_SECRET_ACCESS_KEY="$TEST_AWS_SECRET_ACCESS_KEY"
          - echo "deploying to $TEST_BEANSTALK_ENVIRONMENT_NAME"
          - eb --version
          - eb deploy $TEST_BEANSTALK_ENVIRONMENT_NAME

Also gives me ERROR: OSError ::

RYFN
  • 141
  • 6
  • 1
    Was this recently? Bitbucket appears to be having some outages today – Slicedpan Jan 09 '18 at 15:32
  • They sure are! I tried this yesterday too, before the current issues. Don't think I'll be getting anywhere with it today... – RYFN Jan 09 '18 at 15:44

1 Answers1

0

Looks like I was missing git as a dependancy. The error message was well hidden in the --verbose output from the deploy command.

The following works -

image: ubuntu:16.04

pipelines:
  branches:
    testing:
      - step:
          name: Build & Deploy
          script:
          - apt-get update && apt-get -y upgrade && apt-get install -y python-dev python-pip curl build-essential git-all
          - curl -sL https://deb.nodesource.com/setup_8.x | bash
          - apt-get install nodejs
          - pip install awsebcli --ignore-installed setuptools --upgrade
          - node -v
          - npm -v
          - eb --version
          - npm install
          - export AWS_ACCESS_KEY_ID="$TEST_AWS_ACCESS_KEY_ID"
          - export AWS_DEFAULT_REGION="$TEST_AWS_DEFAULT_REGION"
          - export AWS_SECRET_ACCESS_KEY="$TEST_AWS_SECRET_ACCESS_KEY"
          - echo "deploying to $TEST_BEANSTALK_ENVIRONMENT_NAME"
          - eb deploy $TEST_BEANSTALK_ENVIRONMENT_NAME --verbose
RYFN
  • 141
  • 6