Skip to content

Commit

Permalink
Merge pull request #65 from ywei2017/master
Browse files Browse the repository at this point in the history
Avoid hard code git user name/email is already set
  • Loading branch information
Rui Yang authored Jun 3, 2022
2 parents 6de7c7a + 0cd19c8 commit 886aa50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Run the tests with the following commands for both `alpine` and `ubuntu` images:

```sh
docker build -t pool-resource --target tests -f dockerfiles/alpine/Dockerfile .
docker build -t pool-resource --target tests -f dockerfiles/ubuntu/Dockerfile .
docker build -t pool-resource --target tests -f dockerfiles/ubuntu/Dockerfile --build-arg base_image=ubuntu:latest .
```

#### Note about the integration tests
Expand Down
16 changes: 12 additions & 4 deletions out/git_lock_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,22 @@ func (glh *GitLockHandler) Setup() error {
return err
}

_, err = glh.git("config", "user.name", "CI Pool Resource")
_, err = glh.git("config", "user.name")
if err != nil {
return err
// hardcode git user.name if not already set in git_config
_, err = glh.git("config", "user.name", "CI Pool Resource")
if err != nil {
return err
}
}

_, err = glh.git("config", "user.email", "ci-pool@localhost")
_, err = glh.git("config", "user.email")
if err != nil {
return err
// hardcode git user.email if not already set in git_config
_, err = glh.git("config", "user.email", "ci-pool@localhost")
if err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 886aa50

Please sign in to comment.