I am trying to implement Bitbucket CI/CD pipeline to deploy .net core application on AWS elastic beanstalk. The .net core application getting successfully published, but when I am trying to deploy on AWS elastic beanstalk it is giving following error.
✖ Deployment failed. Environment "{my-application-environment}" is running a different version "{version-number}".
Also on AWS elastic beanstalk I am getting the following error,
During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
Below is my bitbucket-pipelines.yml file
image: microsoft/dotnet:3.0-sdk
pipelines:
default:
- step:
script:
- echo "Hello Bitbucket !"
- step:
name: build publish prepare and zip
caches:
- dotnetcore
script:
- apt-get update && apt-get install --yes zip
- export PROJECT_NAME=$PROJECT_NAME
- dotnet restore $PROJECT_NAME
- dotnet build $PROJECT_NAME
- dotnet publish $PROJECT_NAME --self-contained --runtime win-x64 --configuration Debug
- zip -j site.zip /opt/atlassian/pipelines/agent/build/{my-project-name}/bin/Debug/netcoreapp3.0/win-x64/publish/* -x aws-windows-deployment-manifest.json
- zip -r -j application.zip site.zip /opt/atlassian/pipelines/agent/build/{my-project-name}/bin/Debug/netcoreapp3.0/win-x64/publish/aws-windows-deployment-manifest.json
artifacts:
- application.zip
- step:
name: upload to elasticbeanstalk
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.0
variables:
APPLICATION_NAME: $APPLICATION_NAME
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
#COMMAND: 'upload-only'
ZIP_FILE: 'application.zip'
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
WAIT: 'true'
VERSION_LABEL: 'deploy-WebApi-$BITBUCKET_BUILD_NUMBER'
The variables I have already configured in pipeline settings and pipeline is also enabled.
Is there something wrong with my .yml file?
Any help on this appreciated !