@@ -298,7 +298,7 @@ To update distributions **and** their versions:
298
298
binenv update --all # or -a
299
299
```
300
300
301
- ##### Using custom distributions file
301
+ ##### Using custom distributions file (and private GitLab repos)
302
302
303
303
If you want to use a custom distributions file, you can add a ` .yaml ` file in
304
304
the ` $XDG_CONFIG ` directory (often ` ~/.config/binenv/ ` ).
@@ -308,6 +308,37 @@ This file will be merged with the default distributions file.
308
308
Note that files are evaluated in lexicographical order, so if you want to
309
309
override a default, you should name your file accordingly.
310
310
311
+ You can use this mechanism to install binaries from private GitLab repositories
312
+ (GitHub not supported right now). If you need to pass a ` PRIVATE-TOKEN ` in the
313
+ headers, you need to set the ` token_env ` key in the ` list ` and ` fetch `
314
+ sections. This key should contain the name of the environment variable that is
315
+ set with the token.
316
+
317
+ Here is an example file:
318
+
319
+ ``` yaml
320
+ $ cat ~/.config/binenv/distributions-custom.yaml
321
+ ---
322
+ sources :
323
+ foo :
324
+ description : This tool let's you foo database tables
325
+ url : https://gitlab.exemple.org/infrastructure/tools/foo
326
+ list :
327
+ type : gitlab-releases
328
+ url : https://gitlab.example.org/api/v4/projects/42/releases
329
+ token_env : FOO_PRIVATE_TOKEN
330
+ fetch :
331
+ url : https://gitlab.example.org/api/v4/projects/42/packages/generic/foo/{{ .Version }}/foo-{{.OS }}-{{ .Arch }}-{{ .Version }}.gz
332
+ token_env : FOO_PRIVATE_TOKEN
333
+ install :
334
+ type : gzip
335
+ binaries :
336
+ - " foo-{{.OS }}-{{ .Arch }}-{{ .Version }}.gz"
337
+ ` ` `
338
+
339
+ You will have to ` export FOO_PRIVATE_TOKEN=your_token` before running `binenv`
340
+ to make the token available.
341
+
311
342
# ### Examples
312
343
313
344
- `binenv update` : update available versions for all distributions from github
@@ -810,9 +841,6 @@ sudo env "PATH=$PATH" "HOME=$HOME" binary_installed_with_binenv ...
810
841
811
842
Welcomed !
812
843
813
- We will need other installation mechanisms (see
814
- https://github.com/devops-works/binenv/tree/master/internal/install).
815
-
816
844
Thanks to all contributors:
817
845
818
846
- @alenzen
0 commit comments