Skip to content

Commit b8e2af4

Browse files
committed
Fix ./piston build, add test-with-cache option
1 parent a013613 commit b8e2af4

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

piston

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,23 @@ case "$SUBCOMMAND" in
3939
;;
4040

4141
build)
42+
build_base
4243
runtime_set=all
4344
if [[ ! -z "$1" ]]; then
44-
runtime_Set=$1
45+
runtime_set=$1
4546
fi
4647
# $1 contains a variant to build
4748
docker build \
48-
--build-arg RUNTIMESET=$1 \
49+
--build-arg RUNTIMESET=$runtime_set \
4950
-f "$SCRIPT_DIR"/Dockerfile.withset \
50-
-t "$IMAGE_NAME_DEV:$1-latest" \
51+
-t "$IMAGE_NAME_DEV:$runtime_set-latest" \
5152
.
5253
;;
5354

5455
# dev commands
5556

5657
scaffold)
57-
pushd "$SCRIPT_DIR"/runtimes > /dev/null
58+
pushd "$SCRIPT_DIR/runtimes" > /dev/null
5859
./scaffold.sh $1 $2
5960
popd > /dev/null
6061
;;
@@ -99,6 +100,17 @@ case "$SUBCOMMAND" in
99100
;;
100101

101102
test)
103+
docker run \
104+
--rm \
105+
-it \
106+
-e PISTON_FLAKE_PATH=/piston/src \
107+
-v "$SCRIPT_DIR":/piston/src \
108+
--name piston_test_runner \
109+
"$IMAGE_NAME_DEV:$IMAGE_TAG" \
110+
piston-test $1
111+
;;
112+
113+
test-with-cache)
102114
docker run \
103115
--rm \
104116
-it \
@@ -107,7 +119,7 @@ case "$SUBCOMMAND" in
107119
-v $DEV_VOLUME_NAME:/nix \
108120
--name piston_test_runner \
109121
"$IMAGE_NAME_DEV:$IMAGE_TAG" \
110-
bash -c "/piston/src/api/src/bin/test.js $1"
122+
piston-test $1
111123
;;
112124

113125
*)

0 commit comments

Comments
 (0)