我使用aws函数(Hello_world)模板创建了一个项目。我可以使用sam命令构建、调用本地并从本地部署。代码在Azure回购中。我使用"python包“进行管道和部署,但我不知道如何构建、打包和部署sam脚本?我搜索了谷歌,但没有获得好的资源或视频。
请给我一些好的资源,视频等。
发布于 2022-02-20 20:41:08
下面的脚本工作得很好。也许能帮上忙。
- task: AWSShellScript@1
displayName: 'Build'
inputs:
awsCredentials: AwsServiceConnection
regionName: $(Region)
scriptType: 'inline'
inlineScript: |
sam build --debug \
--template-file template.yaml
- task: AWSShellScript@1
displayName: 'Package'
inputs:
awsCredentials: AwsServiceConnection
regionName: $(Region)
scriptType: 'inline'
inlineScript: |
sam package --resolve-s3 (or it can be a bucket name. --s3-bucket <bucketname>) --output-template-file packaged.yaml
- task: AWSShellScript@1
displayName: 'Deploy Infrastructure'
inputs:
awsCredentials: AwsServiceConnection
regionName: $(Region)
scriptType: "inline"
inlineScript: |
sam deploy \
--template-file packaged.yaml \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM \
--stack-name test-dev-stack \
--resolve-s3 \ ( or it can be a bucket name. --s3-bucket <bucketname>)
--s3-prefix test-dev-stack
https://stackoverflow.com/questions/71107172
复制相似问题