File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2
2
set -eu -o pipefail
3
3
IMAGE_NAME=samba-timemachine
4
4
PLATFORMS=" linux/amd64,linux/arm64,linux/arm/v7"
5
+ TESTHOST=carbon
5
6
6
7
build () {
7
8
docker build " ${@ } " -t " ${IMAGE_NAME} :tmp" -f Dockerfile .
8
9
}
9
10
10
11
clean () {
11
- docker image rm " ${IMAGE_NAME} :tmp"
12
+ docker image rm " ${IMAGE_NAME} :tmp" || true
12
13
}
13
14
14
15
_test () {
@@ -37,10 +38,10 @@ release() {
37
38
docker buildx inspect --bootstrap
38
39
docker buildx build \
39
40
--platform " ${PLATFORMS} " \
40
- -t " timjdfletcher/${IMAGE_NAME} :${TAG} " --load .
41
+ -t " timjdfletcher/${IMAGE_NAME} :${TAG} " --push .
41
42
docker buildx build \
42
43
--platform " ${PLATFORMS} " \
43
- -t " timjdfletcher/${IMAGE_NAME} :latest" --load .
44
+ -t " timjdfletcher/${IMAGE_NAME} :latest" --push .
44
45
}
45
46
46
47
push () {
@@ -52,6 +53,15 @@ push() {
52
53
docker push " timjdfletcher/${IMAGE_NAME} :latest"
53
54
}
54
55
56
+ copyToTestHost () {
57
+ build --quiet
58
+ size=$( docker image inspect samba-timemachine:tmp | jq -r ' .[0].Size' )
59
+ docker save " ${IMAGE_NAME} :tmp" | \
60
+ pigz -c | \
61
+ pv -s " ${size} " | \
62
+ ssh -C " ${TESTHOST} " " pigz -d | docker load"
63
+ }
64
+
55
65
CMD=${1:- }
56
66
57
67
shift || true
@@ -60,6 +70,7 @@ case ${CMD} in
60
70
clean) clean ;;
61
71
test) _test ;;
62
72
push) push ;;
73
+ copyToTestHost) copyToTestHost ;;
63
74
release) release ;;
64
75
* ) usage ;;
65
76
esac
You can’t perform that action at this time.
0 commit comments