Skip to content

Commit eeb6753

Browse files
authored
Fix error message and add README section (#22)
1 parent 1363b4d commit eeb6753

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,29 @@ $ TEST_GITHUB_TOKEN=<a valid github auth token> go test ./...
3939

4040
Note that the tests in pkg/git/repository_test.go will clone and manipulate a
4141
remote Git repository locally.
42+
43+
To run a particular test: for example,
44+
45+
```shell
46+
go test ./pkg/git -run TestCopyServiceWithFailureCopying
47+
```
48+
49+
## Getting started
50+
51+
This section is temporary. To create a sample promotion Pull Request, until https://github.com/rhd-gitops-example/services/issues/8 is done:
52+
53+
- Copy https://github.com/mnuttall/gitops-repo-testing
54+
- Copy https://github.com/mnuttall/staging
55+
- Build the code: `go build ./cmd/services`
56+
- export GITHUB_TOKEN=[your token]
57+
- Substitute your repository URLs for those in square brackets:
58+
59+
```shell
60+
./services promote --from [https://github.com/mnuttall/gitops-repo-testing] --to [https://github.com/mnuttall/staging] --service service-a`
61+
```
62+
63+
We need to remove the local cache between requests. See https://github.com/rhd-gitops-example/services/issues/20. Until then, add `rm -rf ~/.promotion/cache; ` before subsequent requests.
64+
65+
New pull requests need new branches. Add `--branch [unique branch name]` before submitting further promotion PRs. See https://github.com/rhd-gitops-example/services/issues/21.
66+
67+
See https://github.com/rhd-gitops-example/services/issues/19 for an issue related to problems 'promoting' config from a source repo into a gitops repo.

pkg/avancement/service_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (s *ServiceManager) Promote(serviceName, fromURL, toURL, newBranchName stri
8888
func (s *ServiceManager) checkoutSourceRepo(repoURL, branch string) (git.Repo, error) {
8989
repo, err := s.cloneRepo(repoURL, branch)
9090
if err != nil {
91-
return nil, fmt.Errorf("failed to clone destination repo %s: %w", repoURL, err)
91+
return nil, fmt.Errorf("failed to clone source repo %s: %w", repoURL, err)
9292
}
9393
err = repo.Checkout(branch)
9494
if err != nil {

0 commit comments

Comments
 (0)