Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeCG committed Mar 3, 2017
0 parents commit a72579b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from gcc:6.3

COPY entrypoint.sh /
COPY build.sh /project/build

RUN apt-get update && apt-get install -y cmake

ENTRYPOINT ["/entrypoint.sh"]
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

cd /project/target

cmake .
make
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

cd /project/target

# Copy answer to project
cp -r /project/answer/* .

# Compile
if make > /tmp/compilation_logs 2>&1; then
echo "CG> redirect-streams \"Test results\""

# Execute test
"$@"
else
echo "CG> redirect-streams \"Compilation logs\""

cat /tmp/compilation_logs
fi

0 comments on commit a72579b

Please sign in to comment.