docs: self-managed doc improvements

This commit is contained in:
Jay McCure 2023-03-07 20:30:33 +00:00 committed by Amy Qualls
parent 74474fb1d0
commit ec5d885c70
4 changed files with 34 additions and 4 deletions

View File

@ -15,7 +15,11 @@ and verify the issue you're about to submit isn't a duplicate.
- [ ] I'm using the latest version of the extension (Run `glab --version`)
- Extension version: _Put your extension version here_
- [ ] Operating System and version: __Put your version here_
- [ ] Operating system and version: _Put your version here_
- [ ] Gitlab.com or self-managed instance? _gitlab.com/self-managed instance/both_
- [ ] GitLab version (if self-managed) _GitLab version here_
(Use the `version` endpoint, like this: gitlab.my-company.com/api/v4/version)
- [ ] I have performed `glab auth status` to check for authentication issues
### Summary

View File

@ -2,7 +2,7 @@
<!--- Describe your changes in detail -->
## Related Issues
<!--- This project only accepts pull requests related to open issues -->
<!--- This project only accepts merge requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
Resolves #[issue_number]
@ -21,5 +21,6 @@ Resolves #[issue_number]
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation
- [ ] Chore (Related to CI or Packaging to platforms)
- [ ] Test gap
/label ~"devops::create" ~"group::code review" ~"Category:GitLab CLI" ~"cli"

View File

@ -138,7 +138,9 @@ To authenticate your installation of `glab`:
- For GitLab SaaS, authenticate against `gitlab.com` by reading the token
from a file: `glab auth login --stdin < myaccesstoken.txt`
- For self-managed instances, authenticate by reading from a file:
`glab auth login --hostname salsa.debian.org --stdin < myaccesstoken.txt`
`glab auth login --hostname gitlab.example.com --stdin < myaccesstoken.txt`. This will allow you to perform
authenticated `glab` commands against a self-managed instance when you are in a Git repository with a remote
matching your self-managed instance's host. Alternatively set `GITLAB_HOST` to direct your command to your self-managed instance.
- Authenticate with token and hostname: `glab auth login --hostname gitlab.example.org --token xxxxx`
Not recommended for shared environments.
@ -157,6 +159,29 @@ Configure it globally, locally, or per-host:
the `--host` parameter to meet your needs.
- Per-host configuration info is always stored in the global configuration file, with or without the `global` flag.
### Configure `glab` to use your self-managed instance
When outside a Git repository, `glab` uses `gitlab.com` by default. For `glab` to default
to your self-managed instance when you are not in a Git repository, change the host
configuration settings. Use this command, changing `gitlab.example.com` to the domain name
of your instance:
```shell
glab config set -g host gitlab.example.com
```
Setting this configuration enables you to perform commands outside a Git repository while
using your self-managed instance. For example:
- `glab repo clone group/project`
- `glab issue list -R group/project`
If you don't set a default domain name, you can declare one for the current command with
the `GITLAB_HOST` environment variable, like this:
- `GITLAB_HOST=gitlab.example.com glab repo clone group/project`
- `GITLAB_HOST=gitlab.example.com glab issue list -R group/project`
## Environment variables
- `GITLAB_TOKEN`: an authentication token for API requests. Setting this avoids being

View File

@ -2,7 +2,7 @@
<!--- Describe your changes in detail -->
**Related Issue**
<!--- This project only accepts pull requests related to open issues -->
<!--- This project only accepts merge requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
Resolves #[issue_number]