Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 225cb40

Browse files
committed
Add gitlab CI and move syzoj and judge-v3 into tree
1 parent 69e5e2f commit 225cb40

File tree

604 files changed

+529665
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

604 files changed

+529665
-11
lines changed

.gitlab-ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file is a template, and might need editing before it works on your project.
2+
docker-build-master:
3+
# Official docker image.
4+
image: docker:latest
5+
stage: build
6+
services:
7+
- docker:dind
8+
before_script:
9+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
10+
script:
11+
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
12+
- docker push "$CI_REGISTRY_IMAGE"
13+
only:
14+
- master
15+
16+
docker-build:
17+
# Official docker image.
18+
image: docker:latest
19+
stage: build
20+
services:
21+
- docker:dind
22+
before_script:
23+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
24+
script:
25+
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
26+
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
27+
except:
28+
- master
29+

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu
2+
RUN apt-get update -y && apt-get install -y ca-certificates curl gnupg && \
3+
echo "deb https://deb.nodesource.com/node_8.x bionic main" >> /etc/apt/sources.list.d/nodesource.list && \
4+
echo "deb-src https://deb.nodesource.com/node_8.x bionic main" >> /etc/apt/sources.list.d/nodesource.list && \
5+
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
6+
RUN apt-get update -y && apt-get install -y p7zip-full clang-format python-pygments nodejs gcc g++ make libboost-filesystem-dev git
7+
RUN mkdir /opt/syzoj && mkdir /opt/judge-v3
8+
ADD syzoj/package.json /opt/syzoj
9+
ADD judge-v3/package.json /opt/judge-v3
10+
RUN cd /opt/syzoj && npm install && cd /opt/judge-v3 && npm install
11+
ADD syzoj /opt/syzoj
12+
ADD judge-v3 /opt/judge-v3
13+
WORKDIR /opt/syzoj
14+
RUN node_modules/.bin/tsc || true
15+
WORKDIR /opt/judge-v3
16+
RUN node_modules/.bin/tsc || true
17+
WORKDIR /

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syzoj-ng
2+
---
3+
4+
syzoj-ng 项目的主 repo。目前正在进行过渡的策略,在原有的 syzoj 和 judge-v3 的基础上进行小幅修改,用 Go 语言逐渐重新实现原有的所有功能。
5+
6+
安装方法:
7+
1. 进入 `deploy` 文件夹,运行 `prepare.sh`,自动生成配置文件里需要的各种密钥。
8+
2. 创建一个新文件夹,复制 `docker-compose.yml``config` 文件夹,并创建一个名为 `sandbox-rootfs` 的空文件夹。
9+
3. 执行 `docker pull syzoj/rootfs:181202``docker create --name rootfs syzoj/rootfs:181202``docker export rootfs | sudo tar xvf - -C sandbox-rootfs`,安装 sandbox-rootfs.
10+
4. 运行 `docker-compose up -d`,搭建所有容器。
11+
5. 导入 repo 根目录下的 `init.sql``mysql` 容器中。命令是 `docker exec -i <mysql_container_name> mysql -uroot -p123456 syzoj < init.sql`,其中 `mysql_container_name` 可以通过 `docker ps -a` 找到。
12+
6. 再次运行 `docker-compose up -d`,启动未启动的容器,注意部分出错的容器可能需要重启。

build

Lines changed: 0 additions & 6 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)