问题
I'm trying to deploy django
project to elasticbeanstalk using bitbucket pipelines.
Here's my config
image: python:3.7.2
pipelines:
branches:
master:
- step:
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $APPLICATION_NAME
COMMAND: $COMMAND
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
VERSION_LABEL: ${ENVIRONMENT_NAME}_${BITBUCKET_COMMIT:0:8}_(YYYY-mm-dd_HHMMSS)
WAIT: 'true'
- pip3 install -r requirements.txt
- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py collectstatic
I get the following error :
An error occurred (InvalidParameterValue) when calling the UpdateEnvironment operation: No Application Version named 'production_d095cbe2_YYYY-mm-dd_HHMMSS)' found.
I'm just wondering, shouldn't it have year and time frame instead of the YYYY-mm-dd_HHMMSS
?
回答1:
Well, if you want the date and time you can invoke the date function of the underlaying linux container:
date +"%Y-%m-d_%H%M%S" # displays 2019-03-26_223932
So your bitbucket-piplines.yml
should do what you expect written this way:
image: python:3.7.2
pipelines:
branches:
master:
- step:
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $APPLICATION_NAME
COMMAND: $COMMAND
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
VERSION_LABEL: ${ENVIRONMENT_NAME}_${BITBUCKET_COMMIT:0:8}_$(date +"%Y-%m-d_%H%M%S")
WAIT: 'true'
- pip3 install -r requirements.txt
- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py collectstatic
来源:https://stackoverflow.com/questions/55313188/bitbucket-pipelines-no-application-version-named-found