multi-tenancy-gitops icon indicating copy to clipboard operation
multi-tenancy-gitops copied to clipboard

OUTPUT_DIR=. ./create-repos.sh.

Open markalfy1 opened this issue 3 years ago • 7 comments

it creates multi-tenancy-gitops repo only for Mac:

brew install wget
brew install gh

Client Version: 4.7.13
Creating GitHub repositories and local clones in folder: .
Github user/org is mq-apic-demo
gh: Not Found (HTTP 404)
Repository multi-tenancy-gitops not found, creating from template and cloning
✓ Created repository mq-apic-demo/multi-tenancy-gitops on GitHub
Initialized empty Git repository in /Users/markalfy/git/mq-apic-demo-root/multi-tenancy-gitops/.git/
fatal: couldn't find remote ref refs/heads/master
exit status 128

markalfy1 avatar Feb 22 '22 16:02 markalfy1

And when you re-run this script to get the other created, here is the error: Your Github CLI (gh) version is: 2.5.2 Please use oc client version 4.7 or 4.8 download from https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/ Creating GitHub repositories and local clones in folder: . Github user/org is MQ-Validation Repository multi-tenancy-gitops exists and already cloned... nothing to do error: pathspec 'master' did not match any file(s) known to git fatal: 'origin/master' is not a commit and a branch 'master' cannot be created from it

rikgig avatar Mar 10 '22 15:03 rikgig

It worked for me yesterday. I guess double-check your client levels (oc & gh) and whether you are running the script from under your GitHub local directory. I got all 4 repos created in my fork and cloned successfully.

dthiesse avatar Mar 10 '22 15:03 dthiesse

Strange. I does fail over an over here. My gh has been updated this morning before running it.

Changing this in the create_repos.sh did the trick: From: gh repo create ${GIT_ORG}/multi-tenancy-gitops-infra --public --template https://github.com/cloud-native-toolkit/multi-tenancy-gitops-infra --clone

To: gh repo create ${GIT_ORG}/multi-tenancy-gitops --public --template https://github.com/cloud-native-toolkit/multi-tenancy-gitops gh repo clone ${GIT_ORG}/multi-tenancy-gitops

Now it works. We do a PR or more investigation?

rikgig avatar Mar 10 '22 16:03 rikgig

Interesting and puzzling. Why don't you do a PR and we can let @hollisc and other reviewers decide. I'm glad you found a solution, and maybe we could avoid any problems for others by making the change.

dthiesse avatar Mar 10 '22 16:03 dthiesse

Sure is. Ok I'll do that (the PR). @hollisc is aware we were discussing on Webex and was able to show live both the problem and he suggested the gh fix :)

rikgig avatar Mar 10 '22 16:03 rikgig

@dthiesse , can you check what version of gh you are using? From checking with a few ppl, the issue appears to happen if using version 2.5.2

hollisc avatar Mar 11 '22 13:03 hollisc

@hollisc I am using gh version 2.5.2 (2022-03-01)

dthiesse avatar Mar 11 '22 14:03 dthiesse