我已经在AWS CodeBuild中配置了CI / CD管道,并以GitHub monorepo作为源。当我将分支合并到master时,它将触发构建。
在yaml文件中配置的版本具有后续的git命令,当我尝试运行git fetch
时,出现引用头错误:
[Container] 2020/07/13 12:43:06 Running command git init
Reinitialized existing Git repository in /codebuild/output/id/src/github.com/***/repo/.git/
[Container] 2020/07/13 12:43:06 Running command git config user.email "user_email"
[Container] 2020/07/13 12:43:06 Running command git config user.name "***"
[Container] 2020/07/13 12:43:06 Running command git remote -v
origin https://github.com/***/repo.git (fetch)
origin https://github.com/***/repo.git (push)
[Container] 2020/07/13 12:43:06 Running command git remote set-url origin https://***:pwd@github.com/***/repo.git
[Container] 2020/07/13 12:43:06 Running command git fetch origin
error: refs/pull/1/head does not point to a valid object!
...
error: refs/pull/9/head does not point to a valid object!
[Container] 2020/07/13 12:43:07 Running command git checkout -f $GIT_BRANCH
error: refs/pull/1/head does not point to a valid object!
...
error: refs/pull/9/head does not point to a valid object!
Previous HEAD position was 46369d0 Update buildspec.yaml
Switched to branch 'master'
[Container] 2020/07/13 12:43:07 Running command git status
On branch master
nothing to commit, working tree clean
我已经尝试过git reset
和git rm -r --cached
,但是我可以解决这个问题。
当我推送到master分支后触发构建时,构建成功完成。在容器中更新存储库后,我运行lerna publish
来更新软件包版本并使用Terraform部署所有资源。