Amazon web services Bitbucket CI/CD管道-使用Elastic Beanstalk部署到AWS

Amazon web services Bitbucket CI/CD管道-使用Elastic Beanstalk部署到AWS,amazon-web-services,asp.net-core,bitbucket,amazon-elastic-beanstalk,bitbucket-pipelines,Amazon Web Services,Asp.net Core,Bitbucket,Amazon Elastic Beanstalk,Bitbucket Pipelines,我正在尝试使用bitbucker CI/CD管道在aws elastic beanstalk上部署web api。下面是相同的配置 image: microsoft/dotnet:sdk pipelines: default: - step: caches: - dotnetcore deployment: myapi-test1 script: # Modify the comma`nds below to bu

我正在尝试使用bitbucker CI/CD管道在aws elastic beanstalk上部署web api。下面是相同的配置

image: microsoft/dotnet:sdk

pipelines:
  default:
    - step:
        caches:
          - dotnetcore
        deployment: myapi-test1
        script: # Modify the comma`nds below to build your repository.
          - pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.4
            variables:
              AWS_ACCESS_KEY_ID: '<access_key>'
              AWS_SECRET_ACCESS_KEY: '<secret_key>'
              AWS_DEFAULT_REGION: 'us-east-1'
              APPLICATION_NAME: 'myapi'
              ENVIRONMENT_NAME: 'test'
              ZIP_FILE: 'https://applicationxyz.s3.amazonaws.com/applicationxyz.zip'
              S3_BUCKET: 'myapplication' # Optional.
              # VERSION_LABEL: '<string>' # Optional.
              # DESCRIPTION: '<string>' # Optional.
              # WAIT: '<boolean>' # Optional.
              # WAIT_INTERVAL: '<integer>' # Optional.
              # COMMAND: '<string>' # Optional.
              # DEBUG: '<boolean>' # Optional.

ZIP_FILE参数用于指定源代码的本地存档。您不应该在S3中传递对象的URL。以下是一个示例(更多示例可从以下网站获得:


您需要在第一步中定义工件并将其传递到下一步

image: atlassian/default-image:2

pipelines:
  default:
    - step:
        name: "Build and Test"
        script:
          - echo "Everything is awesome!"
          - apt-get update
          - apt-get install -y zip
          - zip -j application.zip MyApplication.WebAPI/*
          - pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.3
            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: 'upload-only'
              ZIP_FILE: 'application.zip'
              S3_BUCKET: 'bitbucketcicd'
              VERSION_LABEL: 'deployApi-$BITBUCKET_BUILD_NUMBER-multiple'
 # Define an artifact to pass the zip file to the next step
        artifacts: 
          - application.zip

感谢您的回复。我已经更新了编辑1下的bitbucket-pipelines.yml配置,现在至少elastic beanstalk正在尝试部署该应用程序。但是,S3 bucket中没有发布文件和DLL,导致应用程序失败。那么,您知道如何获得这些信息吗?那么,您的管道什么时候会完全失败?它会失败吗当您调用“仅上载”或“仅部署”时,它不会给出任何错误,但当我检查S3存储桶中的发布代码文件时,这些文件不可用。在此之后,当我运行应用程序时,它会给出错误,因为找不到发布…对此有何建议?
  - pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.4
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      AWS_DEFAULT_REGION: 'us-east-1'
      APPLICATION_NAME: 'my-app-name'
      ENVIRONMENT_NAME: 'production'
      ZIP_FILE: 'application.zip'
image: atlassian/default-image:2

pipelines:
  default:
    - step:
        name: "Build and Test"
        script:
          - echo "Everything is awesome!"
          - apt-get update
          - apt-get install -y zip
          - zip -j application.zip MyApplication.WebAPI/*
          - pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.3
            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: 'upload-only'
              ZIP_FILE: 'application.zip'
              S3_BUCKET: 'bitbucketcicd'
              VERSION_LABEL: 'deployApi-$BITBUCKET_BUILD_NUMBER-multiple'
 # Define an artifact to pass the zip file to the next step
        artifacts: 
          - application.zip