Aws lambda lambda的codepipeline未部署最新代码
我已经创建了一个管道来部署lambda代码。这就是我的模板的外观Aws lambda lambda的codepipeline未部署最新代码,aws-lambda,aws-codepipeline,aws-codebuild,Aws Lambda,Aws Codepipeline,Aws Codebuild,我已经创建了一个管道来部署lambda代码。这就是我的模板的外观 AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > Sample SAM Template Globals: Function: Timeout: 3 Resources: HelloWorldFunction: Type: AWS::Serverless::Fu
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Sample SAM Template
Globals:
Function:
Timeout: 3
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src
Handler: app.lambda_handler
Runtime: python3.7
Events:
HelloWorld:
Type: Api
Properties:
Path: /hello
Method: get
这是buildspec
version: 0.2
phases:
install:
commands:
- pip install -r requirements.txt -t lib
build:
commands:
- export BUCKET=codepipeline-bucket
- aws cloudformation package --template-file template.yml --s3-bucket $BUCKET --output-template-file outputtemplate.yml
artifacts:
type: zip
files:
- template.yml
- outputtemplate.yml
每次我推到github并执行拉请求并合并到master时,都会触发源步骤。生成被触发,然后是部署。所有步骤都成功完成。我遇到的问题是,部署的代码总是落后于N-1版本。
如果我需要进行任何部署以获取最新的代码,那么我必须单击管道应用程序上的“发布更改”按钮。通过签入代码并合并pull请求,它不会得到最新的代码,而只得到我之前合并的提交。我不知道下一步该去哪里解决这个问题。这几乎就好像我的代码中src文件夹下的最后一次提交在其合并时没有被检测到,但是上一次提交被检测到