AWS CLI Tools for Circle CI: configure: unknown command

I am trying to deploy a docker application on Elastic Beanstalk from Circle CI.

Deployment section of my circle.yml

deployment: hub: branch: [internal, production] commands: - pip install awscli - docker push company/web:$CIRCLE_SHA1 - sudo bash deploy.sh $CIRCLE_SHA1 $CIRCLE_BRANCH $CIRCLE_BUILD_NUM 

and my deploy.sh aws cli calls follow

 aws --version aws configure set aws_access_key_id $AWSKEY aws configure set aws_secret_access_key $AWSSECRETKEY aws configure set default.region us-west-2 aws configure set default.output json echo "SAVING NEW DOCKERRUNFILE: $DOCKERRUN_FILE" aws s3 cp $DOCKERRUN_FILE s3://$EB_BUCKET/$DOCKERRUN_FILE 

But I get an error

- version: wrong meta parameter?

Health check: "/root/.awssecret": file is missing. (Format: AccessKeyID \ nSecretAccessKey \ n)

configure: unknown command Usage: aws ACTION [--help]

The script works fine locally on mac os, using the same key and secret.

Both versions (in a circle and my mac) awscli - 1.7.14

+6
source share
1 answer

I'm Kevin from CircleCI. It seems like the problem here is that when installing Python dependencies CircleCI installs them in virtualenv. This is usually great as it isolates your python environment from the default Python system and supports dependency caching. The problem is that you run deploy.sh script with sudo, which grabs the virtualenv environment and runs the default system version (which in this case is actually an older alternative AWS CLI). Throwing sudo should fix things for you. (You would also be better off running pip install awscli==xxx in the "dependencies" phase, as it would be cached then.)

PS: Please contact sayhi@circleci.com for a timely response to questions in general.

+7
source

Source: https://habr.com/ru/post/983941/


All Articles