Skip to content

Commit a72579b

Browse files
committed
Add Dockerfile
0 parents  commit a72579b

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from gcc:6.3
2+
3+
COPY entrypoint.sh /
4+
COPY build.sh /project/build
5+
6+
RUN apt-get update && apt-get install -y cmake
7+
8+
ENTRYPOINT ["/entrypoint.sh"]

build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
cd /project/target
4+
5+
cmake .
6+
make

entrypoint.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
cd /project/target
4+
5+
# Copy answer to project
6+
cp -r /project/answer/* .
7+
8+
# Compile
9+
if make > /tmp/compilation_logs 2>&1; then
10+
echo "CG> redirect-streams \"Test results\""
11+
12+
# Execute test
13+
"$@"
14+
else
15+
echo "CG> redirect-streams \"Compilation logs\""
16+
17+
cat /tmp/compilation_logs
18+
fi

0 commit comments

Comments
 (0)