From 6ebf29ab3bee252e04a9337e349ba5d746eb00e9 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Fri, 31 Jan 2020 22:03:57 +0300 Subject: [PATCH] Setting up CI --- .gitignore | 1 + .grader-ci.yml | 6 ++++++ .releaser-ci.yml | 26 ++++++++++++++++++++++++++ build.docker | 1 + testenv.docker | 7 +++++++ 5 files changed, 41 insertions(+) create mode 100644 .gitignore create mode 100644 .grader-ci.yml create mode 100644 .releaser-ci.yml create mode 100644 build.docker create mode 100644 testenv.docker diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/.grader-ci.yml b/.grader-ci.yml new file mode 100644 index 0000000..47db6f8 --- /dev/null +++ b/.grader-ci.yml @@ -0,0 +1,6 @@ +grade: + image: eu.gcr.io/shad-ts/grader/go + only: + - /^submits/.*$/ + script: + - echo "Not implemented" diff --git a/.releaser-ci.yml b/.releaser-ci.yml new file mode 100644 index 0000000..edeb0de --- /dev/null +++ b/.releaser-ci.yml @@ -0,0 +1,26 @@ +check: + image: eu.gcr.io/shad-ts/grader/go-build + script: + - go test -tags private,solution ./... + - go test -race -tags private,solution ./... + +rebuild-base-image: + only: + - master + tags: + - docker + when: manual + script: + - docker build -f build.docker -t eu.gcr.io/shad-ts/grader/go-build . + - docker push eu.gcr.io/shad-ts/grader/go-build:latest + +deploy: + only: + - master + tags: + - docker + script: + - curl -F token=$TESTER_TOKEN https://go.manytask.org/api/sync_task_columns + - docker pull eu.gcr.io/shad-ts/grader/go-build:latest + - docker build -f testenv.docker -t eu.gcr.io/shad-ts/grader/go . + - docker push eu.gcr.io/shad-ts/grader/go:latest diff --git a/build.docker b/build.docker new file mode 100644 index 0000000..d04fd20 --- /dev/null +++ b/build.docker @@ -0,0 +1 @@ +FROM golang:1.13 diff --git a/testenv.docker b/testenv.docker new file mode 100644 index 0000000..f195d22 --- /dev/null +++ b/testenv.docker @@ -0,0 +1,7 @@ +FROM eu.gcr.io/shad-ts/grader/go-build:latest + +RUN go install gitlab.com/slon/shad-go/tools/testtool + +COPY . /opt/shad + +RUN find /opt/shad/private -name '*.cpp' -or -name '*.h' | xargs chmod o-rwx