试图发布我的角度应用程序使用Azure DevOps管道到AWS。我是Azure管道的新手,下面是我已经写好的代码。我读过Azure管道上的文档,但很难找到必要的信息。有人能帮忙吗。
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"我需要完成的步骤或任务:
发布于 2022-11-02 09:36:42
在使用AWS用于Azure DevOps时,本文档:使用服务连接提供任务凭据可能帮助您设置与PAT的服务连接,以向任务提供凭据。
https://stackoverflow.com/questions/74275738
复制相似问题