Commit 25976343 authored by nanahira's avatar nanahira

update ci to prepare every file

parent e6e38cd6
Pipeline #37910 passed with stages
in 2 minutes and 57 seconds
stages: stages:
- prepare
- generate - generate
- deploy - deploy
- deploy2 - deploy2
...@@ -7,8 +8,38 @@ variables: ...@@ -7,8 +8,38 @@ variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
POST_DEPTH: 10 POST_DEPTH: 10
prepare_mats:
stage: prepare
tags:
- linux
script:
- mkdir mats
- cd mats
- git clone --depth=1 https://code.moenext.com/mycard/ygopro-database
- wget -O pack.db https://cdn02.moecube.com:444/ygopro-card-list/pack.db
- wget -O lflist.conf https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf
- cd ..
artifacts:
paths:
- mats
npm_ci:
stage: prepare
tags:
- linux
script:
- npm ci
- npm run build
artifacts:
paths:
- node_modules
- build
.task: .task:
stage: generate stage: generate
dependencies:
- prepare_mats
- npm_ci
tags: tags:
- linux - linux
variables: variables:
......
...@@ -2,19 +2,14 @@ ...@@ -2,19 +2,14 @@
set -x set -x
set -o errexit set -o errexit
export JP_DATABASE_PATH="./jp.cdb" export JP_DATABASE_PATH="./mats/ygopro-database/locales/ja-JP/cards.cdb"
export SOURCE_TARGET_PATH="./ygopro-database/locales/$LOCALE/cards.cdb" export SOURCE_TARGET_PATH="./mats/ygopro-database/locales/$LOCALE/cards.cdb"
export LFLIST_PATH="./mats/lflist.conf"
export CARD_LIST_DATABASE_PATH="./mats/pack.db"
export OUTPUT_PATH="./output/$FILE_SYMBOL-$LOCALE" export OUTPUT_PATH="./output/$FILE_SYMBOL-$LOCALE"
apt update ; apt -y install build-essential python3 sqlite3 git tar apt update ; apt -y install sqlite3
git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database
wget -O pack.db https://cdn02.moecube.com:444/ygopro-card-list/pack.db
wget -O lflist.conf https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf
cp -rf ./ygopro-database/locales/ja-JP/cards.cdb "$JP_DATABASE_PATH"
npm ci
npm run build
npm run "$NPM_SCRIPT" npm run "$NPM_SCRIPT"
cp -rf ./extras/$FILE_SYMBOL/injects/* "$OUTPUT_PATH/" || true cp -rf ./extras/$FILE_SYMBOL/injects/* "$OUTPUT_PATH/" || true
......
...@@ -199,14 +199,14 @@ export class DBReader extends Base { ...@@ -199,14 +199,14 @@ export class DBReader extends Base {
async generateBanlist(codes: number[], extraBanlists: Banlist[] = []) { async generateBanlist(codes: number[], extraBanlists: Banlist[] = []) {
const otherCodes = await this.getOtherCardCodes(codes); const otherCodes = await this.getOtherCardCodes(codes);
const generatedBanlist: Banlist = { const generatedBanlist: Banlist = {
name: moment().format('YYYY.MM') + ' ' + this.config.descSymbol, name: moment().format('YYYY.MM') + ' ' + this.config.fileSymbol,
list: [ list: [
otherCodes otherCodes
] ]
}; };
const banlistString = await generateBanlistFromCode( const banlistString = await generateBanlistFromCode(
extraBanlists?.length extraBanlists?.length
? extraBanlists.map(l => mergeBanlists([generatedBanlist, l], extraBanlists.length === 1 ? generatedBanlist.name : l.name)) ? extraBanlists.map(l => mergeBanlists([generatedBanlist, l], l.name))
: [generatedBanlist] : [generatedBanlist]
); );
await fs.writeFile(`${this.config.outputPath}/expansions/lflist.conf`, banlistString); await fs.writeFile(`${this.config.outputPath}/expansions/lflist.conf`, banlistString);
......
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