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

+29
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

+17
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

+12
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

-6
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

init.sql deploy/init.sql

File renamed without changes.

install.sh deploy/prepare.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
2-
cp -r config-base config
32
SECRET=$(dd if=/dev/urandom | tr -dc A-Za-z0-9 | head -c${1:-16})
43
sed -i "s/@SESSION_SECRET@/$SECRET/g" config/web.json
54
sed -i "s/@JUDGE_TOKEN@/$SECRET/g" config/web.json
65
sed -i "s/@JUDGE_TOKEN@/$SECRET/g" config/daemon.json
76
sed -i "s/@EMAIL_JWT_SECRET@/$SECRET/g" config/web.json
8-
docker run -i --rm --network syzojng_syzojng mariadb:10.3 mysql -uroot -p123456 -hmysql < init.sql

docker/Dockerfile

-3
This file was deleted.

judge-v3/.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
# Created by https://www.gitignore.io/api/vim,node
3+
4+
### Node ###
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
24+
# nyc test coverage
25+
.nyc_output
26+
27+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28+
.grunt
29+
30+
# Bower dependency directory (https://bower.io/)
31+
bower_components
32+
33+
# node-waf configuration
34+
.lock-wscript
35+
36+
# Compiled binary addons (http://nodejs.org/api/addons.html)
37+
build/Release
38+
39+
# Dependency directories
40+
node_modules/
41+
jspm_packages/
42+
43+
# Typescript v1 declaration files
44+
typings/
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional eslint cache
50+
.eslintcache
51+
52+
# Optional REPL history
53+
.node_repl_history
54+
55+
# Output of 'npm pack'
56+
*.tgz
57+
58+
# Yarn Integrity file
59+
.yarn-integrity
60+
61+
# dotenv environment variables file
62+
.env
63+
64+
65+
### Vim ###
66+
# swap
67+
[._]*.s[a-v][a-z]
68+
[._]*.sw[a-p]
69+
[._]s[a-v][a-z]
70+
[._]sw[a-p]
71+
# session
72+
Session.vim
73+
# temporary
74+
.netrwhist
75+
*~
76+
# auto-generated tag files
77+
tags
78+
79+
# End of https://www.gitignore.io/api/vim,node
80+
81+
/lib/
82+
/testdata/

judge-v3/.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// 将设置放入此文件中以覆盖默认值和用户设置。
2+
{
3+
}

0 commit comments

Comments
 (0)