在AWS Lambda中部署Go服务器时找不到AWS

时间:2019-10-31 05:52:44

标签: go aws-lambda circleci

我正在尝试使用cirecleCI将Go服务器部署到AWS Lambda 根据circleCI 2文档,aws已预先安装 但是,出现此错误

找不到aws命令

简单的配置和简单的部署脚本,但是我无法部署代码

这是我的cicrleCI yaml:

version: 2

jobs:
  build:
    docker:
      - image: circleci/golang:1.10

    working_directory: /go/src/github.com/someGituser/sp-api-processor

    steps:
      - checkout

  deploy-staging:
    machine: true
    steps:
      - checkout
      - run:
          name: Deploy to Lambda Staging
          command: bash deploy.sh
          environment: 
            LAMBDA_FUNCTION_NAME: sp-api-processor-staging

workflows:
  version: 2

  build-test-and-deploy:
    jobs:
      - build
      - hold:
          type: approval
          requires:
           - build
          filters:
            branches:
              only: master
      - deploy-staging:
          requires:
           - build
          context: suryapandian-staging
          filters:
            branches:
              only: staging

这是我的部署shell脚本

go install
go clean    
goimports -w=true .    
gofmt -w .    
go generate ./...  
rm -r deployment.zip  
GOOS=linux go build -o dist/main   
zip deployment.zip dist/main
aws lambda update-function-code --function-name=$LAMBDA_FUNCTION_NAME --zip-file=fileb://deployment.zip --region=ap-south-1

0 个答案:

没有答案