Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
playbooks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
playbooks
Commits
7a7e869b
Commit
7a7e869b
authored
Jun 13, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
srvpro
parent
ab9064b3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
193 deletions
+168
-193
install_srvpro.yml
install_srvpro.yml
+8
-128
tasks/srvpro/common.yml
tasks/srvpro/common.yml
+53
-0
tasks/srvpro/windbot.yml
tasks/srvpro/windbot.yml
+32
-0
tasks/srvpro/ygopro.yml
tasks/srvpro/ygopro.yml
+66
-0
update_srvpro.yml
update_srvpro.yml
+9
-65
No files found.
install_srvpro.yml
View file @
7a7e869b
...
...
@@ -2,15 +2,16 @@
-
hosts
:
srvpro
remote_user
:
root
vars
:
install
:
true
# home_path: ~
# fork: mycard
# server_type: public
roles
:
-
name
:
nodejs
vars
:
nodejs_version
:
1
4
nodejs_version
:
1
6
-
name
:
mono
when
:
'
server_type
!=
"tournament"'
when
:
server_type is not defined or server_type != "tournament"
tasks
:
-
name
:
apt
become
:
true
...
...
@@ -40,133 +41,12 @@
dnf
:
name
:
curl,wget,gcc,gcc-c++,make,sqlite-devel,readline-devel,openssl-devel,libevent-devel,p7zip,p7zip-plugins,tar,unzip
when
:
ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >=
8
#- name: lua from source
# include_tasks: tasks/lua-from-source.yml
# when: ansible_os_family != 'Debian'
-
name
:
pre data
git
:
repo
:
'
https://e.coding.net/mercury233/ygopro-pre-data.git'
dest
:
'
{{home_path}}/ygopro-pre-data'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
ygopro
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/ygopro'
dest
:
'
{{home_path}}/ygopro'
version
:
'
{{ygopro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
premake5
unarchive
:
src
:
https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-linux.tar.gz
dest
:
'
{{home_path}}/ygopro/'
creates
:
'
{{home_path}}/ygopro/premake5'
remote_src
:
true
-
name
:
download lua
unarchive
:
src
:
https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.6.tar.gz
dest
:
/tmp/
creates
:
/tmp/lua-5.3.6
remote_src
:
true
when
:
ansible_os_family != 'Debian'
-
name
:
move lua
shell
:
'
cp
-rf
/tmp/lua-5.3.6
{{home_path}}/ygopro/lua
;
cp
-rf
{{home_path}}/ygopro/premake/lua/premake5.lua
{{home_path}}/ygopro/lua/'
args
:
creates
:
'
{{home_path}}/ygopro/lua/premake4.lua'
when
:
ansible_os_family != 'Debian'
-
name
:
debian params
set_fact
:
premake_params
:
'
{{premake_params}}
--lua-deb'
-
name
:
premake5 gmake
shell
:
'
./premake5
gmake
{{premake_params}}'
args
:
chdir
:
'
{{home_path}}/ygopro'
-
name
:
build
make
:
chdir
:
'
{{home_path}}/ygopro/build'
target
:
"
config=release"
params
:
NUM_THREADS
:
'
{{ansible_processor_vcpus}}'
-
name
:
strip ygopro
shell
:
strip bin/release/ygopro
ignore_errors
:
true
args
:
chdir
:
'
{{home_path}}/ygopro'
-
name
:
link ygopro
file
:
state
:
link
src
:
'
./bin/release/ygopro'
path
:
'
{{home_path}}/ygopro/ygopro'
-
name
:
windbot
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/windbot'
dest
:
'
{{home_path}}/windbot'
version
:
'
{{windbot_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
when
:
'
server_type
!=
"tournament"'
-
name
:
build windbot
shell
:
xbuild /p:Configuration=Release /p:TargetFrameworkVersion=v4.5
args
:
chdir
:
'
{{home_path}}/windbot'
when
:
'
server_type
!=
"tournament"'
-
name
:
link windbot.exe
file
:
state
:
link
src
:
'
./bin/Release/WindBot.exe'
path
:
'
{{home_path}}/windbot/WindBot.exe'
when
:
'
server_type
!=
"tournament"'
-
name
:
link cards.cdb
file
:
state
:
link
src
:
'
{{home_path}}/ygopro/cards.cdb'
path
:
'
{{home_path}}/windbot/cards.cdb'
when
:
'
server_type
!=
"tournament"'
-
name
:
srvpro
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/srvpro'
dest
:
'
{{home_path}}/ygopro-server'
version
:
'
{{srvpro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
fixup npm
become
:
true
file
:
path
:
~/.npm
owner
:
'
{{ansible_user_id}}'
group
:
'
{{ansible_user_id}}'
recurse
:
true
when
:
ansible_user_id != 'root'
-
name
:
srvpro npm
npm
:
path
:
'
{{home_path}}/ygopro-server'
ci
:
true
-
name
:
link ygopro repo
file
:
state
:
link
src
:
'
../ygopro'
path
:
'
{{home_path}}/ygopro-server/ygopro'
-
name
:
link windbot repo
file
:
state
:
link
src
:
'
../windbot'
path
:
'
{{home_path}}/ygopro-server/windbot'
when
:
'
server_type
!=
"tournament"'
-
name
:
directories
file
:
state
:
directory
path
:
'
{{
home_path
}}/{{
item
}}'
with_items
:
-
ygopro/replay
-
ygopro-server/decks
-
ygopro-server/replays
-
ygopro-server/logs
-
ygopro-server/config
-
ygopro-server/plugins
include_tasks
:
./tasks/srvpro/ygopro.yml
vars
:
ygopro_path
:
'
{{home_path}}/ygopro'
-
name
:
common
include_tasks
:
./tasks/srvpro/common.yml
-
name
:
stop firewalld
become
:
true
ignore_errors
:
true
...
...
tasks/srvpro/common.yml
0 → 100644
View file @
7a7e869b
-
name
:
pre data
git
:
repo
:
'
https://e.coding.net/mercury233/ygopro-pre-data.git'
dest
:
'
{{home_path}}/ygopro-pre-data'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
windbot
include_tasks
:
./windbot.yml
when
:
server_type is not defined or server_type != "tournament"
-
name
:
set default srvpro_fork
set_fact
:
srvpro_fork
:
'
{{fork}}'
when
:
srvpro_fork is not defined
-
name
:
set default srvpro_branch
set_fact
:
srvpro_branch
:
master
when
:
srvpro_branch is not defined
-
name
:
srvpro
git
:
repo
:
'
https://code.mycard.moe/{{srvpro_fork}}/srvpro'
dest
:
'
{{home_path}}/ygopro-server'
version
:
'
{{srvpro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
register
:
srvpro_result
-
name
:
srvpro npm
npm
:
path
:
'
{{home_path}}/ygopro-server'
ci
:
'
{{install}}'
when
:
srvpro_result.changed or install
-
name
:
link ygopro repo
file
:
state
:
link
src
:
'
../ygopro'
path
:
'
{{home_path}}/ygopro-server/ygopro'
-
name
:
link windbot repo
file
:
state
:
link
src
:
'
../windbot'
path
:
'
{{home_path}}/ygopro-server/windbot'
when
:
server_type is not defined or server_type != "tournament"
-
name
:
srvpro directories
file
:
state
:
directory
path
:
'
{{
home_path
}}/ygopro-server/{{
item
}}'
with_items
:
-
ygopro-server/decks
-
ygopro-server/replays
-
ygopro-server/logs
-
ygopro-server/config
-
ygopro-server/plugins
tasks/srvpro/windbot.yml
0 → 100644
View file @
7a7e869b
-
name
:
set default windbot fork
set_fact
:
windbot_fork
:
'
{{fork}}'
when
:
windbot_fork is not defined
-
name
:
set default windbot branch
set_fact
:
windbot_branch
:
master
when
:
windbot_branch is not defined
-
name
:
windbot
git
:
repo
:
'
https://code.mycard.moe/{{windbot_fork}}/windbot'
dest
:
'
{{home_path}}/windbot'
version
:
'
{{windbot_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
build windbot
shell
:
xbuild /p:Configuration=Release /p:TargetFrameworkVersion=v4.5
args
:
chdir
:
'
{{home_path}}/windbot'
-
name
:
link windbot.exe
file
:
state
:
link
src
:
'
./bin/Release/WindBot.exe'
path
:
'
{{home_path}}/windbot/WindBot.exe'
when
:
install
-
name
:
link cards.cdb
file
:
state
:
link
src
:
'
{{home_path}}/ygopro/cards.cdb'
path
:
'
{{home_path}}/windbot/cards.cdb'
when
:
install
tasks/srvpro/ygopro.yml
0 → 100644
View file @
7a7e869b
-
name
:
set default ygopro_fork
set_fact
:
ygopro_fork
:
'
{{fork}}'
when
:
ygopro_fork is not defined
-
name
:
set default ygopro_branch
set_fact
:
ygopro_branch
:
server
when
:
ygopro_branch is not defined
-
name
:
ygopro
git
:
repo
:
'
https://code.mycard.moe/{{ygopro_fork}}/ygopro'
dest
:
'
{{ygopro_path}}'
version
:
'
{{ygopro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
premake5
unarchive
:
src
:
https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-linux.tar.gz
dest
:
'
{{ygopro_path}}/'
creates
:
'
{{ygopro_path}}/premake5'
remote_src
:
true
-
name
:
download lua
unarchive
:
src
:
https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.3.6.tar.gz
dest
:
/tmp/
creates
:
/tmp/lua-5.3.6
remote_src
:
true
when
:
ansible_os_family != 'Debian'
-
name
:
move lua
shell
:
'
cp
-rf
/tmp/lua-5.3.6
{{ygopro_path}}/lua
;
cp
-rf
{{ygopro_path}}/premake/lua/premake5.lua
{{ygopro_path}}/lua/'
args
:
creates
:
'
{{ygopro_path}}/lua/premake5.lua'
when
:
ansible_os_family != 'Debian'
-
name
:
init default params
set_fact
:
premake_params
:
'
'
when
:
premake_params is not defined
-
name
:
debian params
set_fact
:
premake_params
:
'
{{premake_params}}
--lua-deb'
when
:
ansible_os_family == 'Debian'
-
name
:
premake5 gmake
shell
:
'
./premake5
gmake
{{premake_params}}'
args
:
chdir
:
'
{{ygopro_path}}'
-
name
:
build
make
:
chdir
:
'
{{ygopro_path}}/build'
target
:
"
config=release"
params
:
NUM_THREADS
:
'
{{ansible_processor_vcpus}}'
-
name
:
strip ygopro
shell
:
strip bin/release/ygopro
ignore_errors
:
true
args
:
chdir
:
'
{{ygopro_path}}'
-
name
:
link ygopro
file
:
state
:
link
src
:
'
./bin/release/ygopro'
path
:
'
{{ygopro_path}}/ygopro'
-
name
:
replay directory
file
:
state
:
directory
path
:
'
{{ygopro_path}}/replay'
update_srvpro.yml
View file @
7a7e869b
...
...
@@ -5,82 +5,26 @@
# home_path: ~
# fork: mycard
backup_name
:
'
{{lookup("pipe","date
+%m.%d")}}'
install
:
false
tasks
:
-
name
:
pre data
git
:
repo
:
'
https://e.coding.net/mercury233/ygopro-pre-data.git'
dest
:
'
{{home_path}}/ygopro-pre-data'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
srvpro
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/srvpro'
dest
:
'
{{home_path}}/ygopro-server'
version
:
'
{{srvpro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
register
:
srvpro_result
-
name
:
srvpro npm
npm
:
path
:
'
{{home_path}}/ygopro-server'
ci
:
true
when
:
srvpro_result.changed
-
name
:
windbot
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/windbot'
dest
:
'
{{home_path}}/windbot'
version
:
'
{{windbot_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
when
:
'
server_type
!=
"tournament"'
-
name
:
build windbot
shell
:
xbuild /p:Configuration=Release /p:TargetFrameworkVersion=v4.5
args
:
chdir
:
'
{{home_path}}/windbot'
when
:
'
server_type
!=
"tournament"'
-
name
:
remove deprecated ygopro-new
file
:
path
:
'
{{home_path}}/ygopro-new'
state
:
absent
-
name
:
premake5
unarchive
:
src
:
https:/cdn01.moecube.com/nanahira/premake-5.0.0-alpha14-linux.tar.gz
dest
:
'
{{home_path}}/ygopro/'
creates
:
'
{{home_path}}/ygopro/premake5'
remote_src
:
true
-
name
:
ygopro new
shell
:
'
cp
-rf
{{home_path}}/ygopro
{{home_path}}/ygopro-new'
-
name
:
ygopro
git
:
repo
:
'
https://code.mycard.moe/{{fork}}/ygopro'
dest
:
'
{{home_path}}/ygopro-new'
version
:
'
{{ygopro_branch}}'
force
:
true
accept_hostkey
:
true
track_submodules
:
true
-
name
:
debian params
set_fact
:
premake_params
:
'
{{premake_params}}
--lua-deb'
-
name
:
premake5 gmake
shell
:
'
./premake5
gmake
{{premake_params}}'
args
:
chdir
:
'
{{home_path}}/ygopro-new'
-
name
:
build
make
:
chdir
:
'
{{home_path}}/ygopro-new/build'
target
:
'
config=release'
params
:
NUM_THREADS
:
'
{{ansible_processor_vcpus}}'
-
name
:
strip ygopro
shell
:
strip bin/release/ygopro
args
:
chdir
:
'
{{home_path}}/ygopro-new'
include_tasks
:
./tasks/srvpro/ygopro.yml
vars
:
ygopro_path
:
'
{{home_path}}/ygopro-new'
-
name
:
remove same backup
file
:
path
:
'
{{home_path}}/ygopro-backup-{{backup_name}}'
state
:
absent
-
name
:
move ygopro
shell
:
'
mv
{{home_path}}/ygopro
{{home_path}}/ygopro-backup-{{backup_name}}
&&
mv
{{home_path}}/ygopro-new
{{home_path}}/ygopro'
-
name
:
common
include_tasks
:
./tasks/srvpro/common.yml
-
name
:
update callback
shell
:
'
{{update_callback}}'
when
:
update_callback is defined and update_callback
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment