Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--clone flag doesn't work with private hosted repo #1029

Closed
affanshahid opened this issue Mar 23, 2018 · 15 comments
Closed

--clone flag doesn't work with private hosted repo #1029

affanshahid opened this issue Mar 23, 2018 · 15 comments

Comments

@affanshahid
Copy link

affanshahid commented Mar 23, 2018

Version

2.9.3

Reproduction link

https://github.com/vuejs/vue-cli/tree/master

Steps to reproduce

Please forgive the invalid repro link, not sure what to put for a cli issue

My template repo is within a subgroup, I'm running the following:

vue init --clone my-project gitlab:my-own-gitlab.com:group-a/subgroup-a/template-repo

What is expected?

Template should be initialized from:
my-own-gitlab.com/group-a/subgroup-a/template-repo

What is actually happening?

vue-cli · Failed to download repo ... 'git clone' failed with status 128

@andreasvirkus
Copy link

andreasvirkus commented Apr 12, 2018

Same happens for version 3.0.0-beta.6 when targeting a self-hosted BitBucket.
download-git-repo has a direct command, could we utilise this maybe?
https://github.com/flipxfx/download-git-repo/issues/19

[ code ] ◉  vue create --preset https://stash.big.local/projects/WEB/repos/vue-cli-plugins --clone my-project
✔  Fetching remote preset https://stash.big.local/projects/WEB/repos/vue-cli-plugins...
 ERROR  Failed fetching remote preset https://stash.big.local/projects/WEB/repos/vue-cli-plugins:
 ERROR  Error: 'git clone' failed with status 128
Error: 'git clone' failed with status 128
    at ChildProcess.<anonymous> (/Users/andreas.virkus/.npm-global/lib/node_modules/@vue/cli/node_modules/git-clone/index.js:33:22)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Socket.stream.socket.on (internal/child_process.js:348:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:549:12)

@yuicer
Copy link

yuicer commented Apr 20, 2018

@affanshahid same here, is there any solution for this problem?
env: mac pro
verision: 2.9.3

@yuicer
Copy link

yuicer commented Apr 23, 2018

i get it done finally after i check out the repo ‘download-git-repo’ . it has listed the solutions.
repo
@affanshahid
@andreasvirkus

@yyx990803 yyx990803 added the 2.x Issues for 2.x legacy versions label Apr 27, 2018
@andreasvirkus
Copy link

andreasvirkus commented Apr 27, 2018

@yyx990803 The issue is also present for 3.x. Should I create a separate ticket for this (although I feel the fix should be universal, right?)

@yyx990803
Copy link
Member

3.x init is just a bridge to 2.x code.

@andreasvirkus
Copy link

@yyx990803 I don't mean init but create. I'd wish to use a preset from an internal, self-hosted bitbucket, so I'm trying to run

[ code ] ◉  vue create --preset https://stash.big.local/projects/WEB/repos/vue-cli-plugins --clone my-project

Please see my initial comment above with the error I'm getting

@yyx990803 yyx990803 changed the title Initialize from self-hosted gitlab from inside a group --clone flag doesn't work with private hosted repo Apr 27, 2018
@yyx990803 yyx990803 added scope: cli and removed 2.x Issues for 2.x legacy versions labels Apr 27, 2018
@yyx990803
Copy link
Member

@andreasvirkus ah got it, I've updated the description.

@yyx990803
Copy link
Member

Fixed by #1880

@guirreri
Copy link

With 3.0.2 I'm still having an issue with getting this to work.

This is the command I'm using with a privately hosted bitbucket server at stash.myserver.com:
vue create --preset stash.myserver.com/projects/EXP/repos/vue-cli-plugin-init --clone my-project

Returns with an error of:

✔  Fetching remote preset stash.myserver.com/projects/EXP/repos/vue-cli-plugin-init...
ERROR  Failed fetching remote preset stash.myserver.com/projects/EXP/repos/vue-cli-plugin-init:
 ERROR  Error: 'git clone' failed with status 128
Error: 'git clone' failed with status 128
    at ChildProcess.<anonymous> (/Users/ .... /.nvm/versions/node/v8.11.3/lib/node_modules/@vue/cli/node_modules/git-clone/index.js:33:22)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)

Here is a second failed test, as I'm not 100% certain about the command syntax. In this case it just sits forever with no error:

vue create --preset bitbucket:stash.myserver.com:myusername/exp/vue-cli-plugin-init --clone my-project-test
⠹  Fetching remote preset bitbucket:stash.myserver.com:myusername/exp/vue-cli-plugin-init...The authenticity of host 'stash.myserver.com (xx.xxx.xxx.xx)' can't be established.
ECDSA key fingerprint is SHA256:......
⠸  Fetching remote preset bitbucket:stash.myserver.com:myusername/exp/vue-cli-plugin-init...

I've also tried various iterations of the git path, but always have one of the two same issues.

For reference, the git clone URL looks like this. Note the specified port in the ssh url - not sure if that matters:
ssh://git@stash.myserver.com:PORT/exp/vue-cli-plugin-init.git
https://myusername@stash.myserver.com/scm/exp/vue-cli-plugin-init.git

@austriker27
Copy link

I'm also getting the status 128 message when trying to clone down a private GitHub repo that I've made for a custom Vue preset.

@bodograumann
Copy link
Contributor

I am also seeing this issue with vue-cli version 3.2.1.

Furthermore I have published my preset in a private npm registry with a scope and running vue create --preset @myscope/vue-cli-preset-mypreset --clone myapp does not work either, but I guess this is a separate feature request, isn‘t it?

@JimmyLv
Copy link

JimmyLv commented Jan 7, 2019

Any progress, please?

@jfngoo
Copy link

jfngoo commented Jan 10, 2019

@guirreri @austriker27 @bodograumann @JimmyLv
It worked for me on a private, self-hosted gitlab and I'm using vue CLI 3.3.0.

My command looked like vue create --preset https://gitlab.server.com:group/preset --clone my-project

@guirreri According to https://github.com/flipxfx/download-git-repo you need to use ":" after the hostname and before the username.
You should try vue create --preset https://stash.myserver.com:projects/EXP/repos/vue-cli-plugin-init --clone my-project. Note the ":".

@bodograumann download-git-repo is meant to download a git repository on GitHub, GitLab or Bitbucket, not an npm package.

If you're still having trouble, I'd recommend you to create a new, fresh empty folder, install download-git-repo (link above) and try it for yourself in a simple node script until you can make it work.

@bodograumann
Copy link
Contributor

@Kendaros
Thank you for your help.
Unfortunately the documentation does not mention that the preset location should be given in the download-git-repo format.

Additionally, my tests show the following:

  • vue create --preset gitlab:my-gitlab-server.com:group/projectname --clone my-project works
  • vue create --preset https://my-gitlab-server.com:group/projectname --clone my-project works, but it is not possible to enter username and password on the command line then.
  • Using any URL starting with ssh:// doesn’t seem to work, for that you have to use the “direct” syntax:
  • vue create --preset direct:ssh://git@my-gitlab-server.com/group/projectname.git is ok
  • Adding .git to any of the short forms is not allowed.

@yyx990803, do you think you can add a note on self-hosted repos to the docs?

@yuicer
Copy link

yuicer commented Jan 10, 2019

ok, i'm back here again....
just try this vue create -p direct:ssh://git@ssh.gitlab.your.com:333/vue-tpl.git --clone

whatever. it does work for me since i found the direct command a few mounth ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants