首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何利用Azure DevOps管道向AWS ECR/ECS发布角度应用程序

如何利用Azure DevOps管道向AWS ECR/ECS发布角度应用程序
EN

Stack Overflow用户
提问于 2022-11-01 12:10:35
回答 1查看 51关注 0票数 0

试图发布我的角度应用程序使用Azure DevOps管道到AWS。我是Azure管道的新手,下面是我已经写好的代码。我读过Azure管道上的文档,但很难找到必要的信息。有人能帮忙吗。

代码语言:javascript
复制
trigger:
- staging-release

resources:
- repo: self

variables:
  tag: '$(Build.BuildId)'
  AWS_REGION: eu-west-1                                       # set this to your preferred AWS region, e.g. us-west-1
  ECR_REPOSITORY: ********                      # set this to your Amazon ECR repository name
  ECS_SERVICE: ********                          # set this to your Amazon ECS service name
  ECS_CLUSTER: ********                                     # set this to your Amazon ECS cluster name
  ECS_TASK_DEFINITION: ********      # set this to the path to your Amazon ECS task definition
                                                            # file, e.g. .aws/task-definition.json
  CONTAINER_NAME: ********                       # set this to the name of the container in the
                                                            # containerDefinitions section of your task definition


stages:
- stage: Build
  displayName: Build image
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: ubuntu-latest
    steps:
    - task: Docker@2
      displayName: Build an image
      inputs:
        command: build
        dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
        tags: |
          $(tag)

    #Amazon Credentials
    - task: AWSCLI@1
      inputs: 
        awsCommand: 


    - script: |
        docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile.staging .
        docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
        echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"

我需要完成的步骤或任务:

  • 配置AWS凭据
  • 登录AWS Amazon
  • 生成标记并将停靠器图像推送到ECR
  • 在AWS ECS任务定义中填写新的图像ID
  • 部署Amazon任务定义
EN

回答 1

Stack Overflow用户

发布于 2022-11-02 09:36:42

在使用AWS用于Azure DevOps时,本文档:使用服务连接提供任务凭据可能帮助您设置与PAT的服务连接,以向任务提供凭据。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74275738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档