Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
MyCard
srvpro
Commits
f969b6aa
Commit
f969b6aa
authored
Aug 21, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework dockerfile and ci
parent
0aba86a3
Pipeline
#4792
failed with stages
in 15 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
81 deletions
+131
-81
.gitlab-ci.yml
.gitlab-ci.yml
+120
-27
Dockerfile
Dockerfile
+4
-48
Dockerfile.lite
Dockerfile.lite
+7
-6
No files found.
.gitlab-ci.yml
View file @
f969b6aa
stages
:
stages
:
-
build
-
build
-
build2
-
combine
-
deploy
-
deploy
variables
:
variables
:
GIT_DEPTH
:
"
1"
GIT_DEPTH
:
"
1"
CONTAINER_TEST_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_TEST_IMAGE
_FULL
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-full
CONTAINER_TEST_IMAGE_LITE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-lite
CONTAINER_TEST_IMAGE_LITE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-lite
CONTAINER_TEST_IMAGE_X86_FULL
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86-full
CONTAINER_TEST_IMAGE_X86_LITE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86-lite
CONTAINER_TEST_IMAGE_ARM_FULL
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm-full
CONTAINER_TEST_IMAGE_ARM_LITE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm-lite
CONTAINER_RELEASE_IMAGE
:
$CI_REGISTRY_IMAGE:latest
CONTAINER_RELEASE_IMAGE
:
$CI_REGISTRY_IMAGE:latest
CONTAINER_RELEASE_IMAGE_FULL
:
$CI_REGISTRY_IMAGE:full
CONTAINER_RELEASE_IMAGE_LITE
:
$CI_REGISTRY_IMAGE:lite
CONTAINER_RELEASE_IMAGE_LITE
:
$CI_REGISTRY_IMAGE:lite
build
:
build
_lite_x86
:
stage
:
build
stage
:
build
tags
:
tags
:
-
docker
-
docker
variables
:
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_X86_LITE
script
:
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull --no-cache -
t $CONTAINER_TES
T_IMAGE .
-
docker build --pull --no-cache -
f ./Dockerfile.lite -t $TARGE
T_IMAGE .
-
docker push $
CONTAINER_TES
T_IMAGE
-
docker push $
TARGE
T_IMAGE
build_lite
:
build_lite
_arm
:
stage
:
build
stage
:
build
tags
:
-
docker-arm
variables
:
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_ARM_LITE
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull --no-cache -f ./Dockerfile.lite -t $TARGET_IMAGE .
-
docker push $TARGET_IMAGE
build_full_x86
:
stage
:
build2
tags
:
tags
:
-
docker
-
docker
variables
:
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_X86_LITE
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_X86_FULL
script
:
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull --no-cache -f ./Dockerfile.lite -t $CONTAINER_TEST_IMAGE_LITE .
-
docker build --build-arg BASE_IMAGE=$SOURCE_IMAGE --pull --no-cache -t $TARGET_IMAGE .
-
docker push $CONTAINER_TEST_IMAGE_LITE
-
docker push $TARGET_IMAGE
build_full_arm
:
stage
:
build2
tags
:
-
docker-arm
variables
:
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_ARM_LITE
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_ARM_FULL
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --build-arg BASE_IMAGE=$SOURCE_IMAGE --pull --no-cache -t $TARGET_IMAGE .
-
docker push $TARGET_IMAGE
combine_lite
:
stage
:
build2
tags
:
-
docker
variables
:
SOURCE_IMAGE_1
:
$CONTAINER_TEST_IMAGE_X86_LITE
SOURCE_IMAGE_2
:
$CONTAINER_TEST_IMAGE_ARM_LITE
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_LITE
script
:
-
docker pull $SOURCE_IMAGE_1
-
docker pull $SOURCE_IMAGE_2
-
docker manifest create $TARGET_IMAGE --amend $SOURCE_IMAGE_1 --amend $SOURCE_IMAGE_2
-
docker manifest push $TARGET_IMAGE
combine_full
:
stage
:
combine
tags
:
-
docker
variables
:
SOURCE_IMAGE_1
:
$CONTAINER_TEST_IMAGE_X86_FULL
SOURCE_IMAGE_2
:
$CONTAINER_TEST_IMAGE_ARM_FULL
TARGET_IMAGE
:
$CONTAINER_TEST_IMAGE_FULL
script
:
-
docker pull $SOURCE_IMAGE_1
-
docker pull $SOURCE_IMAGE_2
-
docker manifest create $TARGET_IMAGE --amend $SOURCE_IMAGE_1 --amend $SOURCE_IMAGE_2
-
docker manifest push $TARGET_IMAGE
upload_stuff_to_minio
:
upload_stuff_to_minio
:
stage
:
deploy
stage
:
deploy
tags
:
tags
:
-
linux
-
linux
image
:
$CONTAINER_TEST_IMAGE
image
:
$CONTAINER_TEST_IMAGE
_FULL
script
:
script
:
-
apt update ; apt -y install python3-pip
-
apt update ; apt -y install python3-pip
-
pip3 install -U -i https://mirrors.aliyun.com/pypi/simple/ awscli
-
pip3 install -U -i https://mirrors.aliyun.com/pypi/simple/ awscli
...
@@ -42,35 +106,64 @@ upload_stuff_to_minio:
...
@@ -42,35 +106,64 @@ upload_stuff_to_minio:
only
:
only
:
-
master
-
master
deploy_latest
:
deploy_latest
_full
:
stage
:
deploy
stage
:
deploy
tags
:
tags
:
-
docker
-
docker
variables
:
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_FULL
TARGET_IMAGE
:
$CONTAINER_RELEASE_IMAGE_FULL
TARGET_IMAGE_2
:
$CONTAINER_RELEASE_IMAGE
script
:
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker pull $SOURCE_IMAGE
-
docker pull $CONTAINER_TEST_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
-
docker push $TARGET_IMAGE
-
docker push $CONTAINER_RELEASE_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE_2
-
docker pull $CONTAINER_TEST_IMAGE_LITE
-
docker push $TARGET_IMAGE_2
-
docker tag $CONTAINER_TEST_IMAGE_LITE $CONTAINER_RELEASE_IMAGE_LITE
-
docker push $CONTAINER_RELEASE_IMAGE_LITE
only
:
only
:
-
master
-
master
deploy_
tag
:
deploy_
latest_lite
:
stage
:
deploy
stage
:
deploy
tags
:
tags
:
-
docker
-
docker
variables
:
variables
:
CONTAINER_TAG_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_LITE
CONTAINER_TAG_IMAGE_LITE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-lite
TARGET_IMAGE
:
$CONTAINER_RELEASE_IMAGE_LITE
script
:
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker pull $SOURCE_IMAGE
-
docker pull $CONTAINER_TEST_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker tag $CONTAINER_TEST_IMAGE $CONTAINER_TAG_IMAGE
-
docker push $TARGET_IMAGE
-
docker push $CONTAINER_TAG_IMAGE
only
:
-
docker pull $CONTAINER_TEST_IMAGE_LITE
-
master
-
docker tag $CONTAINER_TEST_IMAGE_LITE $CONTAINER_RELEASE_IMAGE_LITE
-
docker push $CONTAINER_RELEASE_IMAGE_LITE
deploy_tag_full
:
stage
:
deploy
tags
:
-
docker
variables
:
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_FULL
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-full
TARGET_IMAGE_2
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
script
:
-
docker pull $SOURCE_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker push $TARGET_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE_2
-
docker push $TARGET_IMAGE_2
only
:
-
tags
deploy_tag_lite
:
stage
:
deploy
tags
:
-
docker
variables
:
SOURCE_IMAGE
:
$CONTAINER_TEST_IMAGE_LITE
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-lite
script
:
-
docker pull $SOURCE_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker push $TARGET_IMAGE
only
:
only
:
-
tags
-
tags
Dockerfile
View file @
f969b6aa
# Dockerfile for SRVPro
ARG
BASE_IMAGE=git-registry.mycard.moe/mycard/srvpro:lite
FROM
debian:buster as premake-builder
FROM
$BASE_IMAGE
LABEL
Author="Nanahira <nanahira@momobako.com>"
RUN
apt update
&&
\
env
DEBIAN_FRONTEND
=
noninteractive apt
install
-y
wget build-essential p7zip-full
&&
\
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
WORKDIR
/usr/src
RUN
wget
-O
premake.zip https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-src.zip
&&
\
7z x
-y
premake.zip
&&
\
mv
premake-5.0.0-alpha14 premake
&&
\
cd
premake/build/gmake.unix
&&
\
make
-j
$(
nproc
)
FROM
node:14-buster-slim
RUN
npm
install
-g
pm2
RUN
npm
install
-g
pm2
# apt
RUN
apt update
&&
\
env
DEBIAN_FRONTEND
=
noninteractive apt
install
-y
wget git build-essential libevent-dev libsqlite3-dev mono-complete p7zip-full python3 liblua5.3-dev python
&&
\
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
# srvpro
COPY
. /ygopro-server
WORKDIR
/ygopro-server
RUN
npm ci
&&
\
mkdir
config decks replays logs
COPY
--from=premake-builder /usr/src/premake/bin/release/premake5 /usr/bin/premake5
# ygopro
RUN
git clone
--branch
=
server
--recursive
--depth
=
1 https://github.com/moecube/ygopro
&&
\
cd
ygopro
&&
\
git submodule foreach git checkout master
&&
\
premake5 gmake
&&
\
cd
build
&&
\
make
config
=
release
-j
$(
nproc
)
&&
\
cd
..
&&
\
mv
./bin/release/ygopro
.
&&
\
strip ygopro
&&
\
mkdir
replay expansions
&&
\
rm
-rf
.git
*
bin obj build ocgcore cmake lua premake
*
sound textures .travis.yml
*
.txt appveyor.yml LICENSE README.md
*
.lua strings.conf system.conf
&&
\
ls
gframe |
sed
'/game.cpp/d'
| xargs
-I
{}
rm
-rf
gframe/
{}
# windbot
# windbot
RUN
git clone
--depth
=
1 https://github.com/m
oecube
/windbot /tmp/windbot
&&
\
RUN
git clone
--depth
=
1 https://github.com/m
ycard
/windbot /tmp/windbot
&&
\
cd
/tmp/windbot
&&
\
cd
/tmp/windbot
&&
\
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
&&
\
xbuild /property:Configuration
=
Release /property:TargetFrameworkVersion
=
"v4.5"
&&
\
mv
/tmp/windbot/bin/Release /ygopro-server/windbot
&&
\
mv
/tmp/windbot/bin/Release /ygopro-server/windbot
&&
\
cp
-rf
/ygopro-server/ygopro/cards.cdb /ygopro-server/windbot/
&&
\
cp
-rf
/ygopro-server/ygopro/cards.cdb /ygopro-server/windbot/
&&
\
rm
-rf
/tmp/windbot
rm
-rf
/tmp/windbot
# infos
WORKDIR
/ygopro-server
EXPOSE
7911 7922 7933
# VOLUME [ /ygopro-server/config, /ygopro-server/decks, /ygopro-server/replays, /redis ]
CMD
[ "pm2-docker", "start", "/ygopro-server/data/pm2-docker.json" ]
CMD
[ "pm2-docker", "start", "/ygopro-server/data/pm2-docker.json" ]
Dockerfile.lite
View file @
f969b6aa
# Dockerfile for SRVPro Lite
# Dockerfile for SRVPro Lite
FROM debian:bu
ster
as premake-builder
FROM debian:bu
llseye
as premake-builder
RUN apt update && \
RUN apt update && \
env DEBIAN_FRONTEND=noninteractive apt install -y wget build-essential p7zip-full && \
env DEBIAN_FRONTEND=noninteractive apt install -y wget build-essential p7zip-full && \
...
@@ -12,12 +12,13 @@ RUN wget -O premake.zip https://github.com/premake/premake-core/releases/downloa
...
@@ -12,12 +12,13 @@ RUN wget -O premake.zip https://github.com/premake/premake-core/releases/downloa
cd premake/build/gmake.unix && \
cd premake/build/gmake.unix && \
make -j$(nproc)
make -j$(nproc)
FROM node:14-buster-slim
FROM node:16-bullseye-slim
LABEL Author="Nanahira <nanahira@momobako.com>"
# apt
# apt
RUN apt update && \
RUN apt update && \
env DEBIAN_FRONTEND=noninteractive apt install -y wget git build-essential lib
sqlite3-dev libevent-dev p7zip-full python3 liblua5.3-dev python
&& \
env DEBIAN_FRONTEND=noninteractive apt install -y wget git build-essential lib
event-dev libsqlite3-dev mono-complete p7zip-full python3 python-is-python3 liblua5.3-dev
&& \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*
/tmp/* /var/tmp/*
# srvpro
# srvpro
COPY . /ygopro-server
COPY . /ygopro-server
...
@@ -27,7 +28,7 @@ RUN npm ci && \
...
@@ -27,7 +28,7 @@ RUN npm ci && \
COPY --from=premake-builder /usr/src/premake/bin/release/premake5 /usr/bin/premake5
COPY --from=premake-builder /usr/src/premake/bin/release/premake5 /usr/bin/premake5
RUN git clone --branch=server --recursive --depth=1 https://
github.com/moecube
/ygopro && \
RUN git clone --branch=server --recursive --depth=1 https://
code.mycard.moe/mycard
/ygopro && \
cd ygopro && \
cd ygopro && \
git submodule foreach git checkout master && \
git submodule foreach git checkout master && \
premake5 gmake && \
premake5 gmake && \
...
@@ -45,4 +46,4 @@ WORKDIR /ygopro-server
...
@@ -45,4 +46,4 @@ WORKDIR /ygopro-server
EXPOSE 7911 7922 7933
EXPOSE 7911 7922 7933
# VOLUME [ /ygopro-server/config, /ygopro-server/decks, /ygopro-server/replays ]
# VOLUME [ /ygopro-server/config, /ygopro-server/decks, /ygopro-server/replays ]
CMD [ "n
ode", "ygopro-server.js
" ]
CMD [ "n
pm", "start
" ]
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