Commit 529d64a6 authored by Tachibana's avatar Tachibana 🐟

md

parent 7781844e
Pipeline #26217 passed with stages
in 23 minutes and 17 seconds
stages:
- prepare
- deploy
variables:
GIT_DEPTH: "1"
LAST_UPDATE_DATE: "2021.1.19"
CURRENT_UPDATE_DATE: "2021.1.31"
redtext:
stage: prepare
dependencies: []
tags:
- linux
image: git-registry.mycard.moe/nanahira/srvpro:lite
variables:
DATABASE_FILE: expansions/222DIY.cdb
script:
- apt update && apt -y install sqlite3
- mv /ygopro-server/ygopro .
- mkdir dist
- cd ygopro
- mv ../expansions .
- echo "# Result of redtext test of commit $CI_COMMIT_SHA"
- echo "select id from datas;" | sqlite3 $DATABASE_FILE | xargs -I {} ./ygopro {} 2>&1 | tee ../dist/redtext.txt
- cd ..
artifacts:
paths:
- dist/
deploy_to_ygopro_server:
stage: prepare
dependencies: []
tags:
- linux
script:
- apt update && apt -y install openssh-client rsync coreutils
- mkdir ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan 222diy.momobako.com >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/*
- rsync -4cavz --exclude=pics --delete ./expansions/ nanahira@222diy.momobako.com:~/ygopro/expansions
only:
- master
pack:
stage: prepare
dependencies: []
tags:
- linux
image: mono
variables:
GIT_DEPTH: "100"
script:
- sed -i '/mono-project.com/d' /etc/apt/sources.list /etc/apt/sources.list.d/*
- apt update && apt -y install p7zip-full wget git
- mkdir -p dist/archive dist/contents
- git log --pretty=%H --since=$LAST_UPDATE_DATE | xargs -I {} git diff-tree --no-commit-id --name-only --diff-filter=ACMR -r {} | sed "/sound\//d;/update\//d;/.yml/d" | sort | uniq | sed "s/^/'/g;s/\$/'/g" | xargs 7z a -mx9 dist/archive/ygopro-222DIY-update.7z || true
- git clone --depth=1 https://code.mycard.moe/alstroemeria-silentlove/ygopro-222DIY-sound sound
- wget -O update/filelist.txt https://cdn01.moecube.com/ygopro-222DIY/contents/update/filelist.txt || rm -rf update/filelist.txt
- rm -rf .*.yml .git* sound/.git*
- cd update
- ./update-server.sh
- cd ..
- 7z a -mx9 dist/archive/ygopro-222DIY-data.7z expansions update ygopro.exe
- 7z a -mx9 dist/archive/ygopro-222DIY-sound.7z sound
- ls -1 | sed '/dist/d' | xargs -I {} mv {} dist/contents/
artifacts:
paths:
- dist/
only:
- master
cut_pics:
stage: prepare
dependencies: []
tags:
- linux
script:
- apt update && apt -y install imagemagick
- mkdir -p dist/pics/thumbnail
- cd expansions/pics
- ls -1 *.jpg | xargs -P $(nproc) -I {} convert {} -resize 177x254! ../../dist/pics/{}
- ls -1 *.jpg | xargs -P $(nproc) -I {} convert {} -resize 44x64! ../../dist/pics/thumbnail/{}
- ls -1 *.png | sed 's/.png$//g' | xargs -P $(nproc) -I {} convert {}.png -resize 177x254! ../../dist/pics/{}.jpg
- ls -1 *.png | sed 's/.png$//g' | xargs -P $(nproc) -I {} convert {}.png -resize 44x64! ../../dist/pics/thumbnail/{}.jpg
artifacts:
paths:
- dist/
only:
- master
upload_to_minio:
stage: deploy
dependencies:
- redtext
- pack
- cut_pics
tags:
- linux
image: python
script:
- pip install -U -i https://mirrors.aliyun.com/pypi/simple/ awscli
- cp dist/archive/ygopro-222DIY-data.7z dist/archive/ygopro-222DIY-data-$CURRENT_UPDATE_DATE.7z
- cp dist/archive/ygopro-222DIY-update.7z dist/archive/ygopro-222DIY-update-$CURRENT_UPDATE_DATE.7z
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync dist/ s3://mycard/ygopro-222DIY > /dev/null
only:
- master
echo "resize image who is bigger than 100k";
for i in `find . -size +100k`;
do
convert $i -resize 50% $i;
echo "resize image $i to 50%";
done
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