AWS codePipeline:获取:未知修订版v1.0.0

问题描述

我已经使用AWS SAM和Golang创建了一个API。此API使用的是专用模块,两个存储库都位于codecommit上。我的buildspec.yml文件是这样的:

phases:
  install:
    commands:
      - echo installing SAM ...
      - pip install awscli aws-sam-cli
      # Debugging
      - go env | sort
      - pwd
      - find .

  pre_build:
    commands:
      - echo Installing dependencies ...
      # Fetch all dependencies
      - go clean -modcache
      - GOSUMDB=off go get git-codecommit.region.amazonaws.com/v1/repos/my-modules.git
      - echo Installing dependencies done
      - go get ./...

  build:
    commands:
      - echo Build stated on `date`
      - make
      - sam deploy --template-file $PACKGED_TEMPLATE --stack-name $STACK_NAME --capabilities $CAPABILITY --s3-bucket $S3_BUCKET

  post_build:
    commands:
      - echo Deployment completed on `date`

go env |排序结果是:

GOnopROXY="git-codecommit.region.amazonaws.com/v1/repos/my-modules"
GONOSUMDB="git-codecommit.region.amazonaws.com/v1/repos/my-modules"
GOOS="linux"
GOPATH="/go:/codebuild/output/src161218396"
GOPRIVATE="git-codecommit.region.amazonaws.com/v1/repos/my-modules"
goproxy="https://proxy.golang.org,direct"

构建结果是错误

[Container] 2020/10/22 03:31:20 Running command GOSUMDB=off go get git-codecommit.region.amazonaws.com/v1/repos/my-modules.git
go: git-codecommit.region.amazonaws.com/v1/repos/my-modules.git@v1.0.0: reading git-codecommit.region.amazonaws.com/v1/repos/my-modules.git/go.mod at revision v1.0.0: unkNown revision v1.0.0

[Container] 2020/10/22 03:31:23 Command did not exit successfully GOSUMDB=off go get git-codecommit.region.amazonaws.com/v1/repos/my-modules.git exit status 1

my-modules软件包位于codecommit上,且标记为v1.0.0

image

my-modules / go.mod

module git-codecommit.region.amazonaws.com/v1/repos/my-modules.git

go 1.15

require (
    github.com/aws/aws-lambda-go v1.19.1
    github.com/aws/aws-sdk-go v1.35.10
)

无法找到此问题的原因。寻找帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)