Bitbucket CICD Pipeline with aws elastic beanstalk.

问题描述 投票:1回答:1

我正试图用Bitbucket CICD管道在AWS elastic beanstalk上部署.net core应用程序。.net core应用程序成功发布,但当我试图在AWS elastic beanstalk上部署时,它给出了以下错误。

✖部署失败。环境"{my-application-environment}"正在运行一个不同的版本"{version-number}"。

此外,在 AWS elastic beanstalk 上,我还得到了以下错误。

在中止部署期间,一些实例可能已经部署了新的应用程序版本。为了确保所有实例都在运行相同的版本,请重新部署相应的应用版本。

以下是我的bitbucket-pipelines.yml文件。

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'

变量我已经在管道设置中配置好了,管道也启用了。

是不是我的.yml文件有什么问题?

任何帮助,感激不尽

amazon-web-services asp.net-core bitbucket amazon-elastic-beanstalk bitbucket-pipelines
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.