Browse code

Add containerd/runc exes to bundle dir after build

Not sure if this is the right setup given the containerd change but I need
to have the built version of the nested exes (containerd, runc...) available
to me after the build is completed so I'm always testing using the latest
versions. This PR will copy them into the same bundles dir so people can
them use them if they wish w/o having to build each separately.

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis authored on 2016/03/20 01:39:55
Showing 2 changed files
... ...
@@ -62,3 +62,18 @@ echo "Created binary: $DEST/$BINARY_FULLNAME"
62 62
 ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
63 63
 
64 64
 hash_files "$DEST/$BINARY_FULLNAME"
65
+
66
+# Add nested executables to bundle dir so we have complete set of
67
+# them available, but only if the native OS/ARCH is the same as the
68
+# OS/ARCH of the build target
69
+if [ "$(go env GOOS)/$(go env GOARCH)" == "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
70
+	echo "Copying nested executables into $DEST"
71
+	(set -x
72
+	if [ -x /usr/local/bin/runc ]; then
73
+		cp /usr/local/bin/runc $DEST/
74
+		cp /usr/local/bin/ctr $DEST/
75
+		cp /usr/local/bin/containerd $DEST/
76
+		cp /usr/local/bin/containerd-shim $DEST/
77
+	fi
78
+	)
79
+fi
... ...
@@ -27,3 +27,18 @@ echo "Created binary: $DEST/$BINARY_FULLNAME"
27 27
 ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
28 28
 
29 29
 hash_files "$DEST/$BINARY_FULLNAME"
30
+
31
+# Add nested executables to bundle dir so we have complete set of
32
+# them available, but only if the native OS/ARCH is the same as the
33
+# OS/ARCH of the build target
34
+if [ "$(go env GOOS)/$(go env GOARCH)" == "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
35
+    echo "Copying nested executables into $DEST"
36
+    (set -x
37
+    if [ -x /usr/local/bin/runc ]; then
38
+        cp /usr/local/bin/runc $DEST/
39
+        cp /usr/local/bin/ctr $DEST/
40
+        cp /usr/local/bin/containerd $DEST/
41
+        cp /usr/local/bin/containerd-shim $DEST/
42
+    fi
43
+    )
44
+fi