mirror of
https://github.com/mudler/luet.git
synced 2025-09-04 16:50:50 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e83f600ed3 | ||
|
6344e47eb3 |
@@ -40,7 +40,7 @@ var Verbose bool
|
||||
var LockedCommands = []string{"install", "uninstall", "upgrade"}
|
||||
|
||||
const (
|
||||
LuetCLIVersion = "0.16.0"
|
||||
LuetCLIVersion = "0.16.1"
|
||||
LuetEnvPrefix = "LUET"
|
||||
)
|
||||
|
||||
|
@@ -987,6 +987,14 @@ func (cs *LuetCompiler) compile(concurrency int, keepPermissions bool, generateA
|
||||
Assert: assertion,
|
||||
})
|
||||
|
||||
if err := cs.resolveJoinImages(concurrency, keepPermissions, compileSpec); err != nil {
|
||||
return nil, errors.Wrap(err, "while resolving join images")
|
||||
}
|
||||
|
||||
if err := cs.resolveMultiStageImages(concurrency, keepPermissions, compileSpec); err != nil {
|
||||
return nil, errors.Wrap(err, "while resolving multi-stage images")
|
||||
}
|
||||
|
||||
buildHash, err := packageHashTree.DependencyBuildImage(assertion.Package)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed looking for dependency in hashtree")
|
||||
|
7
tests/fixtures/join_complex/c/c1/build.yaml
vendored
Normal file
7
tests/fixtures/join_complex/c/c1/build.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
join:
|
||||
- name: "a"
|
||||
category: "test"
|
||||
version: ">=0"
|
||||
- name: "b"
|
||||
category: "test"
|
||||
version: ">=0"
|
3
tests/fixtures/join_complex/c/c1/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/c/c1/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
category: "test"
|
||||
name: "c"
|
||||
version: "1.2"
|
8
tests/fixtures/join_complex/c/f/build.yaml
vendored
Normal file
8
tests/fixtures/join_complex/c/f/build.yaml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
join:
|
||||
- name: "a"
|
||||
category: "test"
|
||||
version: ">=0"
|
||||
- name: "b"
|
||||
category: "test"
|
||||
version: ">=0"
|
||||
unpack: true
|
3
tests/fixtures/join_complex/c/f/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/c/f/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
category: "test"
|
||||
name: "f"
|
||||
version: "1.2"
|
2
tests/fixtures/join_complex/cat/a/a/build.yaml
vendored
Normal file
2
tests/fixtures/join_complex/cat/a/a/build.yaml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
image: "alpine"
|
||||
unpack: true
|
3
tests/fixtures/join_complex/cat/a/a/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/cat/a/a/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
category: "test"
|
||||
name: "a"
|
||||
version: "1.2"
|
13
tests/fixtures/join_complex/cat/b-1.1/build.yaml
vendored
Normal file
13
tests/fixtures/join_complex/cat/b-1.1/build.yaml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
requires:
|
||||
- category: "test"
|
||||
name: "a"
|
||||
version: ">=0"
|
||||
|
||||
prelude:
|
||||
- echo foo > /test
|
||||
- echo bar > /test2
|
||||
steps:
|
||||
- echo artifact5 > /newc
|
||||
- echo artifact6 > /newnewc
|
||||
- chmod +x generate.sh
|
||||
- ./generate.sh
|
3
tests/fixtures/join_complex/cat/b-1.1/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/cat/b-1.1/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
category: "test"
|
||||
name: "b"
|
||||
version: "1.1"
|
1
tests/fixtures/join_complex/cat/b-1.1/generate.sh
vendored
Normal file
1
tests/fixtures/join_complex/cat/b-1.1/generate.sh
vendored
Normal file
@@ -0,0 +1 @@
|
||||
echo generated > /sonewc
|
10
tests/fixtures/join_complex/x/build.yaml
vendored
Normal file
10
tests/fixtures/join_complex/x/build.yaml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
join:
|
||||
- category: "test"
|
||||
name: "f"
|
||||
version: ">=0"
|
||||
# this is actually a virtual, no files shipped in c
|
||||
- category: "test"
|
||||
name: "c"
|
||||
version: ">=0"
|
||||
steps:
|
||||
- mv /newnewc /x
|
3
tests/fixtures/join_complex/x/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/x/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
name: "x"
|
||||
category: "test"
|
||||
version: "0.1"
|
6
tests/fixtures/join_complex/z/build.yaml
vendored
Normal file
6
tests/fixtures/join_complex/z/build.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
requires:
|
||||
- category: "test"
|
||||
name: "c"
|
||||
version: ">=0"
|
||||
steps:
|
||||
- mv /newnewc /z
|
3
tests/fixtures/join_complex/z/definition.yaml
vendored
Normal file
3
tests/fixtures/join_complex/z/definition.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
name: "z"
|
||||
category: "test"
|
||||
version: "0.1"
|
37
tests/integration/31_join_complex.sh
Executable file
37
tests/integration/31_join_complex.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LUET_NOLOCK=true
|
||||
|
||||
oneTimeSetUp() {
|
||||
export tmpdir="$(mktemp -d)"
|
||||
docker images --filter='reference=luet/cache' --format='{{.Repository}}:{{.Tag}}' | xargs -r docker rmi
|
||||
}
|
||||
|
||||
oneTimeTearDown() {
|
||||
rm -rf "$tmpdir"
|
||||
docker images --filter='reference=luet/cache' --format='{{.Repository}}:{{.Tag}}' | xargs -r docker rmi
|
||||
}
|
||||
|
||||
testBuild() {
|
||||
[ "$LUET_BACKEND" == "img" ] && startSkipping
|
||||
mkdir $tmpdir/testbuild
|
||||
luet build --tree "$ROOT_DIR/tests/fixtures/join_complex" \
|
||||
--destination $tmpdir/testbuild --concurrency 1 \
|
||||
--compression gzip \
|
||||
test/z test/x
|
||||
buildst=$?
|
||||
assertEquals 'builds successfully' "$buildst" "0"
|
||||
assertTrue 'create package z' "[ -e '$tmpdir/testbuild/z-test-0.1.package.tar.gz' ]"
|
||||
assertTrue 'create package z' "[ -e '$tmpdir/testbuild/x-test-0.1.package.tar.gz' ]"
|
||||
|
||||
mkdir $tmpdir/extract
|
||||
tar -xvf $tmpdir/testbuild/x-test-0.1.package.tar.gz -C $tmpdir/extract
|
||||
tar -xvf $tmpdir/testbuild/z-test-0.1.package.tar.gz -C $tmpdir/extract
|
||||
assertTrue 'create result from a package that requires a join' "[ -e '$tmpdir/extract/z' ]"
|
||||
assertTrue 'create result from join of a join' "[ -e '$tmpdir/extract/x' ]"
|
||||
}
|
||||
|
||||
|
||||
# Load shUnit2.
|
||||
. "$ROOT_DIR/tests/integration/shunit2"/shunit2
|
||||
|
Reference in New Issue
Block a user