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

时间:2020-10-22 03:47:30

标签: aws-codepipeline aws-sam aws-codecommit go-modules go-get

我已经使用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
)

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

0 个答案:

没有答案