Commit graph

94 commits

Author SHA1 Message Date
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
Frederic Branczyk
673e9111b1
Merge pull request #42 from metalmatze/local-dependency-check
Check local dependency symlink destition for existence
2019-10-11 09:32:31 +02:00
Matthias Loibl
b21c04091a
Check errors or explicitly ignore 2019-10-10 17:47:41 +02:00
Matthias Loibl
f994e4644e
Fix install integration tests 2019-10-10 17:14:42 +02:00
Matthias Loibl
a2cf8f6412
Update vendor/ after updating to Go 1.13 2019-10-09 15:42:55 +02:00
Matthias Loibl
9a2a8afaeb
Introduce Go 1.13 to use stdlib error wrapping 2019-10-09 15:40:14 +02:00
Matthias Loibl
b1501bbce7
Check local dependency symlink destition for existence 2019-10-09 15:25:53 +02:00
Frederic Branczyk
10e24cb869
Merge pull request #38 from bgagnon/git-clone-optim
Git package install optimizations
2019-09-30 13:47:13 +02: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
Frederic Branczyk
c734431ebd
Update README.md
Add design doc
2019-08-13 15:27:02 +02:00
Frederic Branczyk
8b9e476d11
Merge pull request #36 from metalmatze/local-dependencies
Add local dependencies as source dependency
2019-08-13 11:21:45 +02:00
Matthias Loibl
e1580b7968
Remove symlink before creating new ones 2019-08-12 18:16:31 +02:00
Matthias Loibl
d3bb1f4ea4
Use URI as name for packages location paths 2019-08-12 18:02:21 +02:00
Matthias Loibl
6ed6c3f3ec
For local dependencies check if abs path exists 2019-08-12 11:50:56 +02: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
e655fcaf60
Update README.md with new args name 2019-07-23 15:09:58 -07:00
Matthias Loibl
e4dcc3e116
Refactor git deps install and make local deps install work 2019-07-23 15:07:35 -07:00
Frederic Branczyk
4bea3f2e30
Merge pull request #35 from metalmatze/tests
Add integration tests
2019-07-23 14:32:20 -07:00
Matthias Loibl
07801936c0
Create LocalSource as type for local dependencies 2019-07-23 14:01:25 -07:00
Matthias Loibl
6ee790d911
Add ability to parse local dependency 2019-07-23 14:00:27 -07:00
Matthias Loibl
e5199342ea
Remove unused code in main.go 2019-07-23 14:00:25 -07:00
Matthias Loibl
4630466006
Fix typo in parseDependency name and add tests 2019-07-23 14:00:24 -07:00
Matthias Loibl
95226f7f9b
Sort spec types by dependencies 2019-07-23 14:00:21 -07:00
Matthias Loibl
9110b1417d
Accept paths instead of URLs 2019-07-23 14:00:19 -07:00
Matthias Loibl
3e85357934
Actually run go test on packages 2019-07-23 14:00:17 -07:00
Matthias Loibl
53ca56c221
Separate update command into own file cmd/jb/update.go 2019-07-23 13:59:50 -07:00
Matthias Loibl
30a3cde870
Make use of File and LockFile constants of jsonnetfile package 2019-07-23 13:59:47 -07:00
Matthias Loibl
9d10f90924
Fix install integration tests by using v0.1.0 of jb 2019-07-23 13:44:51 -07:00
Matthias Loibl
ce22ada9e2
Run unit tests and integration tests in CI 2019-07-23 13:42:38 -07:00
Matthias Loibl
807ab8dc76
drone: Run tests including integration tests 2019-07-23 13:37:23 -07:00
Matthias Loibl
42b0bb7ab2
Add license headers 2019-07-23 13:36:28 -07:00
Matthias Loibl
2ac07139f6
Update vendored deps 2019-07-23 13:36:26 -07:00
Matthias Loibl
d95948a351
cmd/jb: Create integration tests for init and install 2019-07-23 13:36:23 -07:00
Matthias Loibl
f71ef86d48
Create pkg/jsonnetfile to better encapsulate jsonnetfile things 2019-07-23 13:36:21 -07:00
Matthias Loibl
27c36f6160
pkg: Write tests for TestInsertDependency, TestFileExists, TestLoadJsonnetfile 2019-07-23 13:36:18 -07:00