From 0d38d78c638e964e4f6ad9143fa75fb45ac91a0b Mon Sep 17 00:00:00 2001 From: xpetit <32063953+xpetit@users.noreply.github.com> Date: Wed, 31 Mar 2021 15:17:27 +0200 Subject: [PATCH] Put back student repository as read-only #3 --- go/tests/Dockerfile | 5 +++-- go/tests/entrypoint.sh | 9 ++++----- go/tests/go.mod | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go/tests/Dockerfile b/go/tests/Dockerfile index f7165937..175d9852 100644 --- a/go/tests/Dockerfile +++ b/go/tests/Dockerfile @@ -5,8 +5,8 @@ RUN apk add --no-cache git RUN go get golang.org/x/tools/cmd/goimports -RUN mkdir -p /jail/student -RUN touch /jail/student/go.mod +RUN mkdir -p /piscine-go +RUN touch /piscine-go/go.mod WORKDIR /public/go/tests COPY go.* ./ @@ -17,6 +17,7 @@ COPY lib lib COPY prog prog COPY rc rc RUN go install ./rc ./prog/... +RUN rm -rf /piscine-go COPY entrypoint.sh /usr/local/bin ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/go/tests/entrypoint.sh b/go/tests/entrypoint.sh index ce701a71..55bd52c1 100755 --- a/go/tests/entrypoint.sh +++ b/go/tests/entrypoint.sh @@ -2,7 +2,8 @@ set -e -cd student +cp -a student piscine-go +cd piscine-go if test "$EXAM_MODE"; then go mod init main 2>/dev/null @@ -10,8 +11,7 @@ if test "$EXAM_MODE"; then fi if test "$EXAM_RUN_ONLY" = true; then - go build -o ../exe "./$EXERCISE" - cd .. + go build -o exe "./$EXERCISE" ./exe "$@" exit fi @@ -46,8 +46,7 @@ fi # Compile and run test if command -v "${EXERCISE}_test" >/dev/null 2>&1; then # The exercise is a program - go build -o ../exe "./$EXERCISE" - cd .. + go build -o exe "./$EXERCISE" "${EXERCISE}_test" else # The exercise is a function diff --git a/go/tests/go.mod b/go/tests/go.mod index f613b833..014c9ed4 100644 --- a/go/tests/go.mod +++ b/go/tests/go.mod @@ -9,4 +9,4 @@ require ( student v0.0.0 ) -replace student => ../../../jail/student +replace student => ../../../piscine-go