mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-16 23:29:38 +00:00
tests: cleanup test directory
- add a `pkg` directory for packages - add a `cases` directory for yml files Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
3
test/pkg/poweroff/Dockerfile
Normal file
3
test/pkg/poweroff/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM alpine:3.5
|
||||
ADD . ./
|
||||
ENTRYPOINT ["/bin/sh", "/poweroff.sh"]
|
29
test/pkg/poweroff/Makefile
Normal file
29
test/pkg/poweroff/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
.PHONY: tag push
|
||||
|
||||
BASE=alpine:3.5
|
||||
IMAGE=poweroff
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile poweroff.sh
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
|
||||
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
6
test/pkg/poweroff/poweroff.sh
Executable file
6
test/pkg/poweroff/poweroff.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
TIMEOUT=${1:-30}
|
||||
sleep "${TIMEOUT}"
|
||||
|
||||
/sbin/poweroff -f
|
Reference in New Issue
Block a user