This commit is contained in:
Morten Olsen
2022-04-03 22:15:45 +02:00
parent 56235d8f5e
commit cc7b7c6849
105 changed files with 15694 additions and 6 deletions

View File

@@ -0,0 +1,8 @@
setup() {
load '../../bats_helpers'
common_setup
}
@test "alpine" {
dagger "do" -p ./test.cue test
}

View File

@@ -0,0 +1,53 @@
package alpine
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine"
"universe.dagger.io/docker"
)
dagger.#Plan & {
actions: test: {
// Test: customize alpine version
alpineVersion: {
build: alpine.#Build & {
// install an old version on purpose
version: "3.10.9"
}
verify: core.#ReadFile & {
input: build.output.rootfs
path: "/etc/alpine-release"
contents: "3.10.9\n"
}
}
// Test: install packages
packageInstall: {
build: alpine.#Build & {
packages: {
jq: {}
curl: {}
}
}
check: docker.#Run & {
input: build.output
command: {
name: "sh"
flags: "-c": """
jq --version > /jq-version.txt
curl --version > /curl-version.txt
"""
}
export: files: {
"/jq-version.txt": contents: =~"^jq"
"/curl-version.txt": contents: =~"^curl"
}
}
}
}
}