auto-generated docker image for server-cli based on kaniko like i researched for torvus and correct release branch detection:

- ade4d37575
This commit is contained in:
Marcel Märtens 2020-02-26 00:10:00 +01:00
parent 21291739e5
commit 1fbdb9c590
4 changed files with 67 additions and 10 deletions

View File

@ -8,7 +8,8 @@ variables:
stages: stages:
- optional-builds - optional-builds
- check-compile - check-compile
- post - build-post
- publish
before_script: before_script:
- source $HOME/.cargo/env - source $HOME/.cargo/env
@ -90,10 +91,10 @@ security:
# -- # --
# -- post build # -- build-post
unittests: unittests:
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
tags: tags:
@ -103,7 +104,7 @@ unittests:
- cargo test || cargo test || cargo test || cargo test - cargo test || cargo test || cargo test || cargo test
coverage: coverage:
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
tags: tags:
@ -113,7 +114,7 @@ coverage:
- cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v - cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v
benchmarks: benchmarks:
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
tags: tags:
@ -125,7 +126,7 @@ benchmarks:
localization-status: localization-status:
variables: variables:
GIT_DEPTH: 0 GIT_DEPTH: 0
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
allow_failure: true allow_failure: true
@ -135,14 +136,15 @@ localization-status:
- cargo test -q test_all_localizations -- --nocapture --ignored - cargo test -q test_all_localizations -- --nocapture --ignored
linux: linux:
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
only: only:
refs: refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+/
- /^master$/ - /^master$/
- /^docker-server$/
tags: tags:
- veloren-docker - veloren-docker
script: script:
@ -160,13 +162,13 @@ linux:
expire_in: 1 week expire_in: 1 week
windows: windows:
stage: post stage: build-post
when: delayed when: delayed
start_in: 5 seconds start_in: 5 seconds
only: only:
refs: refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+/
- /^master$/ - /^master$/
tags: tags:
- veloren-docker - veloren-docker
@ -182,3 +184,30 @@ windows:
- LICENSE - LICENSE
expire_in: 1 week expire_in: 1 week
# -- # --
# -- publish
docker:
stage: publish
when: delayed
start_in: 5 seconds
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
dependencies:
- linux
before_script:
- ls "$CI_PROJECT_DIR/server-cli/"
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
- /^docker-server$/
tags:
- veloren-docker
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-server"
# --

8
server-cli/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM debian:stable-slim
ARG PROJECTNAME=server-cli
COPY ./server-cli/docker-run.sh /opt/docker-run.sh
COPY ./veloren-server-cli /opt/veloren-server-cli
COPY ./assets/common /opt/assets/common
COPY ./assets/world /opt/assets/world

View File

@ -0,0 +1,17 @@
version: "3.7"
services:
game-server:
image: registry.gitlab.com/veloren/veloren:master-server
ports:
- "14004:14004"
- "14005:14005"
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
order: stop-first
failure_action: rollback
restart_policy:
condition: on-failure

3
server-cli/docker-run.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cd /opt
RUST_LOG=info,common=debug,common::net=info RUST_BACKTRACE=1 /opt/veloren-server-cli