Commit 93a34cdb authored by nanahira's avatar nanahira

generate all locale data

parent 1696f378
...@@ -6,20 +6,38 @@ variables: ...@@ -6,20 +6,38 @@ variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
POST_DEPTH: 10 POST_DEPTH: 10
generate: zh-CN:
stage: generate stage: generate
tags: tags:
- linux - linux
image: node image: node
script: variables:
- apt update ; apt -y install build-essential python3 sqlite3 git tar LOCALE: zh-CN
- git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database script: ./ci-scripts/generate.sh
- npm ci artifacts:
- npm run build paths:
- npm start - output
- cd output
- tar zcvf cn-data.tar.gz deck expansions en-US:
- cd .. 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: artifacts:
paths: paths:
- output - output
...@@ -27,7 +45,9 @@ generate: ...@@ -27,7 +45,9 @@ generate:
upload_to_minio: upload_to_minio:
stage: deploy stage: deploy
dependencies: dependencies:
- generate - zh-CN
- en-US
- ja-JP
tags: tags:
- linux - linux
image: python image: python
...@@ -40,7 +60,7 @@ upload_to_minio: ...@@ -40,7 +60,7 @@ upload_to_minio:
deploy_to_ygopro_server: deploy_to_ygopro_server:
stage: deploy stage: deploy
dependencies: dependencies:
- generate - zh-CN
tags: tags:
- linux - linux
script: script:
...@@ -50,6 +70,6 @@ deploy_to_ygopro_server: ...@@ -50,6 +70,6 @@ deploy_to_ygopro_server:
- ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts - ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa - echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/* - 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: only:
- master - master
...@@ -20,6 +20,6 @@ By default, configurations are not needed for default settings. Configurations a ...@@ -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. * `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. * `OUTPUT_PATH` Output path.
...@@ -13,7 +13,7 @@ export async function loadConfig(): Promise<Config> { ...@@ -13,7 +13,7 @@ export async function loadConfig(): Promise<Config> {
return { return {
postDepth: process.env.POST_DEPTH ? parseInt(process.env.POST_DEPTH) : 5, postDepth: process.env.POST_DEPTH ? parseInt(process.env.POST_DEPTH) : 5,
jpDatabasePath: process.env.JP_DATABASE_PATH || "./ygopro-database/locales/ja-JP/cards.cdb", 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" 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