Support for Github Entreprise in sls create #6332
What did you implement:
How did you implement it:
Check wether the provided repository url contains 'github' keyword. I originally intended to also check if the url was a valid github entreprise url (using the /api/v3 endpoint as a verification endpoint), but i had trouble having the test running fine after, so i stopped at "if url is not github.com, but contains github, then it's a github entreprise url".
How can we verify it:
Provided you have a github entreprise setup:
I tested with my own setup (I'm working in a company that has its own dedicated github entreprise running on premise), and it worked fine.
or run the
Note: There was an issue with the auth management in lib/utils/downloadTemplateFromRepo.js - parseGitHubURL function. When using the 'download' library (that relies on 'got' module), it refuses to handle basic authentication in the url directly and asked for an auth option (see line 205 of node_modules/got/index.js). I change the mechanism in lib/utils/downloadTemplateFromRepo.js and updated the test accordingly.
Is this ready for review?: YES
pmuens left a comment
Hey @kalote thanks for working on this!
This looks good so far. I just added a comment about a minor change with respect to how we handle GitHub / GitHub Enterprise detection (basically moving the logic to detect the difference in the function which parses the GitHub URL.
In addition to that it seems like the Travis build is failing.
Let me know what you think and let us know if you need any help here.