Commit graph

39 commits

Author SHA1 Message Date
d655269156
feat: add gitlab source for gitlab package registry
cleanup http source
2023-09-25 14:40:39 +02:00
428608f190
feat: add http source with support for environment variables 2022-11-29 16:07:42 +01:00
Johannes 'fish' Ziemke
bff9df564e Replace / in version by -
This fixes #145
2021-07-19 18:39:14 +02:00
Hang Xie
637111ed16 Add --quiet option to suppress git progress output 2020-07-07 04:19:56 +00:00
Dominik Süß
9e88f6d38d
fix: windows enhancements (#110)
* use filepath to check for known packages

this fixes an issue using windows. without this patch, jb would delete
the folder after installation since the path is not known

* reduce temp directory length by hashing

using this hash it is harder to reach the windows limit for filenames
and directories

* further reduce temp dir length

* do not build binaries for windows/amd*
2020-05-20 15:51:58 +02:00
Dominik Süß
50b717beab
Fix subgroup parsing on subsequent installs (#93)
* Fix subgroup parsing on subsequent installs

* enforce .git as remote suffix

* fix integration tests

* do not modify pointer receiver in getters

* fix merged integration tests
2020-05-06 20:40:34 +02:00
David Genest
cf414c4370
Fix unarchiver (#86)
* rework archive uncompress

fix err shadoing that silenced archive errors

* remove git command duplication
2020-04-20 21:39:31 +02:00
Matthias Loibl
bcd89fd33d
feat(spec): version field (#85)
Adds a `version` field to the `jsonnetfile.json`, so that `jb` can automatically recognize too old / too new schema versions, instead of panicking.
2020-02-28 17:41:49 +01:00
Tom
7b8a7836a4
feat: absolute imports (#63)
* feat: go-like import style

jb now creates a directory structure inside of vendor/ that is similar to how go
does (github.com/grafana/jsonnet-libs). This is reflected in the final import
paths, which means they will be go-like

* refactor(spec/deps): named regexs

* feat: make goImportStyle configurable

Defaults to off, can be enabled in `jsonnetfile.json`

* fix: integration test

* doc: license headers

* fix(deps): remove GO_IMPORT_STYLE

not an option anymore, will always do so and symlink

* feat: symlink to legacy location

* feat: allow to disable legacy links

* fix(test): legacyImports in integration tests

* fix(spec): test

* fix: respect legacyName aliases

It was possible to alias packages by changing `name` previously.

While names are now absolute (and computed), legacy links should still respect
old aliases to avoid breaking code.

* fix(test): integration

* fix(init): keep legacyImports enabled for now

* feat: rewrite imports

adds a command to automatically rewrite imports from legacy to absolute style

* fix(tool): rewrite confused by prefixing packages

When a package was a prefix of another one, it broke.
Fixed that by using a proper regular expression. Added a test to make sure it
works as expected

* Update cmd/jb/init.go

* fix: exclude local packages from legacy linking

They actually still use the old style, which is fine. LegacyLinking
messed them up, but from now on it just ignores symlinks that match a localPackage.
2020-01-24 08:02:34 +01:00
Hang Xie
013e3937e8 fix: unknown pathspec on tags (#58)
forces to fetch tags from the remote. This was dependent on `git-config` before and led to issues with some users where tags were not be fetched
2019-11-08 15:44:37 +01:00
sh0rez
71938456ae
refactor: switch to pkg/jsonnetfile
So far, `pkg` and `pkg/jsonnetfile` had overlapping functionality when it came
to choosing and loading jsonnetfiles.

This fully switches to the separate package `pkg/jsonnetfile` that seems to be
created for exactly this purpose
2019-10-29 21:44:27 +01:00
david
f3c21baad8 restore symlinks from tar archive
fixes #50
2019-10-24 22:41:13 -04:00
Benoit Gagnon
ed7d84f846 update comments to reflect git install changes
Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
2019-10-24 11:08:24 -04:00
Benoit Gagnon
1915ef519a relax the SHA1 regex to cover SHA1, SHA256 and any other length of SHA
Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
2019-10-24 11:06:36 -04:00
Benoit Gagnon
2bf42f11cd use fmt.Errorf(...) instead of errors.new(fmt.Sprintf(...))
Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
2019-10-24 11:05:54 -04:00
Benoit Gagnon
f09b41c7da
use regexp.MustCompile
Co-Authored-By: David Genest <david.genest@gmail.com>
2019-10-24 10:47:35 -04:00
Benoit Gagnon
a44fae09a0
declare Buffer instead of using NewBuffer
Co-Authored-By: David Genest <david.genest@gmail.com>
2019-10-24 10:46:51 -04:00
Benoit Gagnon
f4b09c811e replace ETag SHA1 assumption with an explicit call to git ls-remote
Not using an undocumented ETag header from the GitHub archive API is
probably for the best. This is slightly slower due to extra round-trip,
but it is still much faster than cloning the repository to resolve the
ref.

Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
2019-10-23 10:52:39 -04:00
Benoit Gagnon
50eac0e70c move the extracted archive into place before exiting Install 2019-09-29 17:24:47 -04:00
Benoit Gagnon
41278d8ef4 undo typo in tarball url format 2019-09-28 11:43:10 -04:00
Benoit Gagnon
741e7f316f fall back to git if github archive download fails for any reason 2019-09-28 11:41:08 -04:00
Benoit Gagnon
2b485512c0 improve github archive download error reporting 2019-09-28 11:40:09 -04:00
Benoit Gagnon
524c820a94 use regex instead of prefix match to detect github remotes
this will allow the optimization to work for both ssh and https
2019-09-28 11:23:15 -04:00
Benoit Gagnon
76d85b1f49 honor header.Mode for directories found in tarballs 2019-09-28 11:04:49 -04:00
Benoit Gagnon
5b12e9c798 additional error checking 2019-09-28 10:57:02 -04:00
Benoit Gagnon
93c18a7d4d motivate the explicit f.Close() 2019-09-28 10:56:47 -04:00
Benoit Gagnon
b597b16173 use filepath.Join instead of string concatenation 2019-09-28 10:32:26 -04:00
Benoit Gagnon
1fe94dcf91 fix "errors" pkg double import 2019-09-28 10:26:47 -04:00
Benoit Gagnon
926830713e Merge remote-tracking branch 'origin/master' into git-clone-optim
# Conflicts:
#	pkg/git.go
2019-09-28 10:24:11 -04:00
Benoit Gagnon
5e742d5339 Resolve commit SHA1 from GitHub archive ETag header 2019-07-30 22:50:39 -04:00
Benoit Gagnon
134b21a473 use Go-native untar and gunzip support to unpack github archives 2019-07-30 21:49:32 -04:00
Benoit Gagnon
ba93fb74c3 Download tarball archives from GitHub (wip) 2019-07-26 08:05:50 -04:00
Benoit Gagnon
671f860a19 Shallow fetch for Git packages
If the server supports it, fetch a specific
revision with --depth 1. Otherwise, fall back
to the normal fetch.

This replaces the previous "clone" operation. The bandwidth and time savings
can be significant depending on the history
of the repository (number of commits).
2019-07-24 23:02:14 -04:00
Benoit Gagnon
30d7929566 Use git sparse checkout whenever possible
If a SubDir is configured for the package,
everything but that directory will be thrown
away after the package is installed.
2019-07-24 22:59:53 -04:00
Benoit Gagnon
c9a5b0a6b2 Pass -n flag to git clone
There's an explicit git checkout command
issued moments later, so there's no need
to create a working copy during the clone.
2019-07-24 22:16:00 -04:00
Matthias Loibl
e4dcc3e116
Refactor git deps install and make local deps install work 2019-07-23 15:07:35 -07:00
davidovich
c914ece3df suppress detached head advice
This limits urelated output to the console when installing deps
2019-07-23 12:43:21 -04:00
Frederic Branczyk
f69df626e3
Add ability to resolve and install transitive dependencies 2018-04-25 09:01:00 +01:00
Frederic Branczyk
cb59934d1d
Initial commit 2018-04-24 16:01:37 +01:00