-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
114 lines (105 loc) · 2.48 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
stages:
- pack
- deploy
variables:
GIT_DEPTH: "1"
pack:
stage: pack
dependencies: []
tags:
- linux
script:
- wget -O - https://cdn02.moecube.com:444/ygopro-rush-duel/images/ygopro-rush-duel-images.tar.zst | tar --zstd -xf -
- mkdir expansions
- mv *.cdb expansions/
- mv pics expansions/
- mv script expansions/
- mv *.conf expansions/
- mkdir -p data/ygopro data/ygopro2 archive
- cd expansions
- 7z a -mx9 ../archive/ygopro-rush-duel.zip pics script *.cdb *.conf
- cd ..
- mv archive/ygopro-rush-duel.zip archive/ygopro-rush-duel-$CI_COMMIT_REF_NAME.ypk
- cp -rf expansions data/ygopro/
- mv expansions data/ygopro2/
- 7z a -mx9 ./archive/ygopro-rush-duel-closeup-$CI_COMMIT_REF_NAME.zip picture
- mv picture data/ygopro2/
- mv server data/
artifacts:
paths:
- data
- archive
server:
stage: pack
dependencies: []
tags:
- linux
script:
- mkdir dist
- mv script dist/
- mv *.cdb dist/
- mv lflist.conf dist/
artifacts:
paths:
- dist
.minio:
stage: deploy
dependencies:
- pack
tags:
- linux
script:
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync $uploadDir/ s3://mycard/ygopro-rush-duel/$uploadDir
upload_archive:
extends: .minio
variables:
uploadDir: archive
only:
- master
- tags
upload_data:
extends: .minio
variables:
uploadDir: data
only:
- master
deploy:
stage: deploy
dependencies:
- pack
tags:
- linux
variables:
username: $MYCARD_USERNAME
password: $MYCARD_PASSWORD
appVersion: $CI_COMMIT_TAG
script:
- apt update; apt -y install tar zstd curl jq
- git clone https://code.mycard.moe/mycard/mycard-package-script
- cd mycard-package-script
- ./index.sh makeBuild ygopro-rush-duel ../data/ygopro || true
- ./index.sh makeBuild ygopro2-rush-duel ../data/ygopro2 || true
- cd ..
only:
- tags
.deploy_to_server:
stage: deploy
dependencies:
- server
tags:
- linux
script:
- apt update && apt -y install openssh-client rsync coreutils
- mkdir ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SERVER_HOST >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/*
- rsync -4cavzP --exclude=pics --delete ./dist/ $SERVER_USER@$SERVER_HOST:~/ygopro/expansions
only:
- master
deploy_to_rd:
extends: .deploy_to_server
variables:
SERVER_HOST: rd.mycard.moe
SERVER_USER: root