简体   繁体   中英

Error 'Unable to upload artifact' in CodePipeline when deploying a project in typescript

I'm migrating a lambda project from javascript to typescript but CodeBuild step always fail in the deploy and I don't understand what could be cause the of the issue

This is my build spec:

version: 0.2
phases:
  install:
    commands:
      - apt-get update
      - npm i yarn -g
      - yarn --ignore-engines
      - find ./node_modules -mtime +10950 -exec touch {} +
      - rm -rf ./docs
  build:
    commands:
      - yarn compile:server
      - aws cloudformation package
        --template-file templates/samTemplate.yaml
        --s3-bucket ${CFN_BUCKET}
        --output-template-file templates/outputSamTemplate.yaml
artifacts:
  type: zip
  files:
    - '**/*'


Unable to upload artifact ./../ referenced by CodeUri parameter of MyLambda resource.
'ascii' codec can't decode byte 0xe6 in position 1: ordinal not in range(128)

And this is CloudFormation piece for my lambda:

  MyLambda:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: !Sub "lambda"
      Role: !GetAtt LambdaRole.Arn
      CodeUri: ./../
      Handler: dist/handler/lambda.lambda
      Runtime: nodejs12.x
      Timeout: 30

Dos anyone know what could be possible happening?

Check out the documentation . It seems like that the path to your code is malformed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM