Aws lambda 使用无服务器框架和aws lambda的aws codepipeline的Bitbucket CI/CD管道获得成功,但未创建lambda函数

Aws lambda 使用无服务器框架和aws lambda的aws codepipeline的Bitbucket CI/CD管道获得成功,但未创建lambda函数,aws-lambda,bitbucket,serverless-framework,Aws Lambda,Bitbucket,Serverless Framework,serverless.yml文件 service: test-apis frameworkVersion: '2' provider: name: aws runtime: nodejs12.x lambdaHashingVersion: 20201221 functions: hello: handler: handler.hello bitbucket-pipeline.yml version: 0.1 pipelines: default: # any

serverless.yml文件

service: test-apis

frameworkVersion: '2'

provider:
  name: aws
  runtime: nodejs12.x
  lambdaHashingVersion: 20201221

functions:
  hello:
    handler: handler.hello
bitbucket-pipeline.yml

version: 0.1

pipelines:
  default: # any branch except defined branch below e.g feature br
   - step:
        script:
          - npm ci
          - npm test
          - npm run lint
  branches:
    development: # development branch
      - step:
          script:
            - npm ci
            - npm test
            - npm run lint
     - step:
          # Build and package the Lambda function.
          name: Build and package
          script:
            - $BITBUCKET_CLONE_DIR/scripts/script.sh default
            - serverless deploy --stage dev
script.sh

PROFILE=$1
apt-get update && apt-get install -y python python-dev python-pip
pip install awscli
npm install -g serverless
npm ci
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile $PROFILE
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile $PROFILE
aws configure set $PROFILE.region $AWS_DEFAULT_REGION
export AWS_PROFILE=$PROFILE
日志


当我尝试使用aws codepipeline管道化bitbucket时,它获得了成功,但没有创建lambda函数。我使用的是无服务器框架,但它不起作用。日志中没有错误消息,但也没有输出。感谢您的帮助。谢谢。

它说
在buildspec中发现了可能的语法错误:无法识别以下键:pipelines
,这表明AWS CodeBuild不理解您尝试使用的
yml
。这很有意义,因为它是一个比特桶管道。我不确定您想做什么,但据我所知,Bitbucket管道和AWS CodeBuild是不同的CI/CD系统,您不能将它们混合使用,您需要为AWS CodeBuild编写一个新的
yml
。@yvesonline我想用AWS CodeBuild设置Bitbucket CI/CD管道。当我将任何更改推送到bitbucket时,我希望它配置aws服务。例如,我使用的lambda函数使用的是无服务器framwork和dynamodb,所以当我将任何更改推送到bitbucket时,它应该反映到codebuild中,并且应该为我创建lambda函数
[Container] 2021/05/03 13:12:12 Waiting for agent ping
[Container] 2021/05/03 13:12:16 Waiting for DOWNLOAD_SOURCE
[Container] 2021/05/03 13:12:19 Phase is DOWNLOAD_SOURCE
[Container] 2021/05/03 13:12:19 CODEBUILD_SRC_DIR=/codebuild/output/src008385171/src/bitbucket.org/betaflux/test-apis
[Container] 2021/05/03 13:12:19 YAML location is /codebuild/output/src008385171/src/bitbucket.org/betaflux/test-apis/bitbucket-pipeline.yml
[Container] 2021/05/03 13:12:19 Found possible syntax errors in buildspec: 
    The following keys cannot be identified:
        pipelines
[Container] 2021/05/03 13:12:19 Processing environment variables
[Container] 2021/05/03 13:12:20 No runtime version selected in buildspec.
[Container] 2021/05/03 13:12:20 Moving to directory /codebuild/output/src008385171/src/bitbucket.org/betaflux/test-apis
[Container] 2021/05/03 13:12:20 Registering with agent
[Container] 2021/05/03 13:12:20 Phases found in YAML: 0
[Container] 2021/05/03 13:12:20 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2021/05/03 13:12:20 Phase context status code:  Message: 
[Container] 2021/05/03 13:12:20 Entering phase INSTALL
[Container] 2021/05/03 13:12:20 Phase complete: INSTALL State: SUCCEEDED
[Container] 2021/05/03 13:12:20 Phase context status code:  Message: 
[Container] 2021/05/03 13:12:20 Entering phase PRE_BUILD
[Container] 2021/05/03 13:12:20 Phase complete: PRE_BUILD State: SUCCEEDED
[Container] 2021/05/03 13:12:20 Phase context status code:  Message: 
[Container] 2021/05/03 13:12:20 Entering phase BUILD
[Container] 2021/05/03 13:12:20 Phase complete: BUILD State: SUCCEEDED
[Container] 2021/05/03 13:12:20 Phase context status code:  Message: 
[Container] 2021/05/03 13:12:20 Entering phase POST_BUILD
[Container] 2021/05/03 13:12:20 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/05/03 13:12:20 Phase context status code:  Message: