Commit 93a34cdb authored by nanahira's avatar nanahira

generate all locale data

parent 1696f378
......@@ -6,20 +6,38 @@ variables:
GIT_DEPTH: "1"
POST_DEPTH: 10
generate:
zh-CN:
stage: generate
tags:
- linux
image: node
script:
- apt update ; apt -y install build-essential python3 sqlite3 git tar
- git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database
- npm ci
- npm run build
- npm start
- cd output
- tar zcvf cn-data.tar.gz deck expansions
- cd ..
variables:
LOCALE: zh-CN
script: ./ci-scripts/generate.sh
artifacts:
paths:
- output
en-US:
stage: generate
tags:
- linux
image: node
variables:
LOCALE: en-US
script: ./ci-scripts/generate.sh
artifacts:
paths:
- output
ja-JP:
stage: generate
tags:
- linux
image: node
variables:
LOCALE: ja-JP
script: ./ci-scripts/generate.sh
artifacts:
paths:
- output
......@@ -27,7 +45,9 @@ generate:
upload_to_minio:
stage: deploy
dependencies:
- generate
- zh-CN
- en-US
- ja-JP
tags:
- linux
image: python
......@@ -40,7 +60,7 @@ upload_to_minio:
deploy_to_ygopro_server:
stage: deploy
dependencies:
- generate
- zh-CN
tags:
- linux
script:
......@@ -50,6 +70,6 @@ deploy_to_ygopro_server:
- ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/*
- rsync -4cavzP --delete output/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
- rsync -4cavzP --delete output/zh-CN/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
only:
- master
......@@ -20,6 +20,6 @@ By default, configurations are not needed for default settings. Configurations a
* `POST_DEPTH` How many pages it would read in the homepage of NWBBS.
* `CN_DATABASE_PATH` `JP_DATABASE_PATH` Japanese and Chinese database path.
* `SOURCE_TARGET_PATH` `JP_DATABASE_PATH` Japanese and Chinese database path.
* `OUTPUT_PATH` Output path.
......@@ -13,7 +13,7 @@ export async function loadConfig(): Promise<Config> {
return {
postDepth: process.env.POST_DEPTH ? parseInt(process.env.POST_DEPTH) : 5,
jpDatabasePath: process.env.JP_DATABASE_PATH || "./ygopro-database/locales/ja-JP/cards.cdb",
cnDatabasePath: process.env.CN_DATABASE_PATH || "./ygopro-database/locales/zh-CN/cards.cdb",
cnDatabasePath: process.env.SOURCE_TARGET_PATH || "./ygopro-database/locales/zh-CN/cards.cdb",
outputPath: process.env.OUTPUT_PATH || "./output"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment