mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
add additional executors
This commit is contained in:
parent
64eda86817
commit
ef9c3ae091
7 changed files with 45 additions and 16 deletions
|
@ -5,6 +5,8 @@
|
|||
#docker run --rm -it piston /usr/bin/ruby --version
|
||||
#docker run --rm -it piston /usr/bin/nodejs --version
|
||||
|
||||
dir="$( cd "$( dirname "$0" )" && pwd )"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "invalid args"
|
||||
exit
|
||||
|
@ -21,10 +23,10 @@ file=$(basename $abs)
|
|||
bin=
|
||||
case "$lang" in
|
||||
"python2")
|
||||
bin=python2
|
||||
bin=executor_python2
|
||||
;;
|
||||
"python" | "python3")
|
||||
bin=python3
|
||||
bin=executor_python3
|
||||
;;
|
||||
"ruby")
|
||||
bin=ruby
|
||||
|
@ -32,6 +34,12 @@ case "$lang" in
|
|||
"javascript" | "js" | "node")
|
||||
bin=nodejs
|
||||
;;
|
||||
"c")
|
||||
bin=executor_c
|
||||
;;
|
||||
"cpp" | "c++")
|
||||
bin=executor_cpp
|
||||
;;
|
||||
*)
|
||||
echo "invalid language"
|
||||
exit
|
||||
|
@ -42,5 +50,9 @@ docker run \
|
|||
--cpus=".5" \
|
||||
--rm \
|
||||
-v $abs:/$file \
|
||||
-v $dir/executors/python2:/executor_python2 \
|
||||
-v $dir/executors/python3:/executor_python3 \
|
||||
-v $dir/executors/c:/executor_c \
|
||||
-v $dir/executors/cpp:/executor_cpp \
|
||||
piston \
|
||||
timeout -s HUP 3 $bin /$file 2>&1
|
||||
timeout -s HUP 3 /$bin /$file $file 2>&1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue