Sublime Forum

How to setup git repository so that you can install the plugin via Package Control

#1

I have a plugin I’m working on. I’ve put it into git repo.
How to make it available for everyone?

If for some reasons I can only spread the plugin within my company, I know there is [Add Repository] command so that I can later install the plugin via Package Control.
How to setup the repo/plugin for it?

the thing is i’m trying [Add Repository] with my current repo that holds all content from devFolder in Packages and it doesn’t seem to be working

0 Likes

#2

Submit your package.

https://packagecontrol.io/docs/submitting_a_package

0 Likes

#3

can’t - company internal use only

0 Likes

#4

I believe that PackageControl will only work with BitBucket and GitHub repositories. If you don’t want/can’t put your package in PackageControl for general consumption, your options would be:

  1. Post your code in a private repository on one of those services, then get your users to add that repository with the command you mentioned in your post.
  2. Create your own channel. and then have all of your users add that channel.

Both options will make your package seamlessly appear in the list of all other available packages. The second one requires you to also host a JSON file that provides all of the available packages in your channel (even if it’s just one), along with all of the sublime-package files that correspond to the packages. They all have to be served over an https connection for PackageControl to make them visible as a security precaution.

Alternatively you can also just post your sublime-package files somewhere on your company Intranet or file share and have users drop them into the Installed Packages folder, although in that case they would be manually responsible for getting any updates.

4 Likes

#5

I noticed this is working for github and bitbucket.
What about gitlab? I have a server with GitLab setup and seems i can’t make it work.

As i understand to make a channel i need a json file with listed URLs to repositories (their jsons?). in each repository i need a json file with details for the repo. such repositories and channels i could add via [add channel] or [add repository] (pasting link to repo or the jsons?)

Can channel.json or repo.json or plugin be in the same place? i mean git-repo with plugin and there present repo.json and channel.json. For example an empty plugin with dependencies to every other plugin in the channel for 1-click-bulk-installation.

I would be grateful for an example repos and jsons, like uber-simple plugin adding button to main menu.

0 Likes

#6

You don’t need a custom channel, but a c ustom repository.json, which can be hosted wherever as long as it is directly accessible. I expect gitlab to support raw access of files in repos.

For examples, there is the Example-repository.json file in the PC repo and you can check other custom repositories references in the default channel’s channel.json.

0 Likes

#7

It is possible add a repository pointing to a specific branch?

0 Likes

#8

Just add the branch’s url.

Supported URLs are…

Github

https://github.com/{user}/{repo}.git
https://github.com/{user}/{repo}
https://github.com/{user}/{repo}/
https://github.com/{user}/{repo}/tree/{branch}
https://github.com/{user}/{repo}/tree/{branch}/

Gitlab

https://gitlab.com/{user}/{repo}.git
https://gitlab.com/{user}/{repo}
https://gitlab.com/{user}/{repo}/
https://gitlab.com/{user}/{repo}/-/tree/{branch}
https://gitlab.com/{user}/{repo}/-/tree/{branch}/

Bitbucket

https://bitbucket.org/{user}/{repo}.git
https://bitbucket.org/{user}/{repo}
https://bitbucket.org/{user}/{repo}/
https://bitbucket.org/{user}/{repo}/src/{branch}
https://bitbucket.org/{user}/{repo}/src/{branch}/

Please note, that branch may currently not contain / separators.

2 Likes

#9

Its necesary add .git at the of url like the original?

0 Likes

#10

No it isn’t.

TBH, it will be supported by PC4.x to just support all possible kinds of url schemes which look like a repo. PC extracts required information to do the API calls from those URLs, only.

0 Likes